Advertisement

Line Matrix Rotation?

Started by September 28, 2002 09:13 PM
2 comments, last by MetaKnight 22 years, 4 months ago
spin = 10;// ten degreees of rotation dir.y = float(cos(spin) - sin(spin)); dir.x = float(cos(spin) + sin(spin)); this isnt really working for me for some reason can anyone help? ive been out of math class for a while
If I''m not mistaken the spin variable needs to be incremented for each use of the rotation for it to have an effect. Otherwise, the code seems okay to me..

Tina
Advertisement
I''m not quite sure what you mean, but it might be this you''re looking for, dunno:


  inline void VecRotate2f(float* a, int Angle){   float Xnew, Ynew;   Xnew = a[0] * Cos[Angle] - a[1] * Sin[Angle];   Ynew = a[0] * Sin[Angle] + a[1] * Cos[Angle];   a[0] = Xnew;   a[1] = Ynew;}  
thanks guys, working!

This topic is closed to new replies.

Advertisement