PDA

View Full Version : vector from 3 angles+speed



10-28-2005, 06:45 AM
I know opengl has the functions I need, as I can draw an object rotated on all 3 axes. However, if I want to find the velocity of an object given 3 rotations (around x,y, and z axes) and put it into a vector giving x, y, and z speeds, is there anyway to get ogl to do this for me?

10-30-2005, 10:05 AM
should i post this in a different forum?

Overmind
10-31-2005, 01:43 AM
Just calculate it yourself.

x = v * cos(theta) * cos(phi)
y = v * sin(theta) * cos(phi)
z = v * sin(phi)

Where theta and phi are the angles and v is the speed.