Hi All,
What is the fastest way to calculate the Heading / Pitch from an incoming vector/normal?
i.e. I have an incoming vector (a Ray) heading to a point. When it reaches the point, I want to (for example) be able to turn the object at the point to point down the direction of the incoming ray (roll is not important in this case).
Now I know you can something along those lines with GluLookAt(), but I'm after making a simple GetHeadingandPitch(NX:Float,NY:Float,NZ:Float, Heading:Float Var, Pitch:Float Var) function.
(I would prefer to do it without resorting to using a Matrix)
Any ideas?
What is the fastest way to calculate the Heading / Pitch from an incoming vector/normal?
i.e. I have an incoming vector (a Ray) heading to a point. When it reaches the point, I want to (for example) be able to turn the object at the point to point down the direction of the incoming ray (roll is not important in this case).
Now I know you can something along those lines with GluLookAt(), but I'm after making a simple GetHeadingandPitch(NX:Float,NY:Float,NZ:Float, Heading:Float Var, Pitch:Float Var) function.
(I would prefer to do it without resorting to using a Matrix)
Any ideas?