KatsBits Community

blender quaternion rotations or eulers?

0 Members and 1 Guest are viewing this topic.

Offline ratty redemption

  • VIP
  • Hero Member
  • *
    • Posts: 1031
    • ratty's deviantart pages
i've finished my rig for now and am starting to set up various poses in the action editor. i've just noticed i can either rotate bones using quaternions or eulers. the results look the same to me, so is there any advantage to either of them? would it affect exporting to a game engine in the future? currently i'm only working on non real time rendering the when the animations are ready.


Offline nemyax

  • Newbie
    • Posts: 38
Eulers
Pros:
- Easy to understand
- Manually editing individual components is intuitive
Cons:
- May not produce the smoothest rotation possible
- Prone to gimbal lock (look it up) — a condition where two axes begin to point the same way, and a degree of freedom is lost

Quaternions
Pros
- Always produce perfectly smooth rotations
- Never have gimbal lock problems
Cons
- Not really editable manually in any meaningful way
- You can't reliably read timing and spacing off them

> would it affect exporting to a game engine in the future?
It doesn't matter. They are mutually convertible, and whichever your engine needs will end up in the exported file.

> is there any advantage to either of them?
This depends on how heavily you rely on the animation curve editor. If you like fiddling with curves, you're better off with Eulers and a carefully chosen and tested rotation order. Otherwise, you can safely use quats. In addition, you can use a mixed setup.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2690
    • KatsBits
Are you talking about the below Ratty ("body" bone expanded in the Action Editor to show the various animation data 'channels' available)?


If you are, then in the broader sense, whether you use that way of manipulating a Rig is going to depend really on preference rather than necessity - how do you 'prefer' to manipulate/create an animation? I don't think I've ever used those channels to actually manipulate a character for example (I've used them to check the resulting data but never used them to animate), everything I've ever done is based on manipulating the bones rather than the data that generates. From what I've seen in the community at large, doing it that way seems to be an exception rather than the rule though :-\


Offline ratty redemption

  • VIP
  • Hero Member
  • *
    • Posts: 1031
    • ratty's deviantart pages
thanks a lot guys, the difference between quats and eulers makes sense to me now.

so far with my blender animations, i've been using the graph editor a lot for animating objects like cameras, mesh shape keys or material properties, as their relatively simple key frames can be easily read in the graph editor. the quats i didn't understand at all, but i've just looked up on wikipedia and they also mentioned 4 rotational axis (which apparently quats use) prevent gimbal lock and as nemyax listed, produce smoother rotations.

i'm new to rigging and animating armatures, so i think i'll use quats when keyframing bones in the dopesheet and action editor, and eulers if i intend to tweak the curves in the graph editor.


Offline ratty redemption

  • VIP
  • Hero Member
  • *
    • Posts: 1031
    • ratty's deviantart pages
i'm curious, is there a way in blender for us to manually convert quats into eulers? i've looked but not found anything yet. i understood nemyax said they are converted by the exporters or game engines, but can we convert them before exporting?


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2690
    • KatsBits
I'm not sure you need to 'convert' them like that Ratty. If you look in the screenshot above, the main Transform/View Properties drop-down lists the different types of "Transform" that can be used, depending on which one you select it switches/updates the current sequence data to use that selected positional subset. These can also be set from "Object" Properties under "Rotation Mode:".


Offline ratty redemption

  • VIP
  • Hero Member
  • *
    • Posts: 1031
    • ratty's deviantart pages
thanks and sorry for the late reply kat.

understood, i think, but it would be convenient if in the graph editor, we could convert the f curves. as the quats are a lot harder to tweak, after the key frames have first been recorded. it's as if we have to commit to eulers or quats before we start using them, if we're intending to use the graph editor. i hope that makes sense?


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2690
    • KatsBits
You do have to 'commit', kind-of, because of the way EULA and Quats work, especially with rotational values. So yes, it's best to choose one 'type' and stick to that throughout tp avoid issues.