Switching to Stage 3d Proxy

Software: Away3D 4.x

Beek, Member
Posted: 11 February 2015 09:21 PM   Total Posts: 67

Hi,

I’m attempting to switch an Away3d from the normal mode I have, to a Stage 3d proxy mode for Virtual Reality.

I’m not sure of the best way to do this.. 

My code for the Stage 3D Proxy is

// Define a new Stage3DManager for the Stage3D objects
 
stage3DManager Stage3DManager.getInstance(stage);

 
// Create a new Stage3D proxy to contain the separate views
 
stage3DProxy stage3DManager.getFreeStage3DProxy();
   
stage3DProxy.addEventListener(Stage3DEvent.CONTEXT3D_CREATEDonContextCreated);
   
stage3DProxy.addEventListener(Event.ENTER_FRAMEonEnterFrame);

   
leftEye = new View3D();
   
leftEye.width stage.stageWidth/2;
   
leftEye.height stage.stageHeight;
   
leftEye.backgroundColor 0xFF6600;
   
   
leftEye.stage3DProxy stage3DProxy;
   
leftEye.shareContext true;
   
   
addChildleftEye );
   
   
rightEye = new View3D();
   
rightEye.width stage.stageWidth/2;
   
rightEye.height stage.stageHeight;
   
rightEye.stage.stageWidth/2;
   
rightEye.backgroundColor 0xFF9900;

   
rightEye.stage3DProxy stage3DProxy;
   
rightEye.shareContext true;

   
   
addChildrightEye );
   
   
leftEye.render();
   
rightEye.render(); 
   

Beek, Member
Posted: 12 February 2015 01:12 AM   Total Posts: 67   [ # 1 ]

Worked it out by removing existing view with view.stage3DProxy.dispose();

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X