Help camera, overlay

Started by Thomas., July 10, 2012, 09:38:28 PM

Previous topic - Next topic

Thomas.

What is the fastest way to "clone" camera? I need same camera position, direction, FOV, everything in two world.
How is working object in overlay? Render to target horizontal flips texture, I fix it, but... it isn't ideal solution...

plane.setCulling(false);
plane.setRotationPivot(new SimpleVector(0, 0, 10));
plane.rotateX((float) Math.PI);
plane.translate(0, 0, -8);

EgonOlsen

The fastest way would be


cam.setFOV(src.getFOV);
cam.setPosition(src.getPosition());
cam.getBack().setTo(src.getBack());


Regarding the overlay...try to flip the texture by using this method instead:


setSourceCoordinates(.....);


If you revert upper and lower y, so that lower is actually upper and vice versa, the texture should flip (i haven't texted it, but that's what i would expect...).

Thomas.

Overlay flip works. When I call "ifCam.getBack().setTo(cam.getBack());" overlay is blinking.

EgonOlsen

What is ifCam and where does cam come from? The Overlay-class accesses the Camera of the World that you gave to it in the constructor in its update()-method. Maybe that somehow interferes with your copying?

Thomas.

Oh sorry, two overlay had same depth...