1

I gathered some data from BVH animations, and they are represented in the ZXY order (Right-handed, Y axis world up vector).

And I need to transform this into:

  • XYZ Euler
  • ZYX Euler
  • Quaternion

How would I do this conversion? I tried googling about it but I cannot find any pseudo-code for it, only math explanations which are not that straight forward for me to understand.

c4b4d4
  • 964
  • 12
  • 32
  • 2
    Try code from Graphic Gems https://github.com/erich666/GraphicsGems/blob/master/gemsiv/euler_angle/EulerAngles.c – minorlogic Jan 28 '19 at 08:35

1 Answers1

1
  1. construct transform matrix m representing your input euler angle conventions

    so code that converts BVH input int 4x4 transform matrix. Its simple multiplication by rotation matrices in order ...

  2. convert m into desired euler angles convention

    for that you can use this:

    see the code in [edit1]. You can use it to get euler angles for any convention ... you just use different cfg.

    So simply you create cfg for each euler angle convention you got ... and then use it when you want to transform the m into it...

Spektre
  • 49,595
  • 11
  • 110
  • 380