« Return to Thread: Z-fighting/clipping issue with plotting objects on a globe (sphere)
Nevermind,
I figured it out. I wasn’t waiting for the Collada file to fully
load before assigning it to a layer. I did some further googling and found
this post:
http://www.nabble.com/--Viewport-layers,-Colladas,-and-z-fighting-td19716296.html
Jason Merrill
Bank of America
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
From:
Merrill, Jason
Sent: Friday, July 03, 2009 7:19
AM
To: 'papervision3d@...'
Subject: Viewport layer sorting
problem
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
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
« Return to Thread: Z-fighting/clipping issue with plotting objects on a globe (sphere)
| Free embeddable forum powered by Nabble | Forum Help |