[Papervision3D] problem using SimpleLevelOfDetail in ViewportLayer
Simon Briche *** Touche Etoile ***
sbriche at touche-etoile.fr
Thu Sep 11 07:46:12 PDT 2008
Hi list,
It seems that there is an issue with rendering a SimpleLevelOfDetail object
in a ViewportLayer object.
When you create a SimpleLevelOfDetail, only the first object in the object
array is added in the ViewportLayer, even if you set the recurse parameter
to true (if recurse is set to false, nothing is rendered).
Example :
//create a ground
ground = new Plane(new BitmapColorMaterial(0xFFFFFF), 1000, 1000);
scene.addChild(ground);
//create a SimpleLevelOfDetail
var distances:Array = null;
var objects:Array = new Array();
objects.push(sphere1, sphere2, sphere3);
simple = new SimpleLevelOfDetail(objects, 100, 3000, distances);
scene.addChild(simple);
//create an empty viewport layer and add it to the container
parentLayer = new ViewportLayer(viewport, null);
viewport.containerSprite.addLayer(parentLayer);
parentLayer.sortMode = ViewportLayerSortMode.INDEX_SORT;
//create new layers inside the empty parentLayer and set some layer indexes
for them
parentLayer.getChildLayer(ground, true).layerIndex = 1;
parentLayer.getChildLayer(simple,true,true).layerIndex = 2;
In this case, sphere1 is always over the ground, but (when you're far
enough) sphere2 and sphere3 are always under the ground.
I think that simple.currentObject should be added in the ViewportLayer
instead of objects[0].
Is there a way or hack to resolve this issue? Or maybe I'm totally wrong '^^
Thanks
<http://www.touche-etoile.com> Simon Briche
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20080911/dc81c88d/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 6166 bytes
Desc: not available
Url : http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20080911/dc81c88d/attachment-0001.gif
More information about the Papervision3D
mailing list