www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: moyosa on January 20, 2015, 11:19:18 pm

Title: Rotate camera with current up axis
Post by: moyosa 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.
Title: Re: Rotate camera with current up axis
Post by: EgonOlsen 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?