Today i have a problem with Quaternions. I will explain my poblem, so i have a camera and one Spatial. I would like that my character look where the camera look at. I took the camera Quaternion and now i’ve want to take the rotation from the Z axis how shall we do this ? Do you have a solution ?
First Solution :
But i have a bug. In a certain position my character want to turn.
I found the fonction for this.
If somebody is interested :
//In the Declaration
float f = new float;
//In the Update//
f = (cam.getRotation().toAngles(null));
//In the ActionListener//
ninja.setLocalRotation(quat.fromAngles(0, f, 0));[/java]