Hi, I'm a beginner of Houdini.
Can anyone teach me how to rotation a square or circle by using vex code?
Thank you very much!
How to do rotation in programming by using vex language?
19643 4 5- Lou Karol
- Member
- 1 posts
- Joined: May 2014
- Offline
- animatrix_
- Member
- 4526 posts
- Joined: Feb. 2012
- Offline
Hi,
You can use this to rotate an object by 20 degrees in Y:
matrix3 m = ident ( );
rotate ( m, radians ( 20 ), { 0, 1, 0 } );
@P *= m;
You can use this to rotate an object by 20 degrees in Y:
matrix3 m = ident ( );
rotate ( m, radians ( 20 ), { 0, 1, 0 } );
@P *= m;
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
- tamte
- Member
- 8592 posts
- Joined: July 2007
- Online
you can as well use quaternions to do the same thing
@P = qrotate( quaternion( {0,20,0}, 0 ), @P );
if you are already familiar with matrices and quaternions it may be helpful to browse the docs to get see all the functions that VEX has to offet for manipulating them (or to read more about above mentioned ones)
http://www.sidefx.com/docs/houdini13.0/vex/functions/ [sidefx.com]
@P = qrotate( quaternion( {0,20,0}, 0 ), @P );
if you are already familiar with matrices and quaternions it may be helpful to browse the docs to get see all the functions that VEX has to offet for manipulating them (or to read more about above mentioned ones)
http://www.sidefx.com/docs/houdini13.0/vex/functions/ [sidefx.com]
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- Sadjad Rabiee
- Member
- 1391 posts
- Joined: Dec. 2010
- Offline
Also we have maketransform function for doing all transformation (Translate , Rotate , Scale) on the points.
maketransform(0,0,{ TX, TY, TZ },{ RX, RY, RZ},{ SX, SY, SZ },{ CEX, CEY, CEZ });
Example : ( Rotate points 45 degree along Y axis )
v@Temp = @P * maketransform(0,0,{ 0, 0, 0 },{ 0, 45, 0 },{ 1, 1, 1 },{ 0, 0, 0 });
@P = @Temp;
maketransform(0,0,{ TX, TY, TZ },{ RX, RY, RZ},{ SX, SY, SZ },{ CEX, CEY, CEZ });
Example : ( Rotate points 45 degree along Y axis )
v@Temp = @P * maketransform(0,0,{ 0, 0, 0 },{ 0, 45, 0 },{ 1, 1, 1 },{ 0, 0, 0 });
@P = @Temp;
- gaurav.mathur
- Member
- 12 posts
- Joined: Oct. 2014
- Offline
-
- Quick Links