Render Mesh always on top, How?

Software: Away3D 4.x

62316e, Newbie
Posted: 23 May 2014 09:54 AM   Total Posts: 25

Hello,

I just need to render many cubes with different z-sorting.

I’ve tried using two views, but top view must be transparent.


1. How to render Mesh or ObjectContainer always on top?
2. How to make second view transparent? (backgroundOpacity does not work)

   

Avatar
theMightyAtom, Sr. Member
Posted: 23 May 2014 10:58 AM   Total Posts: 669   [ # 1 ]

You can have 2 views in the same Stage3D instance using the Stage3DManager supplied in Away3D.

Check out this tutorial. While they are using 2 starling layers and 1 away3d layer, you can use 2 Away3D layers instead.
http://away3d.com/tutorials/Away3D_and_Starling_Interoperation

Good Luck!

   

62316e, Newbie
Posted: 28 May 2014 11:12 AM   Total Posts: 25   [ # 2 ]

Hello,
Yes! Thats what i did. But still top view goes under sometimes.
Shall i make 2 proxies or managers?

   

Avatar
theMightyAtom, Sr. Member
Posted: 28 May 2014 11:16 AM   Total Posts: 669   [ # 3 ]

One manager, 2 proxies

   

62316e, Newbie
Posted: 28 May 2014 11:24 AM   Total Posts: 25   [ # 4 ]

Can you please provide a sample?

With 2 proxies the top view is only visible

   

62316e, Newbie
Posted: 28 May 2014 11:59 AM   Total Posts: 25   [ # 5 ]

SOLUTION:

stage3DManager Stage3DManager.getInstance(stage);
stage3DProxy1 stage3DManager.getFreeStage3DProxy();
stage3DProxy1.addEventListener(Stage3DEvent.CONTEXT3D_CREATEDonContextCreated);

...

stage3DProxy1.addEventListener(Event.ENTER_FRAMEonEnterFrame);

...

private function 
onEnterFrame2(e:Event):void
{
    _view
.render();
    
_view2.render();

But the most important part is layeredView.

Do not forget to set topView3D.layeredView = true;

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X