ikoon Posted January 31, 2018 Share Posted January 31, 2018 As in the picture below, I have partially succeeded ( R * S * R-1 ) . But I would really like to scale in arbitrary vector's direction, probably with "pivot rotation"? I did not succeed to make pr work: http://www.sidefx.com/docs/houdini/vex/functions/maketransform.html My solution so far, also attached in the hip file: matrix pft = primintrinsic(0,"packedfulltransform",@primnum); matrix3 transform = primintrinsic(0, "transform", @primnum); // reset rotation vector rotate = cracktransform(0, 0, 1 , {0,0,0}, pft); matrix rotatemat = maketransform(0, 0, {0,0,0}, rotate, {1,1,1}, @P); rotatemat = invert(rotatemat); transform *= matrix3(rotatemat); // scale vector scale = {0.1,0.1,2}; // non uniform scale matrix scalemat = maketransform(0, 0, {0,0,0}, {0,0,0}, scale, @P); transform *= matrix3(scalemat); // restore rotation rotatemat = invert(rotatemat); transform *= matrix3(rotatemat); setprimintrinsic(0, "transform", @primnum, transform); xyz - v03 - odforce.hiplc Quote Link to comment Share on other sites More sharing options...
f1480187 Posted February 1, 2018 Share Posted February 1, 2018 Like this? vector scale = chv("scale"); vector axis = chv("axis"); matrix3 oriented_space = dihedral({0,1,0}, normalize(axis)); matrix3 transform = primintrinsic(0, "transform", @primnum); transform *= invert(oriented_space); scale(transform, scale); transform *= oriented_space; setprimintrinsic(0, "transform", @primnum, transform); 1 1 Quote Link to comment Share on other sites More sharing options...
ikoon Posted February 1, 2018 Author Share Posted February 1, 2018 Thank you very much F1! This works great. I just thought, that the "pivot rotatation (pr)" argument of maketransform() can solve this without RSR-1. I thought, that pr rotates the pivot, so the scale is then oriented. But pr is maybe just a position of the rotation centre? It is not described in the documentation. Quote Link to comment Share on other sites More sharing options...
f1480187 Posted February 1, 2018 Share Posted February 1, 2018 Quote Objects and geometry nodes now have a separate Pivot Rotate parameter to rotate the geometry’s local axes. Previously, it was only possible to translate the local axes. Rotating the local frame of reference can make it easier to animate along non-axis-aligned directions. The interactive pivot handle now allows rotation as well as translation. (Press Ins or ' to switch to the pivot handle.) It was added everywhere with transform available. You can test it with Transform SOP. It does rotate transform space. It is simple layering concept (you can have pivot for pivot and so on), but not intuitive and the argument probably expects Euler angles. For me it is not worth to deal with (in VEX), since I can always layer another matrix. 1 Quote Link to comment Share on other sites More sharing options...
ikoon Posted February 1, 2018 Author Share Posted February 1, 2018 (edited) Ooh I see! Thank you very very much. I will stick to your vex solution and practice that. edit: BTW my initial solution contains unnecessary scalemat, your scale() function is much better, thank you. Edited February 1, 2018 by ikoon Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.