[Papervision3D] Using layers for z-sorting

Andy Zupko azupko at zupko.info
Thu Nov 6 11:40:01 PST 2008


all layers are added to containerSprite - it is the base layer.  So  
those two layers are sorting within container sprite.  You need to  
create a third layer for whatever you want to sort with.


On Nov 6, 2008, at 12:59 PM, niki77 wrote:

>
> viewport.containersprite.layerindex=n;
> viewport.getchildlayer(do3d1).layerindex=n+1;
> viewport.getchildlayer(do3d2).layerindex=n-1;
> is this code working?
> i just want to set default index to current layer then
> manipulate for each do3d to be placed where it should be
> tried but it seems containersprite' layerindex ignored
>
>
> Seb Lee-Delisle-2 wrote:
>>
>> That's right! Glad I could help.
>>
>> Seb
>>
>>
>> On Wed, Nov 5, 2008 at 10:09 PM, Heinrich Ruoff <heinrichruoff at gmail.com 
>> >
>> wrote:
>>> 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?
>>>
>>>
>>> thx
>>> Heinrich
>>>
>>>
>>>
>>> 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);
>>>> furnitureLayer.addDisplayObject3D(object2);
>>>> furnitureLayer.addDisplayObejct3D(object3);
>>>>
>>>> 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!
>>>>
>>>> Seb
>>>>
>>>>
>>>> On Tue, Nov 4, 2008 at 9:40 PM, Heinrich Ruoff <heinrichruoff at gmail.com 
>>>> >
>>>> wrote:
>>>>> 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
>>>>> layer
>>>>> 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
>>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>>
>>>
>>> _______________________________________________
>>> Papervision3D mailing list
>>> Papervision3D at osflash.org
>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>>
>>>
>>
>> _______________________________________________
>> Papervision3D mailing list
>> Papervision3D at osflash.org
>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/Using-layers-for-z-sorting-tp20331908p20367349.html
> Sent from the Papervision3D mailing list archive at Nabble.com.
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org




More information about the Papervision3D mailing list