just uploaded fix to this angle error. the prebaker included in api is an early version. You should use Prefab instead. alpha are respected in Prefab's version.
I haven't updated the svn with latest version, because Prefab has too many diffs with the engine regarding this feature. Fabrice On Nov 8, 2010, at 11:04 AM, Aduen wrote: > Hi my name is Aduen and I am using Away3d because of the Prebaking > class, something that kicks the Flash performance sky-high. > > I want to keep my project as low profile as possible, I am using > simple Plane primitives with least amount of segments (1), and bitmap > material with a transparency. This results in simple cut-out sprites. > I've put a simple demo online to get an idea what I am doing > http://van-gogh.aduen.nl > > Now, the questions and errors I am running into. > > 1) Using Prebaking with raytrace set to false results in this error: > > ReferenceError: Error #1069: Property getAngle not found on > flash.geom.Vector3D and there is no default value. > at MethodInfo-741() > at away3d.materials.utils::LightPrebaker/generate() > at away3d.materials.utils::LightPrebaker/draw() > at away3d.materials.utils::LightPrebaker/apply() > > which I narrowed down to the following line in > away3d.materials.utils.Prebaker: > > function setVertexColor(d:Vector3D, n:Vector3D, > colr:int, colg:int, > colb:int):Array > { > var dl:Number; > var factl:Number; > for(j = 0;j<_aLights.length;++j){ > dl = > d.subtract(_aLights[j].lightposition).length; > percentFalloff = > (_aLights[j].lightfalloff- dl)/ > _aLights[j].lightfalloff; > //lightFactor = > _aLights[j].lightposition.getAngle(n); <<-- this > line results in the error > lightFactor = > Vector3DUtils.getAngle(_aLights[j].lightposition, n); <-- changed it > to this > if(percentFalloff > 0 && dl > <_aLights[j].lightfalloff){ > factl = > lightFactor*percentFalloff; > colr += _aLights[j].lightR > *factl; > colg += _aLights[j].lightG > *factl; > colb += _aLights[j].lightB > *factl; > } > } > return [colr, colg, colb]; > > } > > 2) when using transparent png's as Material the raytrace prebaking > does not "shine through" the alpha, it covers it. This also results in > rectangular shadows (planes with transparent png's). I am doing > something wrong or is this not implemented? > > 3) I also run into situations when using more than two light points > when raytracing, the whole scene lights up. I am not able to narrow > this one down yet but, if this sounds familiar to someone please let > me know. It's most likely my own buggy code at this point ;) > > For all that matters, I am most interested in question number 2. > > TIA > Aduén
