Author Topic: Rotate camera with current up axis  (Read 1501 times)

Offline moyosa

  • byte
  • *
  • Posts: 9
    • View Profile
Rotate camera with current up axis
« on: January 20, 2015, 11:19:18 pm »
Here's one of my crazy examples/problems

When my camera is horizontal this works just fine.
cam.rotateCameraY((float) Math.toRadians((double) rotY));

But with my gyroscope I'm changing the camera rotation. So I probably need the current up axis.

So I've tried this. cam.rotateCameraAxis(cam.getUpVector(), (float) Math.toRadians((double) rotY));

But thats not giving me the right results...

Thanks.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Rotate camera with current up axis
« Reply #1 on: January 21, 2015, 07:54:13 am »
Quote
But thats not giving me the right results...
...that's a bit vague. Have you printed out the vector that you are getting from getUpVector()? How does it differ from what you expect?