Archived

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

paniq

how to do 360° freespace 3d-movement?

Recommended Posts

paniq    122
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


Link to post
Share on other sites
Naku    151
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


Link to post
Share on other sites
paniq    122
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


Link to post
Share on other sites
Dobbs    164
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.

Share this post


Link to post
Share on other sites