Advertisement

straifing

Started by August 17, 2000 11:03 AM
2 comments, last by quercus 24 years, 3 months ago
I''m trying to straif left and right about an arbitrary viewpoint, so that whatever direction I''m currently facing I''ll straif left and right according to that orientation. Currently I can only straif on the x axis of the world I''m in, rather than from my own orientation. I''d guess there''s some tricky geometry. Is there a good method? Thanks in advance!
Well strafing is the same as walking forward but in a 90 degree angle.





ECKILLER
ECKILLER
Advertisement
You can use a look vector and an up vector and update them when you move/rotate...for the strafe you can move along a side vector that is the cross product between look and up vectors.

From these vectors is quite simple to compute positions, rotations...moreover you can compute modelview matrix with no extra calculations.
IpSeDiXiT
A Quick cheap way
(not reccommened to keep)
would be rotate, tanslate then rotate back again

There are better mathimatical ways but it is kinda hard with out seeing the code


-Jamie

This topic is closed to new replies.

Advertisement