extract rotation matrix from transformation matrix in VEX

   14986   3   2
User Avatar
Member
277 posts
Joined: July 2006
Offline
Hi!

Is there any simply way to extract rotation matrix from object transfromation matrix in vex?
I've got matrix that describes the global transformation of geometry and I want to have the part of the matrix that is responsible for rotation. as far as I know the rotation and scaling operations “are using” the same fields of matrix so is there any simple way to extract the rotation matrix?

Thank yu very much
User Avatar
Member
175 posts
Joined: July 2005
Offline
Have you tried cracktransform function?

EDIT: VOP way.
Hope this is close, I only think this way of building xform from N is silly

Attachments:
extractRotationMatrix_01.hipnc (118.6 KB)

User Avatar
Member
277 posts
Joined: July 2006
Offline
Hi!
thank you for the reply !

Because of your file I've found my simple vex function - cracktransform

Btw. I think that getting rotations in the way as in your's file is sometimes not good.

a dot b = |a||b|cos(alpha), so even if a==b==1 then
arccos(a dot b) = arccos(cos(alpha)) = |alpha|
so on with arcsin (with some offset).

So this way you're loosing al ot of information which way the angle is bend and I think the result is not always good.
User Avatar
Member
175 posts
Joined: July 2005
Offline
Serwus Danilo!

I wrote this is silly because the same functionality is duplicated in align VOP if I'm not wrong.
Also I could get object xform matrix instead of building one from normal, but found this super simple way too late.

The acos(dot()) is a very standard mathematcal way of getting angle between two vectors.
It comes from basics of dot product.
Dot product of two normalized vectors is a bare cosine.
arccosine is the opposite of the cosine, it returns an angle in radians from cosine value.

Perhaps we are talking about two different things.
I computed three euler angles just to build xform, and push it through cracktransform.
  • Quick Links