Getting world space orientation

   2147   6   0
User Avatar
Member
10 posts
Joined: June 2016
Offline
Hello guys,
Cannot seem to solve this myself.

I have a local transformation matrix on a point (joint).
Is there a vex way to extract the orientation in world space of this?
User Avatar
Member
10 posts
Joined: June 2016
Offline
Visually moving this point in the direction of the dotted red axis (opposite local Y)

Attachments:
7c30f2a9-e570-4b06-8889-13f9e243233b.jpeg (190.6 KB)

User Avatar
Member
5100 posts
Joined: Feb. 2012
Offline
Hi,

Your local transform matrix looks like identity matrix with an offset. But if it has the orientation you need, you can write something like this using a Point Wrangle:

matrix M = primintrinsic ( 1, "packedfulltransform", 0 );
@P *= invert ( M );
@P.y += ch("move");
@P *= M;

Here I am using packed and unpacked geo.

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
9382 posts
Joined: July 2007
Offline
assuming your point is part of a kinefx skeletal hierarchy you can use
Compute Transform SOP
to compute between localtransform and transform attributes

to update world (transform) attribute use explicit Compute World From Local, use Auto only if transform attrib is missing as when transform is present Auto would try to recompute localtransform
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
10 posts
Joined: June 2016
Offline
animatrix_
Hi,

Your local transform matrix looks like identity matrix with an offset. But if it has the orientation you need, you can write something like this using a Point Wrangle:

matrix M = primintrinsic ( 1, "packedfulltransform", 0 );
@P *= invert ( M );
@P.y += ch("move");
@P *= M;

Here I am using packed and unpacked geo.


Thanks a lot for this
I did something similar, this is definitely cleaner but in my case is not really taking into count the local Y but would Y when I add the move to current @P....am I doing something wrong?
User Avatar
Member
5100 posts
Joined: Feb. 2012
Offline
Patoz
animatrix_
Hi,

Your local transform matrix looks like identity matrix with an offset. But if it has the orientation you need, you can write something like this using a Point Wrangle:

matrix M = primintrinsic ( 1, "packedfulltransform", 0 );
@P *= invert ( M );
@P.y += ch("move");
@P *= M;

Here I am using packed and unpacked geo.


Thanks a lot for this
I did something similar, this is definitely cleaner but in my case is not really taking into count the local Y but would Y when I add the move to current @P....am I doing something wrong?

In your screenshot your matrix looks like identity matrix with an offset so that would be why the local axes align with the world axes. Maybe you can post your scene file?
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
10 posts
Joined: June 2016
Offline
animatrix_
Patoz
animatrix_
Hi,

Your local transform matrix looks like identity matrix with an offset. But if it has the orientation you need, you can write something like this using a Point Wrangle:

matrix M = primintrinsic ( 1, "packedfulltransform", 0 );
@P *= invert ( M );
@P.y += ch("move");
@P *= M;

Here I am using packed and unpacked geo.


Thanks a lot for this
I did something similar, this is definitely cleaner but in my case is not really taking into count the local Y but would Y when I add the move to current @P....am I doing something wrong?

In your screenshot your matrix looks like identity matrix with an offset so that would be why the local axes align with the world axes. Maybe you can post your scene file?

My apologies turned out each of my joints stored the correct packedtransform and doing the offset of all together resulted in alignment with the world and local transform...picking them one by one did the trick

Thanks a lot for your help
  • Quick Links