VBGamer |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RE: Heres some code Adam Hoult (4 replies, 0 views) (2000-Jul-24) Make sure however that your angles are in radians for COS and SIN to correctly use them.
i.e
Public Const g_DEGTORAD = 1.74532925199433E-02
Cos(Angle * g_DEGTORAD)
Sin(Angle * g_DEGTORAD)
if you don't want a const, you can always calculate the value of the degrees to radian multiplier my setting your radians variable by using the following formulas (formulii ??) =)
pi = 4 * Atn(1)
Radians = (2 * pi) / 360
then just use the radians variable in the same way as the function above.
Of course it is quite processor intensive to have a MULT (iply) in every calculation, so it's always better to store your ANGLE of rotation precomputed in radians, instead of multiplying it each time. (depending on how freakish you are about optimisations =)
Adam
Sysop
|