[Bf-committers] Euler angles clarification
Recep Aslantas
info at recp.me
Sun Mar 25 16:05:27 CEST 2018
Thanks Gaia for reply,
For testing angles;
In Blender I'm adding rotations to a cube with specific euler order e.g. XYZ, XZY... then,
I'm exporting it as COLLADA file to see matrix produced with this euler angles
Then I'm testing it with cglm library to produce same matrix with same euler angles like this:
mat4 rot;
glm_euler_xzy((vec3){Xangle, Yangle, Zangle}, rot);
glm_mat4_print(rot, stderr);
this produces same matrix as Blender.
The problem is that I was thought that I was implemented intrinsic (pitch, yaw and roll) rotations
but now I realized that they are extrinsic (elevation, heading and bank) rotations
which are reverse order of intrinsic (intrinsic XZY == extrinsic YZX)
So before fix that but I wanted to know what convention
does Blender use, extrinsic or intrinsic rotations?
Because after changed the orders, the result will not be same :/
Recently glm added new euler functions: https://github.com/g-truc/glm/pull/744
My guess is that glm::eulerAngleYZX will not produce same rotation matrix as Blender
FWIW, I'm using euler angles in AssetKit ( https://github.com/recp/assetkit ) which is COLLADA/glTF importer
to convert coordinate systems, for instance Z_UP to Y_UP ...
Thanks
- Recep
> On March 25, 2018 at 12:50 PM Gaia Clary <gaia.clary at machinimatrix.org mailto:gaia.clary at machinimatrix.org > wrote:
>
>
> How exactly do you test with collada files exported by blender?
> Can you explain this in some more detail?
>
> Sidenote: The Collada exporter uses the decomposition of the
> transformation matrix and extracts the euler rotation with
>
> mat4_decompose(loc, q, size, matrix);
> quat_to_eul(rot, q); /* XYZ order */
>
> i am not sure though if this helps.
> * gaia
>
>
>
> On 25.03.2018 13:34, Recep Aslantas wrote:
>
> > > Hi,
> >
> > Which rotation conventions does Blender use for Euler rotations (XYZ, YXZ...)?
> > Intrinsics rotations or extrinsic rotations?
> >
> > Since I'm testing the math with COLLADA files which exported by Blender.
> > I don't know what exactly XYZ means in Blender.
> >
> > Thanks for clarification
> > * R
> >
> > _______________________________________________
> > Bf-committers mailing list
> > Bf-committers at blender.org mailto:Bf-committers at blender.org
> > https://lists.blender.org/mailman/listinfo/bf-committers
> >
> > > _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org mailto:Bf-committers at blender.org
> https://lists.blender.org/mailman/listinfo/bf-committers
>
More information about the Bf-committers
mailing list