xform from orient, P and scale (vex)

   487   5   0
User Avatar
Member
55 posts
Joined: 11月 2019
Offline
Hello everyone!

I was wandering through the documentation trying to find the set of functions to build an xform matrix for points if the inputs I have are an @orient quaternion, vector for translation and a vector for scale (other than a pile of setcomponent()) but I am not really finding it. Do you have any clue? I am sure there is a straight forward way I am missing.

Thanks!
User Avatar
Member
201 posts
Joined: 1月 2013
Offline
You might be looking for this:
https://www.sidefx.com/docs/houdini/vex/functions/instance.html [www.sidefx.com]
User Avatar
Member
55 posts
Joined: 11月 2019
Offline
Exactly. Thank you so much!
User Avatar
Member
55 posts
Joined: 11月 2019
Offline
Alternatively given a rotation matrix3 a vector3 scale and a vector3 P, what is the better way of combining all that into a single 4x4 matrix xform? (as the instance() func would)

Thanks!
User Avatar
Member
8555 posts
Joined: 7月 2007
Online
Cicuta
Alternatively given a rotation matrix3 a vector3 scale and a vector3 P, what is the better way of combining all that into a single 4x4 matrix xform? (as the instance() func would)
Thanks!
better than what?

you can still use instance function()
matrix xform = instance( P, {0,0,1}, scale, quaternion(rotation), {0,1,0});

or you can also do it this way for example:
matrix xform = matrix3( rotation );
scale( xform, scale );
translate( xform, P );

or this way:
vector euler = cracktransform( 0, 0, 1, {0,0,0}, matrix3(rotation) ); 
matrix xform = maketransform(0, 0, P, euler, scale);

and probably many others, but I haven't measured which one is the fastest
Edited by tamte - 2024年3月22日 11:27:00
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
55 posts
Joined: 11月 2019
Offline
Yes something like that I was looking for! Thanks.
  • Quick Links