- Home /
Question by
vinicius47 · Jun 07, 2014 at 09:19 PM ·
rotationquaternionanglepitchyaw
Set the rotation reference to an direction
I have an object orbiting arround a sphere, and i have to set the rotation in world pos, like an airplane (pitch, yaw, roll), but the reference plane (ground) is the G force vector relative to the sphere(direction between the object and the center of the sphere).
Im trying this:
ang = new Vector3(inpX, inpY, inpZ); // The inputs for pitch, yaw and roll
gee = GetGForce(); // Direction between object and the center of the sphere
rot = Quaternion.LookRotation(gee); // make the object point towards the sphere
rot *= Quaternion.Euler(ang); //add the input angles to the rotation
But one angle affects the other, im stuck.
Comment