2

I have a glm::mat4 matrix and I have performed several rotations and translations on that matrix. How can I get the rotational axis of that matrix in Normalized form?

It should be Unity3D equivalent of gameObject.transform.forward or gameObject.transform.right

genpfault
  • 51,148
  • 11
  • 85
  • 139
MrRobot9
  • 2,402
  • 4
  • 31
  • 68
  • 2
    Have You seen this: https://stackoverflow.com/questions/12463487/obtain-rotation-axis-from-rotation-matrix-and-translation-vector-in-opencv – Dori Nov 13 '19 at 08:20
  • 4
    There is no such thing as rotational axis in your matrix.... the rotation axis is defined by the transform applied on it not in the matrix applied to. But you can extract basis vectors and position easily (I think that is what you wanted) see [Understanding 4x4 homogenous transform matrices](https://stackoverflow.com/a/28084380/2521214) – Spektre Nov 13 '19 at 08:21

0 Answers0