Search - User list
Full Version: xform from orient, P and scale (vex)
Root » Technical Discussion » xform from orient, P and scale (vex)
Cicuta
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!
alexwheezy
You might be looking for this:
https://www.sidefx.com/docs/houdini/vex/functions/instance.html [www.sidefx.com]
Cicuta
Exactly. Thank you so much!
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!
tamte
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
Cicuta
Yes something like that I was looking for! Thanks.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB