This is a matter of calculating back. From the vector frontyou should be able to easily derive yawand pitch.
If your coordinate system has x and z as gender
yaw = atan2(front.z, front.x);
The step can be calculated by normalizing frontand using asin
front.normalize();
pitch = asin(front.y);
If I have time later, I will look at the calculation roll
Otherwise, there is a good suggestion to use gluLookAt
source
share