modify viewPort on shared context

Software: Away3D 4.x

edzis, Newbie
Posted: 04 December 2012 11:14 AM   Total Posts: 3

I’m using the same stage3D instance for starling and away3d. How to transform the viewPort without affecting the whole stage3D?

Currently I get the following problems.
1) setting size makes the image skewed but still drawn on the whole stage3D area
2) setting position makes the whole stage3D move

Starling should use the whole stage size. But my away3D scene should occupy only a portion of the stage. It should also move on and off the stage along with elements in the traditional displayList.
Example in image.

 

   

Somokon, Member
Posted: 04 December 2012 10:16 PM   Total Posts: 75   [ # 1 ]

Since they share the same stage3D, the back buffer (viewport) must be the same for both away3d and starling.  You will have to use separate stage3D instances (Stage3DProxy) to achieve the effect you want.

Alternatively, you can try using the scissorRect property of Stage3DProxy to only draw to a specific area of the screen before you make the View3D.render() call, but the viewport dimensions will still be the entire screen.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X