View Full Version : Moving on the Z axis

11-16-2003, 12:40 PM
I am creating a first-person shooter, and in my idle function I put:
xpos += speed*cos((Pi/180)*xangle));
ypos += speed*sin((Pi/180)*yangle));
They allow my pivitol point to "travel" with me, but I still need another equation for the z axis!

11-16-2003, 03:37 PM
I believe its something like cos(n_angle)*sin(m_angle) where n_angle and m_angle are one of the 3 components of your orientation.

11-16-2003, 04:32 PM
So n_angle and m_angle are theta and phi? But how would I convert it to the cartesian plane?

11-17-2003, 11:23 AM