#### Archived

This topic is now archived and is closed to further replies.

# wtf!?!? stupid thing

This topic is 6160 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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

##### Share on other sites

Edited by - Lord Karnus on November 4, 2001 6:48:35 AM

##### Share on other sites
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

##### Share on other sites
When rotating, say

##### Share on other sites
When rotating, say

##### Share on other sites
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?

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.

##### Share on other sites
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

##### Share on other sites
What''s crazy is that''s all from memory

##### Share on other sites
What''s crazy is that''s all from memory

##### Share on other sites
How long did it take you to memorize pi to 58 digits? I think I counted right

1. 1
2. 2
Rutin
20
3. 3
4. 4
frob
15
5. 5

• 10
• 9
• 13
• 9
• 33
• ### Forum Statistics

• Total Topics
632592
• Total Posts
3007289

×