[Papervision3D] Using layers for z-sorting
heinrichruoff at gmail.com
Wed Nov 5 14:09:23 PST 2008
It works! Great!!!
Just to understand this right, by default all objects rendered in viewport
are added to the same ViewportLayer.
By calling getChildLayer the passed 3D object is added to a newly created
and returned ViewportLayer?
On Wed, Nov 5, 2008 at 12:57 AM, Seb Lee-Delisle <sebstar55 at gmail.com>wrote:
> Hi Heinrich!
> First of all, add the background to a layer :
> backgroundLayer = viewport.getChildLayer(backgroundObject, true);
> then add all the other objects in the room into a layer :
> furnitureLayer = viewport.getChildLayer(object1, true);
> You can then either sort the 2 layers by index sorting or just force
> the background layer back a bit :
> backgroundLayer.forceDepth = true;
> backgroundLayer.screenDepth = 10000; // (a high number that's the
> furthest anything will be from your camera)
> There are many other ways to approach this, but this is one way that
> should work. And this is all from memory so sorry if the syntax is
> incorrect etc.
> good luck!
> On Tue, Nov 4, 2008 at 9:40 PM, Heinrich Ruoff <heinrichruoff at gmail.com>
> > Hi to All!
> > I'm completely new to pv3d and trying to dig my way through things :-)
> > At the moment I'm stuck with z-sorting items.
> > My scene contains a room and some objects in it.
> > The room should be in a background layer and all objects in foreground
> > using auto z-sorting.
> > I found the ViewportLayer class, but couldn't find any samples how to
> > properly use it.
> > Can anyone help me and point me to the right direction?
> > cheers
> > Heinrich
> > _______________________________________________
> > Papervision3D mailing list
> > Papervision3D at osflash.org
> > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> Papervision3D mailing list
> Papervision3D at osflash.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Papervision3D