Hi All!

I try to add some weapons to my simple 3D-shooter.

However, I have big problems calculating the forward vector of the

player.

I found the following code in Quake 1 that converts angles to vectors:

(here a shortened PSEUDO-CODE:)

void AngleVectors(vec3_t angles, vec3_t forward)

{

forward[0] = cos(pitch)*cos(yaw);

forward[1] = cos(pitch)*sin(yaw);

forward[2] = -sin(pitch);

This didn't work. I think it's because of the different coordinateQuote:}

systems,

so I changed it to

void AngleVectors(vec3_t angles, vec3_t forward)

{

forward[2] = -cos(pitch)*cos(yaw);

forward[1] = cos(pitch)*sin(yaw);

forward[0] = -sin(pitch);

This is better, but still not 100% correct.Quote:}

Can you give me some advice how to convert angles to vectors in general?

Thank you in advance,

Chris