www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Thomas. on July 10, 2012, 09:38:28 pm

Title: Help camera, overlay
Post by: Thomas. on July 10, 2012, 09:38:28 pm
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...

Code: [Select]
plane.setCulling(false);
plane.setRotationPivot(new SimpleVector(0, 0, 10));
plane.rotateX((float) Math.PI);
plane.translate(0, 0, -8);
Title: Re: Help camera, overlay
Post by: EgonOlsen on July 10, 2012, 09:46:02 pm
The fastest way would be

Code: [Select]
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:

Code: [Select]
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...).
Title: Re: Help camera, overlay
Post by: Thomas. on July 10, 2012, 10:23:30 pm
Overlay flip works. When I call "ifCam.getBack().setTo(cam.getBack());" overlay is blinking.
Title: Re: Help camera, overlay
Post by: EgonOlsen on July 10, 2012, 10:35:43 pm
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?
Title: Re: Help camera, overlay
Post by: Thomas. on July 10, 2012, 10:45:23 pm
Oh sorry, two overlay had same depth...