Well, the quick-and-dirty way to do it is to scale your x component by cos(t) and your y component by sin(t). You might be happier with a matrix-based solution in the long run, though.
Edit: The math above is, of course, totally bogus. I plead momentary imbecility. johnnywang has the correct solution. D'oh!
What kind of program are you writing, btw?
--
Yours in pedantry,
F
o
x
t
r
o
t
U
n
i
f
o
r
m
"Lines of code don't matter as long as I'm not writing them." -- merlyn
In reply to Re^2: Rotate a 3D vector
by FoxtrotUniform
in thread Rotate a 3D vector
by true
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |