wtf!?!? stupid thing
ok, im making a small 3d engine thing, right now you just kinda fly around. i got the rotations to work out right, but lets say you rotate to the left 90 degrees, then hit the up button, you excpect to go forward right? well, you go to the right, is there a way i can fix this?
thanks
if you need more detail or need to see my code just tell me
Hehe, oops.... I misread your post, I apologize for doing that
Edited by - Lord Karnus on November 4, 2001 6:48:35 AM
Edited by - Lord Karnus on November 4, 2001 6:48:35 AM
[email=JValentine_13@hotmail.com]contact[/email]
November 01, 2001 08:54 PM
This has nothing to do with rotations nor with the gimbal lock, that''s something totally different.
All you need to do is update your camera translation depending on your flight direction.
- AH
All you need to do is update your camera translation depending on your flight direction.
- AH
Wow, these forums are short on help aren''t they?
I think, Samith, that you need to (as mr. Anonymous Poster stated) change the translation you do when going ''forward''.
Picture this: If you''re facing North and you walk forward, you''ll move North. But if you''re facing West and you walk forward, which way do you think you''ll move?
Your program says North.
How to make it say West?
Your rotation should be calculated from the positive x direction, with the left-rotation as positive to work.
So use this: (steplength is how far you''ll move)
translation for x = cos(rotation) * steplength
translation for z = sin(rotation) * steplength
Make sure you convert to radians first (rotation * 3.141592653589793238462643383279502884197169399375105820974944 / 180) so the sines and cosines work right.
I think, Samith, that you need to (as mr. Anonymous Poster stated) change the translation you do when going ''forward''.
Picture this: If you''re facing North and you walk forward, you''ll move North. But if you''re facing West and you walk forward, which way do you think you''ll move?
Your program says North.
How to make it say West?

Your rotation should be calculated from the positive x direction, with the left-rotation as positive to work.
So use this: (steplength is how far you''ll move)
translation for x = cos(rotation) * steplength
translation for z = sin(rotation) * steplength
Make sure you convert to radians first (rotation * 3.141592653589793238462643383279502884197169399375105820974944 / 180) so the sines and cosines work right.
November 03, 2001 09:03 AM
quote:
Make sure you convert to radians first (rotation * 3.141592653589793238462643383279502884197169399375105820974944 / 180) so the sines and cosines work right.
LOL


- AH
How long did it take you to memorize pi to 58 digits? I think I counted right
Check out my raytracer at http://simp-raytracer.sourceforge.net. Download it at http://www.sourceforge.net/projects/simp-raytracer.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement