wtf!?!? stupid thing

Started by
19 comments, last by Samith 22 years, 5 months ago
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
Advertisement
Hehe, oops.... I misread your post, I apologize for doing that

Edited by - Lord Karnus on November 4, 2001 6:48:35 AM
[email=JValentine_13@hotmail.com]contact[/email]
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
When rotating, say

heading - 90
When rotating, say

heading - 90
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.
quote:
Make sure you convert to radians first (rotation * 3.141592653589793238462643383279502884197169399375105820974944 / 180) so the sines and cosines work right.


LOL This is sick, you have a PI-mania...

- AH
What''s crazy is that''s all from memory
What''s crazy is that''s all from memory
How long did it take you to memorize pi to 58 digits? I think I counted right

This topic is closed to new replies.

Advertisement