Matrix transformation - lacking rotation.

   426   1   1
User Avatar
Member
1 posts
Joined: Oct. 2024
Offline
I am trying to learn how to use matrix in my workflow and am getting a little bit stuck.

I have a group of packed objects and want to replace them with other packed objects using the same position and rotation and scale.

So far I can get the objects to match in position but not in rotation. This is the code I am using, and attached is some screenshots.


matrix m = primintrinsic(0, "packedfulltransform", @ptnum);
matrix m2 = primintrinsic(1, "packedfulltransform", @ptnum);



v@P*=invert(m)*m2;

Attachments:
matrix.png (282.3 KB)
matrix_2.png (199.4 KB)
matrix3.png (264.3 KB)

User Avatar
Member
8043 posts
Joined: Sept. 2011
Offline
Instead of transforming @P, which will only apply translation, use packedtransform() which will adjust P and the intrinsic transform for rotation and scale.

https://www.sidefx.com/docs/houdini/vex/functions/packedtransform.html [www.sidefx.com]
  • Quick Links