# The difference between local and world rotation

04 April 2013
The difference between local and world rotation

Hi all,

Bit of a maths question here for you...

Imagine you were stood in the positive Z direction, and your feet were facing outwards (like a ballet dancer) with your right foot pointing negative X and your left foot positive X. The rotations of your right ankle would result in the following:
Z rotation - the amount of elevation (-Z elevating you higher onto your tip-toes)
Y rotation - the amount of turnout (90deg pointing your toe directly along the X-axis)
X rotation - twisting your foot forwards and backwards

Now imaging your feet were not aligned directly along the X-axis with the Y rotation being at around 45deg (ten to two).

If you use the rotate tool at the ankle on a joint chain replicating this setup in world mode, the foot bone falls between the X and Z rotation axis. If you switch to local mode, the Z rotation lines up nicely with the foot bone, the X axis lines up nicely with the foot twist and the Y axis lines up nicely with the foot turnout.
The rotate XYZ values in the channel box for the ankle joint however are all affected when you change the turnout or elevation, and only the foot twist affects only the rotateX.
I am aware that these are the world rotation values which are displaying and there must be some underlying maths which calculates this based on the local rotation.

From what I can gather, this calculation may be based on Euler angles. Perhaps it is matrix algebra or something more geometrical?

If anyone has any ideas as to the maths behind it or can direct me towards a solution it would be much appreciated.

Andy
Attached Images
 elevation.jpg (95.2 KB, 8 views)

Last edited by andyman121 : 04 April 2013 at 02:19 PM.

 04 April 2013 VB2341 Frequenter portfolio Varun Bajaj Troy, US Without getting too much into linear algebra, basically you can build rotation matrices for pitch, yaw, and roll. Taking the product of these 3 matrices, you can obtain the matrix for euler rotations. After that, you can construct the matrix/vector equation A*r=r'. Basically, this could be used calculate the direction the vector r' is pointing in from the vector r. A somewhat similar process can be used in calculating rotation angles. You're basically changing the directions (vectors) of local rotation axes, into what can be expressed as a linear combination of the original three. Further rotations repeat this process. It should be noted, however, that rotations are not commutative operations, as translations are. It's because of this that keeping track of rotations in world space is good, because given a rotation order (xyz typically), it is easier to compute following rotations. Calculating inverse matrices is important to converting between rotations. Look up pitch, yaw and roll matrices to see the math. If you've had any linear algebra/understand how matrices work, you shouldn't have any issue understanding. I'm having trouble understanding what issue you're having though, so I'm not entirely sure what problem you're trying to solve. share quote
 04 April 2013 andyman121 PRO portfolio Andrew Brownridge Manchester, United Kingdom That's really helpful thanks. I'm afraid I don't have any experience with linear algebra and very little with matrices, but I do kind of get the principles of what you say and have come across the pitch, yaw and roll while I've been trying to make sense of all this. What I'm doing is looking at ballet posture and joint alignment. When the dancer is in first position, demi-pointe or en pointe (defined by the elevation described in the previous post), if the foot is not correctly aligned with the lower leg (foot twist in the previous post) it can lead to long term injury. When the joint chain is setup as described earlier with no elevation, it is easy to see the degree of misalignment in the rotateX value. However as elevation is added the rotateX value changes so you are not starting from 0. As you describe the local rotation axis changes and the Euler rotation calculations kick in. What I'm trying to do is calculate what the degree of misalignment is (foot twist in X) regardless of where the foot is elevated or at what degree of turnout. Does that make sense? share quote
 04 April 2013 CGTalk Moderation Expert Thread automatically closed This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum. __________________ CGTalk Policy/Legalities Note that as CGTalk Members, you agree to the terms and conditions of using this website. share quote

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts vB code is On Smilies are On [IMG] code is On HTML code is Off CGSociety Society of Digital Artists www.cgsociety.org Powered by vBulletinCopyright ©2000 - 2006, Jelsoft Enterprises Ltd.
Forum Jump
 Please select one User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home -------------------- Gallery     Latest Entries     Featured 2D     Featured 3D     CG Awards     Community Awards Main     News     General Discussion     Off Topic     Recruitment         Temp Job Board Challenges     Rival Crimson X Chaos     Education     Demo Reel     Portfolio Review GROUPS WIP ADVICE     Pro Select     Art Direction and Interviews     New 2D/3D Sketchbooks 2018     WIP 2D/3D & Animation         WIP/Critique: 3D         WIP/Critique: 2D             Speedpaints & Sketchbooks         WIP/Critique: Animation     Partners and Groups         Kitbash 3D Thunderdome         Collaborative Projects Autodesk     Autodesk Maya         Maya Dynamics         Maya Rendering         Maya Character Setup         Maya Programming     Autodesk Miscellaneous         Autodesk MotionBuilder         Autodesk Mudbox         Autodesk Softimage             XSI: Programming             ICE: Interactive Creative Environment     Autodesk 3ds max         3dsMax Tutorials & Tips         3dsMax Resources         3dsMax SDK and MaxScript         Plugins & Add-ons         Particle Flow     Mudbox Featured Gallery ZBrush     Featured Zbrush Gallery     Pixologic ZBrush     Keyshot     Marvelous Designer Texturing     Allegorithmic Substance         Substance Designer         Substance Painter         Substance Featured Gallery     Texturing XYZ     Mari     Marmoset Toolbag Software     Maxon Cinema 4D         Cinema 4D Resources     Side Effects Houdini     Compositing Software         The Foundry Nuke         Adobe After Effects         Autodesk Effects and Compositing         Eyeon Software Digital Fusion     Additional Software         Lightwave 3D             LW Resources             LW Tutorials         The Foundry Modo             The Foundry Time Travel Challenge         E-on Software Vue         Photoshop / Painter         Blender         3DCoat Techniques     Art Techniques and Theories     Digital Matte Painting         Digital Matte Painting Mini-Challenge     Modeling         Modeling Challenge             Member Model Collection     Texturing and Surfacing     Character Rigging     Animation     Lighting and Shaders         Lighting Challenges     Compositing and Editing     Anatomy and Figurative Art         SPOTLIGHT: Best of the Artistic Anatomy and Figurative Art Forum         Tutorials and Workshops         Personal Anatomy & Sketchbook Threads         References, Resources, and Supplies Technical     VR/AR     Master Virtual Reality with BrioVR     Workstation Builds     Game Engine     Graphics Programming     Technical and Hardware CGS Labs     Sketchbooks     Hardcore Crit     Discussions and Meet Ups
Miscellaneous

All times are GMT. The time now is 04:05 PM.