hi fabrice…thanks for all your inspiring work!
ive tried the sharedContext route…but i should have been more specific in that im not using starling but another away 3d view . i am implementing a split view panorma viewer where each view has a camera looking inside a 6 plane cube.
i have set up the code similar to the examples given. here is how i setup the views
private function initStage3D1():void {
// 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.enableDepthAndStencil = true;
stage3DProxy.addEventListener(Stage3DEvent.CONTEXT3D_CREATED, on_initStage3D1);
stage3DProxy.antiAlias = 4;
stage3DProxy.color = 0x0;
}
private function on_initStage3D1(event : *) : void {
trace (“on_initStage3D1”);
initView();
initView2();
initObjects();
addListeners();
}
private function initView():void {
scene = new Scene3D();
view = new View3D(scene);
view.shareContext = true;
view.stage3DProxy = stage3DProxy;
lens = new PerspectiveLens (lastFov);
lastFov = lens.fieldOfView;
view.camera.lens = lens;
view.camera.y = 0;
view.camera.z = -512;
setViewSize (view, 1024, 382, 0, 0);
_stage.addChild(view);
}
private function initView2():void {
view2 = new View3D();
view2.scene = scene;
view2.stage3DProxy = stage3DProxy;
lens = new PerspectiveLens (lastFov);
lastFov = lens.fieldOfView;
view2.camera.lens = lens;
view2.camera.y = -2024;
view2.camera.z = -512;
setViewSize (view2, 1024, 382, 0, 386);
_stage.addChild(view2);
}
private function onUpdate (event : Event) : void {
var diffX:int, diffY:int;
var cameraSpeed : Number = 0.175;
stage3DProxy.clear();
if (view) {
if (isMove) {
diffX = (cameraSpeed * (stage.mouseX - lastMouseX))*-1;
diffY = (cameraSpeed * (stage.mouseY - lastMouseY)) * -1;
//view.camera.
dragController.panAngle = diffX + lastPanAngle;
dragController.tiltAngle = diffY + lastTiltAngle;
}
view.render();
}
if (view2) {
if (isMove) {
diffX = (cameraSpeed * (stage.mouseX - lastMouseX))*-1;
diffY = (cameraSpeed * (stage.mouseY - lastMouseY)) * -1;
//view.camera.
dragController2.panAngle = diffX + lastPanAngle;
dragController2.tiltAngle = diffY + lastTiltAngle;
}
view2.render();
}
stage3DProxy.present();
}
this code kills it even on the desktop:
view2.stage3DProxy = stage3DProxy;
and even with that removed, it only displays one view