« Return to Thread: Z-fighting/clipping issue with plotting objects on a globe (sphere)

Viewport layer sorting problem

by jmerrill_2001 :: Rate this Message:

Reply to Author | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.

I’m having a problem sorting some viewport layers.  Two of the layers in the code below, menuPlaneLayer and gameBoardLayer sort fine, but the one that contains the Collada file (gameComponentsLayer) does not – it appears behind everything.  What am I doing wrong?

 

var testColladaMaterialsList:MaterialsList = new MaterialsList();

testColladaMaterialsList.addMaterial ( new ColorMaterial ( 0xD3C8AD), "ERDefaultMaterial"); 

var testCollada:Collada = new Collada("assets/componentmodels/testmodel1/testmodel1.dae", testColladaMaterialsList);

testCollada.rotationX = -90;

testCollada.z = -100;

_gameComponents.addChild(testCollada);

 

//Create gameboard plane

var planeMaterial:ColorMaterial = new ColorMaterial(0x);

planeMaterial.doubleSided = true;

_gameboard = new Plane(planeMaterial, 500, 400, 3, 3);

_gameboard.addChild(_gameComponents);

_gameboard.rotationX = 70;

 

//separate and sort layers for proper clipping:

var menuPlaneLayer:ViewportLayer = _viewport.getChildLayer(_menuPlane);

var gameboardLayer:ViewportLayer = _viewport.getChildLayer(_gameboard);

var gameComponentsLayer:ViewportLayer = _viewport.getChildLayer(_gameComponents);

menuPlaneLayer.layerIndex = 1;

gameboardLayer.layerIndex = 2;

gameComponentsLayer.layerIndex = 3;

_viewport.containerSprite.sortMode = ViewportLayerSortMode.INDEX_SORT;

 

_scene.addChild(_gameboard);

 

Thanks for any advice,

 

Jason Merrill

Bank of  America smallLogo  Global Learning

Shared Services Solutions Development


Monthly meetings on the Adobe Flash platform for rich media experiences - join the Bank of America Flash Platform Community

 

 



_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org

 « Return to Thread: Z-fighting/clipping issue with plotting objects on a globe (sphere)