Author Topic: Help camera, overlay  (Read 867 times)

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Help camera, overlay
« 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);

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Help camera, overlay
« Reply #1 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...).

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Help camera, overlay
« Reply #2 on: July 10, 2012, 10:23:30 pm »
Overlay flip works. When I call "ifCam.getBack().setTo(cam.getBack());" overlay is blinking.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Help camera, overlay
« Reply #3 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?

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Help camera, overlay
« Reply #4 on: July 10, 2012, 10:45:23 pm »
Oh sorry, two overlay had same depth...