Gimbal lock sucks. Euler tricks or Quaternions?

Started by
25 comments, last by rileyriley 22 years, 2 months ago
Retained mode doesn''t exist in DX8. It''s not missed.

Justin.
Advertisement
i would suggest not to give up. more power to you once you solve it and finally understand why. i''ve dealt with this problem for well over a month, and it was quite rewarding in the end. and it sounds like you''ve almost got it.

a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
I''m coming very near the month mark ;x

Thanks for the encouragement, though. I actually got reinterested in it on another little scrap of information.. it is just frustrating because I don''t understand the math, and sources sometimes say different things, and sometimes it looks like they say different things but they are actually mathematically equivalent after 14 regrouping steps, or something. I am finally finding some resources on _how to use_ quaternions, as opposed to just on what they _are.._ I''ll let the forum know if (WHEN) I am victorious ;p
--Riley
i can also tell you of another i experience i remember of quaternions. remember the time step you''re using when you rotate. since i was still a beginner back then, i operated the quaternions from the last transformed point, which made all the points spin outta control and off the screen, instead of from a fixed set of vertices. what i mean is, it''s good just to have a set of fixed vertices to reference, and then transform these points to another set of data, and keeping the original vertices intact. that way, the transformation you''d be doing is global, not incremental. in this way, you would be incrementing the transformation, but not the actual vertices.

a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
quote:Original post by Anonymous Poster
Retained mode doesn''t exist in DX8. It''s not missed.


LOL, oh yes.


Superpig
- saving pigs from untimely fates
- sleeps in a ham-mock at www.thebinaryrefinery.cjb.net

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

taken straight from an excellent matrix math faq...

http://skal.planet-d.net/demo/matrixfaq.htm


What is Gimbal lock?
-------------------------

Gimbal lock is the name given to a problem that occurs with the use of Euler angles. Because the final rotation matrix depends on the order of multiplication, it is sometimes the case that the rotation in one axis will be mapped onto another rotation axis.

Even worse, it may become impossible to rotate an object in a desired axis. This is called Gimbal lock.

For example, assume that an object is being rotated in the order Z,Y,X and that the rotation in the Y-axis is 90 degrees.

In this case, rotation in the Z-axis is performed first and therefore correctly. The Y-axis is also rotated correctly. However, after rotation in the Y axis, the X-axis is rotated onto the Z-axis.

Thus, any rotation in the X-axis actually rotates the object in the Z-axis. Even worse, it becomes impossible to rotate the object in the X-axis.

The only solution to this problem is to make use of Quaternions.




Jason FeserCode Geek / Visuals Guyelasticmediaproductionshttp://www.elasticvisuals.com
Personally, I don''t use quaternions, and have never had issues with gimbal lock, so maybe what I''m saying is utterly pointless, or obviously wrong, or what not, but I simply just use a normal matrix, and when I want to rotate it x,y and z radians around whatever axis, I multiply those coords through the matrix first as a vector, then rotate with the rotated vector...
I''ve never had any problems that sound like gimbal lock...

am I ignorant of something here?

This topic is closed to new replies.

Advertisement