views:

205

answers:

1

Hi,

I'm doing a project using FLARManager augmented reality and the Papervision3D library. Unfortunately, Papervision is giving me a lot of problems.

My scene3D contains a DAE model and a plane. The plane has a MovieMaterial and is playing a video through FLVPlayback. The DAE and the plane are both inside the same DisplayObject3D container. FLARManager transforms the container so that everything appears through the angle of the marker.

My DAE model is a TV, the screen of the TV is transparent. I want to have my Plane inside of my DAE model, so that the Movie playing on the plane material appears to be what is playing on the TV.

The problem is that, even if the plane has a lower Z index then the TV, it always appears in front of the TV.

How do I have my plane and its MovieMaterial appear behind the TV, so that some of its corners are cut out by the TV and the part of the TV thats transparent let me see the Movie? If its impossible, anyone has an idea of how I could get the desired effect of having a movie play on the screen of my DAE tv model?

Thank You.

A: 

Figured it our myself. Here goes:

When you have a DAE model and you want to put it on a ViewportLayer, you need to make sure to recurse through the DAE model, so that all its children get added onto the layer.

this is how you do it:

var daeViewportLayer:ViewportLayer = viewport.containerSprite.getChildLayer(aDae, true, true);

What's important is the third parameter, recurse = true, this will put the DAE and all its children on the layer.

viewport.containerSprite can be replaced by any parent DisplayObject3D of the DAE model.

didibus