Gimbal Lock During Modelling Process

Gimbal Lock During Modelling Process

Anonymous
Not applicable
1,771 Views
2 Replies
Message 1 of 3

Gimbal Lock During Modelling Process

Anonymous
Not applicable

Hello everyone!

 

I wanted to ask a question regarding Gimbal Locking. For almost a year, this issue has been plaguing me. I want to try and explain as best as possible my specific situations before other solutions I have looked up come into play. My professor was stumped, my peers were and so was a lot of other modelers I have thrown my files to. So let me try to break down my modelling process to get an idea then go over some "solutions" I have went over but not seen any changes to. 

 

First Exposure to Gimbal Lock:

When I had to model a character for my animation class, this is when I first got the issue. I modelled the whole character through the box modelling technique. I attached limbs through vert welding when needed and when I made the skeleton, everything was still fine and dandy. At some point during my 2 minute animation, my current exports started to come in with a Gimbal Lock issue. My professor was stumped but through my research, I learned about Gimbal Lock and saw it occurred a lot during the rotation of Axis'. I came to the conclusion that I must have rotated something a bit too much during my timeline and was not able to smooth out where the intense rotation was coming from. From this point I am more wary of rotating bones in positions that would interfere with this.

 

Second Exposure, Not Rotation??:

Second time Gimbal Lock came into my life was when I got onto contract work. It came back again while I was trying to make animations from a more exaggerated character model and it's clothing pieces which were separate objects. There was a lot of skinning and when I found out some articles of clothing had Gimbal Lock but not all I got suspicious. I tried making minor changes to the model with no gain on the issue. I then remodeled the clothing pieces... but this is the weird observation I made from this time around. When I started the shape in the FRONT viewport and dragged towards it, my boxes were cooperating and when I reshaped the clothing, no gimbal lock. I assumed then that this issue occurs if I try to create an object from weird views which could mess up its pivot points and rotation potential. Has not happened on this project with my new skeleton since.

 

Third Exposure, Object Attachment:

So with this new knowledge I wanted to make my own objects in my personal down time to test this theory. It was working great but when I attached the hand, everything went down hill. I feel like I cannot win! There must be something I am missing then if that is the case if it is beyond just front viewport creation.

 

 

So now the solutions I was told about that had me theorize different things or could be potential fixes. 

 

1) Proper viewport adjustment when making new objects.

2) Make sure pivot point is properly aligned to the object and that the reference coordinate system is aligned accordingly. with your world.

3) Apply a Euler Lock rotation

4) Apply a Quaternion rotation

5) Find the animation frame where the Gimbal Lock is occurring. 

6) Check for bone scaling

7) Make sure bones are linked

 

The 3rd and 4th solutions have never worked for me but the only best solution I figured out for myself was making sure I modelled in a proper viewport and thought for sure that was my problem and I did a simple spine bend to test yet still got this issue while doing degrees snap of intervals of 5 from 0-90 degrees. If there are more solutions I could potentially try then I would be happy to try anything. I just want to be consistent with character creation and animation and feel like this issue keeps coming up one too many times no matter what I try.

 

0 Likes
1,772 Views
2 Replies
Replies (2)
Message 2 of 3

ads_royje
Alumni
Alumni

Hi @Anonymous,

 

 

Gimbal Lock happens on Rotations using the Euler XYZ rotations. In Euler math, rotation is calculated in axis order; axis 1 then axis 2 then axis 3.

When axis 2 is rotated, axis 1 follows, when axis 3 is rotated, axis 2 and 1 is rotated.

When rotating axis 2 near 90 degrees, this brings axis 1 near the location of axis 3, so axis 1 and 3 are now near equivalent. The lock is that when trying to rotate the axis 1, it behaved like axis 3 and axis 1 is considered 'locked'.

 

I say axis 1, 2 and 3, as this is about rotation order and not axis names (x y z) in Max, axis 2 is Y by default, but axis order can be changed on the Euler XYZ controller, so gimbal could be on a different axis than Y. It is not about Y but about the second axis.

Gimbal lock happens when the second axis gets near 90 degrees (or -90, 270 / -270, etc ) affecting axis 1 to overlap axis 3.

There is a good (visual) explanation of gimbal here :

https://www.youtube.com/watch?v=zc8b2Jo7mno

 

 

In general, to avoid gimbal, animation should be done on 1st and 3rd axis as much as possible, try to avoid animating on the second axis. If animation needs to be done in that way, most rigs would decouple animations in 2 objects to avoid getting into gimbal lock. 

Or to use, as you mention below, a Quaternion based controller, such as TCB rotation controller in Max.

 

Scaling can indeed affect rotations, that is because in a transform Matrix, rotations and Scaling are intimately related one to another. General rule of thumb is to always have scale values to 100% on each axis (no scaling). Rotations are affected by scaling because they are calculated before scale, so when scaling a rotation, some skewing happens (mainly when scale is not uniform).

 

Also note about linkage (parent - child relations) : Transforms, Position, Rotation, Scale, is an offset from Parent. So Transform values are referring to Parent Space. When doing any transforms, the axis references are always in Parent Axis. So a rotation on Y refers to the Y of the Parent of the object. If object has no parent, it is child of World and refers to World.

 

So in general, to avoid Gimbal Lock :

. stay away from second axis being near +/- 90 degrees ( or 90 factors : 270, 450, 630 etc... in positive or negative values), or use a Quaternion based controller like TCB in Max.

In 3d animation, always keep a scale of 100%, avoiding as much as possible non-uniform scaling.

 

I hope this can help understand Gimbal Lock and avoid it in animation.

 

 

Message 3 of 3

Anonymous
Not applicable

I have some new character models all set up and putting the skeletons in tonight. I am going to try to make some animations but this time avoiding the third axis as best as I can. I did notice my animations used some of the 3rd axis so I may have gone a bit overboard. I will try to reply back ASAP on any progress I make towards this and if this issue persists again. Thank you for the reply!

0 Likes