kiryha Posted February 15, 2018 Share Posted February 15, 2018 I am in the same boat with you, just start learning VEX and Houdini, I even did not complete the entagma parallel transport!. If I learn something new out of this thread I will post it here (like I did with the circle) Quote Link to comment Share on other sites More sharing options...
girtab Posted February 15, 2018 Author Share Posted February 15, 2018 cool ! tomorrow I will post the normal rotation with matrix and the version with sin Quote Link to comment Share on other sites More sharing options...
girtab Posted February 16, 2018 Author Share Posted February 16, 2018 If you remember the last picture I posted after the poly frame create a wrangle : v@up = cross(v@tangentv, v@tangentu); v@at = v@tangentv; after that a new wrangle: float pt01 = float(i@ptnum)/float(i@numpt); pt01 = chramp("shape", pt01); matrix m = ident(); float angle = radians(ch("angle")*pt01*100); vector axis = v@tangentu; vector Newm; rotate(m, angle, axis); v@at *= m; and your @at is twist Quote Link to comment Share on other sites More sharing options...
kiryha Posted February 16, 2018 Share Posted February 16, 2018 (edited) Is it a correct way to do a three-axis rotation with the matrix? // DEFINE VARIABLES // Rotation matrix matrix3 matrx = ident(); // Angle control with UI float angle_X = radians( chf('angle_X') ); float angle_Y = radians( chf('angle_Y') ); float angle_Z = radians( chf('angle_Z') ); // Define rotation axis vector axis_X = {1, 0, 0}; vector axis_Y = {0, 1, 0}; vector axis_Z = {0, 0, 1}; // BUILD FUNCTIONALITY // Rotate matrix by axis rotate ( matrx, angle_X, axis_X); rotate ( matrx, angle_Y, axis_Y); rotate ( matrx, angle_Z, axis_Z); // Apply rotation: multiply position by matrix @P *= matrx; Edited February 16, 2018 by kiryha Quote Link to comment Share on other sites More sharing options...
girtab Posted February 16, 2018 Author Share Posted February 16, 2018 I'm not very good on matrix but you can use matrix with so many way. using quaterion matrix3 ect.. there is an ther way to achieve this exercice without matrix. replace the second wrangle by that: float pt01, twistx, twisty; vector x, y, z; x = v@tangentv; y = v@up; z = v@tangentu; pt01 = float(i@ptnum)/float(i@numpt); twistx = sin(pt01 * ch("amount")) * ch("strength"); twisty = cos(pt01 * ch("amount")) * ch("strength"); x *= twistx; y *= twisty; v@at = x + y; v@N = v@tangentu; v@up = v@at; Quote Link to comment Share on other sites More sharing options...
kiryha Posted February 16, 2018 Share Posted February 16, 2018 I did not find a more elegant way of three-axis rotations with matrix but with quaternions it is: float angle_X = radians(chf('angle_X')); float angle_Y = radians(chf('angle_Y')); float angle_Z = radians(chf('angle_Z')); vector rotations = set(angle_X,angle_Y,angle_Z); @P = qrotate(quaternion(rotations), @P); 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.