Quarternions??

I just read Victor Navone’s splinophilia tutorial (http://www.navone.org/HTML/Tutorial_Splines2_2.htm) and saw how he could do some really cool things with the rotation curves, like overlaps etc. I went into blender, eager to try it out and found that Blender doesnt use Euler angles but quaternions! I did a bit more reading and found out how good quaternions are for programming etc, and how they do away with gimble lock, but wouldn’t it be easier on artists just to use Euler angles for animating rotation? Or even just to give artists the choice… wouldn’t it be so much more intuitive? Maybe having the choice of keying EuRot or QuartRot?

This is merely an observation, not meant to spark any ‘if you don’t like it go code it yourself’ debates. I’m new to 3d animation, and I am just trying to get an understanding of how blender works with ipo curves etc. The case for quaternions is compelling, but wouldn’t it make blender more intuitive to give the user the choice, in order get the best of both worlds?

Thanks,
Brendan

I’m not going to say go code it yourself, but you are talking about a substantial coding project, to duplicate a function that works. Choices are good, and Blender has many, but I get the impression that most of them are byproducts of something else, rather than designed in function redundancy. I can’t speak for the Blender coders, since I’m not one, but I can tell you they get a lot more love around here when they implement new functions or fix annoying bugs. My guess is that if Euler rotations ever made it onto the to-do list, it would have a pretty low priority.

Now I don’t understand why it would be “easier on artists” to have Euler angles then the current quaternion rotations for armature bones … I mean quaternions are derived from Euler angles in the first place … And to follow the splinophilia tutorial all you have to do is to just adjust the QuatX,Y, and Z curves and just not mess with the QuatW curve (I mean you can if it gives you more control/better results) .
I’m not sure what application Victor Navone is using for his tutorials but what makes you think that it doesn’t use quaternions as well (but maybe just makes the QuatW curve not available to the user)? I mean I was very confused by the “Quats” too but they just represent bone rotation IPO curves with an additional QuatW value which can give you more control and smoother animations … which to me is a plus . The overlap example you cited can be done just as simply by copy/pasting curves from the header in the IPO window in Blender as well and has nothing to do with how armature bone rotations are calculated .
I mean the principles from the splinophilia tutorial can still be followed in Blender (basically to me is: “gee you can use IPO curves to fix bad animations”) but like most things the terms are a little different . And I don’t think having quaternions as opposed to straight Euler angles really make all that much difference . In fact IMHO I personally think that having the additional QuatW curve gives you more control not less … So I don’t understand I guess your premise that somehow having Euler angles would improve or make more intuitive the IPO rotation values for armature bones . From a user point of view I don’t think having Euler angles makes anything better or more intuitive …
What I would be more inclined to request would be for better documentation regarding curve types etc. , because if you didn’t know what “Quat” stood for (like me when I first saw them) you would be inclined to politely close the IPO window and go on your merry way and figure out another way to fix your animations even though it is much simpler to adjust and “smooth” an IPO curve .

I thought the devs were talking about having eulers overlayed over quats at some point. It may have just been idle chit-chat though.

EDIT:

Pahahah. That’s quite the paraphrase. You know this is Victor Navone, right? I watched your animations, by the way, they were something, alright.

Thanks for your in depth responses, and sorry for wasting your time. I guess this has been another example of inexperienced user abit out of his depth. :o Thanks Vertex Pusher, i can see now that it really is only three channels now, with a fourth just to smooth the animations (or something like that). It makes so much more sense now (apart from the W thing). :slight_smile:

And to follow the splinophilia tutorial all you have to do is to just adjust the QuatX,Y, and Z curves and just not mess with the QuatW curve
Have you tried this? Can you demonstrate it in screenshots? I ask because I don’t believe it to be the case and would love to be shown otherwise.

As far as I can discover, quaternion X, Y, Z values are actually derived as a Cosine calculation based on angle and space location or some such thing so the key values are not intuitive unless you can instantly call log and cosine values up from memory. Plus, the QuatW value plays an important role in the actual bone position.

Simply drag some control points around on a Quat Z curve, for example, and see if it bears any resemblance to doing the same thing with a RotZ curve on a mesh object. I tried this (before reading this thread) and found that a key value of 1.0 might set a bone at 90 degrees but 2.0 was barely more and a value somewhere around 500 got the bone rotated near to 180 degrees. A simple hand-drawn IPO had a bone jumping tens of degrees from one frame to the next despite moving smoothly on preceding frames following the same IPO.

Just looking at a set of bone IPOs shows that the W curve is intrinsically involved in the animation since it is anything but flat. Now, since I still scratch my head over quats, maybe there’s something that I’m missing but if it was as easy as just ignoring the W curve, I wonder why every page that discusses quats starts out by saying they are almost inexplicable to mere mortals :spin:

So, while I agree that you can mess with the curves to alter results (eg steeper curve = faster action) I don’t think it’s as straight forward or intuitive as Eulers in which the value you see on the curve relates exactly to the resultant movement on screen. With Eulers, if you want to rotate something 40 degrees around the Z axis, you can whack a key on the 40 degree point on the RotZ IPO. You can’t do that with Quats and I don’t think you can generally do it without using the W curve.

You can see the Euler Rot values in the transform panel and these values don’t relate much to what you see in the Quaternion IPO curves.

Now, I’m not suggesting we be given Eulers since I don’t know that the known problems associated with them would make our lives better (and quats do seem to be gaining popularity) - or that quat curves are impossible to work with as they are - but what would be great is if someone who actually understands the quat curves could put a wiki page together showing examples of practical, hands-on use of them.

Thanks for your in depth responses, and sorry for wasting your time.
It’s not a waste of time to discuss something which also causes discussion and controversy in other animation forums too. No need to apologise. Plus, as a result of these questions and my follow-up “research” into quats and gimbals, I made myself a little 3-ring gimbal-gyro animation. Fun!

Brendan,

A work around is to add an object (cube, empty etc), then add a copy-rotation constraint to the armature, then animate the object (which will be displayed in the IPO editor as Euler angles … ( I think they’re Eulers … … whatever they are … they are displayed in degrees and match up with the transform properties box in the 3d window).

I haven’t used this a lot, so I don’t know if it would cause gimbal lock evenutally (or if gimbal lock is more of a problem with objects than with armatures).

When I use the IPO eidtor, I just ignore what values are displayed, I usually just look for abrupt or too slow/fast changes in their slope curves.

I don’t know why armatures couldn’t use the same display system in the IPO editor that mesh objects use, other than it’s not a priority / interest for any developer to do … which is really the bottom line on why any feature gets added to Blender IMO.

Mike

Now, since I still scratch my head over quats, maybe there’s something that I’m missing but if it was as easy as just ignoring the W curve, I wonder why every page that discusses quats starts out by saying they are almost inexplicable to mere mortals :spin:

That’s exactly why i got so demoralised when i began! I was expecting that i would have had to do some mathematics every time i wanted to animate! By actually testing the curves out myself, i can see its not actually that hard.

Now, I’m not suggesting we be given Eulers since I don’t know that the known problems associated with them would make our lives better (and quats do seem to be gaining popularity) - or that quat curves are impossible to work with as they are - but what would be great is if someone who actually understands the quat curves could put a wiki page together showing examples of practical, hands-on use of them.
I was actually thinking of contributing, so users like me don’t get confused any more. Though i still need to work out what the W curve does to the animation. I guess i’ll have to be brave and look a bit deeper into those mathematical pages…

Some interesting info here, especially the table half-way down the page. You can see from this that the W curve plays its part and that the values are not straight forward.

But yes, without understanding quats, you can mess carefully with the generated curves to make them flatter or steeper but you do need to be careful due to the exponential nature of the calculations.

Well actually I did do some tests myself with the Quats myself . And yes even though quaternion are derived as a cosine calculation from Euler angles that does not make the manipulation of them quite so unintuitive as to make them useless (as in getting unpredictable results) in the context of the armature and its hierarchy . I guess I should have made myself a bit clearer but I was just referring to this relative to the splinophila tutorial …

From what I can directly observe in the IPO window/3D window you have to take in to account the context of the armature object and the bone hierarchy involved to successfully manipulate the quat curves .
And yes you are right they do not behave like the rot curves for mesh objects when you try to predict a correspondence between a curve manipulation and the degree of rotation observed . But then again that is not what Euler angles are either though … What you are describing is a simple calculus mapping function (or maybe even just trig) relative to that mesh object’s center . Euler angles actually describe the “the orientation of a rigid body (a body in which the relative position of all its points is constant) in 3-dimensional Euclidean space” (Wiki) . Which in English( well my English ) means that Euler angles are firstly a relative method of positioning a a static/rigid (which mathematically speaking means that the values are constant because you can use vectors as a “rigid body” as well - more on this later) “body” with it’s object center with regard to another coordinate system (Euclidean) . So Euler angles are hardly intuitive either …
You can actually cause a mesh object to have a direct “Euler” rotational relationship in Blender . Just start rotating it with the cursor (of course not at the object’s center) as the center and key a few frames … You will not get “intuitive results” just by manipulating the “Rot” curves for the object in this situation either … Maybe if you also added the “Loc” keys and and played with those curves (even then not particularly easy), but not directly only by the Rot curves themselves . The object now has a second coordinate system centered around the cursor’s location as well as its own and if you so inclined you can figure out the Euler angles from knowing the position of the cursor as well as the position of the object’s center and map that to a IPO curve (not in Blender you’d have to find/code a program that will do this for you) and if you manipulated those curves I dare say they would not be very “intuitive” either …
As I said above quaternions are derived from//related to Euler angles …
And here (from what I can surmise) is where understanding the armature object/bone hierarchy can make adjusting the quaternion curves not seem so unintuitive . Firstly all bones in the armature are essentially vectors mathematically speaking, that is they have a stating point (the root) and an endpoint (the tip) and a direction (from the root to the tip) and this set of data makes up the “rigid body” requirement for Euler angles (this is in Pose Mode obviously) . And in Blender the default absolute axis of rotation is the Y (up axis also) - this is the axis around which a bone will rotate about itself, important to know when you want to make a bone do just that and because the Y (since all bones have a direction) will always be parallel to the direction of the bone (and I do believe this axis is equivalent to the beta angle range of zero to pi from the Wiki article …) Secondly, in the armature, bones have a hierarchy . This means that the children of a bone inherits the coordinate system of the parent . And to be more specific the coordinates of the tip of the parent bone not the root . So in fact you can derive the two coordinates necessary to calculate Euler angles (or quaternions) from the parent bone if the child is “connected” (but I’m not sure how they handle situations when they are not though … ) .
From the above basics about the armature object and a few empirical tests I have played around with, I personally do not find quaternions all that confusing to adjust . And the key word there is “adjust” not re plot into predictable new animations … manipulating the QuatX,Y,Z curves is pretty predictable if you use them as curves and not graphs to plot specific rotations to . And like I said above QuatY always makes the armature bone rotate around it and QuatX side to side and QuatZ up/down RELATIVE to the root tip of the bone involved … But of course there is the unmentioned QuatW of the quartet … and of course this does have a lot to do with how an animation plays and does change, but from what I understand this is the inherited coordinate value from the parent bone and is generally best left alone as messing too much with this curve really makes things go crazy … But even with this in simpler setups this can be adjusted for better results .

So I think that maybe people are somehow thinking that the RotX,Y,Z curves have anything to do with Euler angles … they don’t and are not “Euler curves” . All they are is the simple graph of the location/rotation/scale of an object relative to time . And looking at quaternions as though they should behave like regular graphed curves without considering the set of inherited coordinates/ the odd orientation of where a particular bone is in space and in the bone hierarchy is making something which if thought through doesn’t need to confuse or intimidate anyone … besides which within the context of the splinophilia tutorial (and I have no idea what software he is using but he can also pull up loc transforms there where as in Blender’s armature system if bones are linked loc transforms have no effect on a bone ) of “cleaning up” animations though the IPO window I don’t think that large changes need to be made to an animation that is usually at first (I do this and I assume most others do too) keyed visually any way …

As for setting up examples … Personally I just don’t really use them much … If you read the last part of my post I do just politely close the IPO window and figure out a another solution … though recently I have been reading up on Euler angles for my project and that’s why I posted here … too much confusion about what Euler angles/quaternions are … though I do as a last desperate measure do have an idea about using quats and pydrivers to get the results I want … maybe I’ll post with that if I do go through with it . But yes someone should at the very least put some info on what “Quat” means … the first time I encountered them I thought it was a directive … You know … go Quat yourself you silly man … the mysteries of Blender are forbidden to the likes of you …

Thanks VP, I can’t disagree with any of that - especially since I didn’t understand most of it :slight_smile:

But yeah, careful manipulation is possible. I just find that sometimes adjustments don’t seem to make as obvious a difference as with object rotation curves.

I guess I’ve also been scared by the fact that I have tried messing with curves to see what results I get (and I do mean messing, not cautiously adjusting) and the results were wildly unpredictable which has never been the case with object Rots where I can and do draw curves from scratch if I want to.

This means that the children of a bone inherits the coordinate system of the parent . And to be more specific the coordinates of the tip of the parent bone not the root . So in fact you can derive the two coordinates necessary to calculate Euler angles (or quaternions) from the parent bone if the child is “connected” (but I’m not sure how they handle situations when they are not though … ) .

When they are not connected the Vector (QuatW) is relative to that of the Root Bone and when the unconnected bone is the Root Bone it is relative to the Armature Object.

%<

Thanks Fligh (also confirmed with some noodling with the armature) …

And sorry AndyD, exposition isn’t one my strong points … But the orientation in orientation in orientation can give anyone vertigo just from thinking about it … and any way I actually looked at some of my animations and found out that quats are completely useless to me in the way I work . I really go out of my way to make all my rigs animate with simple transformations (i.e. grab) and really have no rotations to deal with per se because everything is “automated” with IK so they either work or do not in the 3D View … But for simple armatures or in special circumstances they can be useful … In fact I remember Calvin experimented with a great finger rig using quats and Pydrivers …

found out that quats are completely useless to me

Eular rotations tell the object where to look (think of a camera or a lamp); the X tells it how much to yaw, the Y tells it altitude and Z tells it how much to bank. All three together compute a Vector, the light beam or the FoV for the camera.

With quaternions the Vector is known, and when you move and rotate that bone you have two vectors to campare. Quats are there to compute and then store the interpolation from V1 to V2.

%<

The best intuitive explanation that I’ve dimly-recalled about “Euler space vs. Quats” is that … “Euler space doesn’t ‘exist.’” (Notice the extra set of quotes.)

To struggle valiantly to put it another way, “Euler space” is a great way of describing things “if you are on the outside, looking in,” because the “(X,Y,Z) space” is “absolute” and you, being “on the outside” and thus “not involved,” are also “absolute.” This is great as far as an outsider is concerned, because it gives you a single frame of reference to work from. But the calculations that you need to make in 3D graphics don’t work like that. The calculations that you need to make are not absolute at all; they are “relative to you, whereever you are,” and they should not have to change based upon ‘whereever you are!’ :confused:

The very same characteristics that make “Euler math” so great for an outsider who is observing a world from afar, make it absolutely terrible for an object who is inside that same world.

The frame-of-reference in “quat math” is strictly relative … to you." (And both of the underlined words are equally important… as is the statement I just made.) There are no “absolutes.”

For example: face north, walk fifteen paces forward and lie down on your left side. Now go back to your starting point, face east, and do the same thing. - In Euler math, the calculations needed to describe what you just did are completely different the second time around, because you were facing (“absolutely”) East, not North. - But in Quat space, the movement was the same. You moved fifteen paces down the normal-vector and then turned ninety degrees counterclockwise.
Thus, for most 3D-graphics calculations, “what works best” is to express the movements and positions of an object entirely in “quat space,” then convert the final result to some sort of absolute-coordinate space only once, in the very last stage of the calculation.

LOL Fligh … No you don’t understand … see the way I set up my rigs the only bones (I guess I could use empties just as well) that I key are the targets for IK Solvers which I studiously set up to only be transformed (i.e. grab) so I don’t have Rot curves at all (which in the armature are quats) … In fact I never key anything but Loc when I set keys …

@ sundialsvc4 : Yes that is true but sometimes Euler “space” is your space … that is why it is so confusing in part … that “sometimes” was never explicitly defined by Euler in his equations … And you are right with quats mathematically the matrices used to define a “POV” is implicit in the equations …

Aah… yes I misunderstood you, been chewing so hard on this ever since Obi_Rons question and how to explain, without the math, something so obtuse. When it hit me (while mucking out stables, no less) I thought it was quite profound. Quiite dissapointed you, of all people, thought it was a joke, sniff.

%<

Sorry Fligh … I wasn’t laughing at your explanation at all . In fact I thought both what you put into Obi_Ron’s post and here are both excellent as usual and very helpful and I might add very clear and concise (something I should learn how to do) despite such a convoluted subject matter . It was just that I was surprised that you didn’t get the gist of my post … and you have stables???