When I do custom locator shape nodes i usually start in python because the iteration loop is way faster than c++. However I have haved used a cmds.xform call and I’m having some math troubles getting an equivalent return when translating it to c++.
My python i need to translate is:
cmds.xform('node', m=matrix, ws=True)
rotation = cmds.xform('node', q=True, ro=True, ws=True)
So in the above, i get the matrix data in both python and c++ fine and the values match. I apply the matrix in python then extract just the rotation in x,y,z and use that later on in displaying my custom shape. I can’t really find anything in the API docs that’s obvious and I’m sure the information needed can be derived from the matrix data, but my feeble brain doesn’t contain that knowledge.
Is there a formula I can follow to get the rotation angles from a matrix?
Thanks