-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3D Layer (CameraManager) #60
base: master
Are you sure you want to change the base?
Conversation
Hmm, you actually removed #57 here? |
renderClearsContext and renderPresentsContext were deleted. |
From a rough reading of your request, it looks as though it does not retain backward compatibilty because it will require everyone to use CameraManager class in order to present the context by calling CameraManager.drawScreen() ? Also, doesn't look like you retained a mechanism to prevent Camera3D from clearing the context. |
For the following reason, I proposed this method.
Of course, if there is a method of taking compatibility, |
you could easily do so by duplicating camera class into ManagedCamera or something, but that obviusly sucks. do you know if extending the camera is possible, or it has too much private stuff? |
Could you retain compatibility by keeping the flags added in #57, but set them appropriately in your CameraManager class? |
Thank you. I try solution of the following problem.
|
Seems so. So, could you post some short demo too? |
actually what you mean by that? did you successfully extended their camera? e.g. for using scissors for multiple cameras view you need to be able to tweak projection, so that it's centered in scissor rectangle. I never tried myself, but I think someone said it was no feasible. |
Before, it was only a Camera class which can be treated by CameraManager. The following screen shot is an example which uses scissor rectangle. I have not realized yet the function which rectifies distortion of scissor rectangle. ;( |
3D Layer Simple Example was added. |
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.renderClearsContext = false;
camera1.renderPresentsContext = false;
camera1.scissorRect = new Rectangle(0, 0, 420, 480);
camera2.view = vw;
camera2.renderClearsContext = false;
camera2.renderPresentsContext = false;
camera2.scissorRect = new Rectangle(420, 0, 420, 480);
camera3.view = vw;
camera3.renderClearsContext = false;
camera3.renderPresentsContext = false;
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.renderLayers();
cm.drawScreen();
}