views:

177

answers:

1

I'm a bit new to Papervision3D, and I'm trying to set the alpha level on a DAE I'm loading from a Collada file.

How can this be done? I'm aware that I can set useOwnContainer to true and set the alpha then, but I'm trying to avoid this so that I don't need to deal with the layering issues this creates.

A: 

There is not other way you can set transparency. Setting a 3d object on a viewport layer is like giving it a sprite you can play with. If you have layering issues I suggest creating layers for you other content as well. Figure out what will be rendered above and bellow your DAE and make layers for them too, but stack them properly. Have a look at Andy Zupko's post on layering objects. useOwnContainer will make a layer, but you won't have much control over it.

here's some simple code to get you started. I'm using a BasicView, but you understand when I'm using the viewport.

var daeLayer:ViewportLayer = new ViewportLayer(basicView.viewport,null);
basicView.viewport.containerSprite.addLayer(daeLayer);
basicView.viewport.containerSprite.sortMode = ViewportLayerSortMode.INDEX_SORT;
daeLayer.layerIndex = 1;
daeLayer.addDisplayObject3D(yourDAE);
George Profenza