Jump to content
• Advertisement

Archived

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

how to do 360° freespace 3d-movement?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, i still fail to implement a 360°-freespace-movement code for a spaceship, much like the spaceships in descent move. e.g. theres this problem: when i rotate 180° up on the y-axis, the x-axis turns in the wrong direction, or when i rotate 90° up on the y-axis, the x-axis is now my z-axis... since there''s no real X/Y/Z in real space, i wonder how to solve that problem. if anybody could help me out, that''d be just great. Leonard Ritter

Share this post

Share on other sites
Advertisement
I''ve had the same problem (see post http://www.gamedev.net/community/forums/topic.asp?topic_id=55932
)

I after the suggetion made by johnb I found that by changing the order that I applied the rotation matricies to the spaceship this could help the problem but I still hav''t got it working perfectly. Applying the Z-rotation followed by Y-rotation then X-rotation will allow you to rotate arount the Y-axis then the Z-axis of the ship.

But if you rotate arount the X-axis first then the Y-axis it still doesn''t work. Sorry, I don''t know a way to get both rotations to work.

Maybe you can get something from this or someone else can improve my reply.

*Naku

Share this post

Share on other sites
I think the correct order of rotations is ZYX.

Share this post

Share on other sites
the order of rotations is correct, as far as i see, but the spaceship does still not behave like an axis-independent object...

to be precise: how to rotate the ship if i have a local axis and a world axis?

Share this post

Share on other sites
You''re rotating your objects just using euler angles, right? Sounds like you''re running into a common problem called gimbal lock. There''s tricks to get around it while still using euler angles, but most people use matrices or quaternions instead. If you want to learn how to implement these, look in Gamedev''s article & resource section under math & physics. You could also do a search for "gimbal lock" and find lots of relevant stuff.

thank you dobbs

Share this post

Share on other sites

• Advertisement
• Advertisement

• Popular Contributors

1. 1
2. 2
Rutin
24
3. 3
4. 4
JoeJ
18
5. 5
• Advertisement

• 14
• 23
• 11
• 11
• 9
• Forum Statistics

• Total Topics
631766
• Total Posts
3002233
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!