AlternativaPlatform/Alternativa3D — pull request #60 by matsuse (2013-02-13 15:30:22+00:00)
Title: 3D Layer (CameraManager)

Add the controlling function of a camera to #57.
It can be treated like 3D layer. :)

Scissor rectangle is also supported.

[Example]
scene = new Object3D();
scene2 = new Object3D();

vw = new View(stage.stageWidth, stage.stageHeight, false, 0x000000, 0, 16);

camera1 = new Camera3D(1, 6000);
camera2 = new Camera3D(1, 6000);
camera3 = new Camera3D(1, 6000);

camera1.view = vw;
camera1.scissorRect = new Rectangle(0, 0, 420, 480);

camera2.view = vw;
camera2.scissorRect = new Rectangle(420, 0, 420, 480);

camera3.view = vw;
camera3.scissorRect = new Rectangle(840, 0, 440, 480);

addChild(camera1.diagram);
camera1.diagramAlign = "TL";

addChild(camera2.diagram);
camera2.diagramAlign = "TR";

addChild(camera3.diagram);
camera3.diagramAlign = "BL";

scene.addChild(camera1);
scene2.addChild(camera2);
scene.addChild(camera3);

cm = new CameraManager(stage3D, vw);
cm.addCamera(camera1);
cm.addCamera(camera2);
cm.addCamera(camera3);

.
.
.

private function onEnterFrameHandler(ev:Event):void {
cm.clearScreen();
cm.output();
cm.drawScreen();
}