maketransform matrix vex
7553 12 3- _Christopher_
- Member
- 743 posts
- Joined: April 2014
- Offline
- tamte
- Member
- 8444 posts
- Joined: July 2007
- Offline
the explanation is in help:
so you can see that the integer arguments, trs, and xyz are transform order and rotation order
and translate, rotate, scale (and others) are vectors as you would expect
docs
matrix maketransform(int trs, int xyz, vector t, vector r, vector s, vector p, vector pr, vector shears)
builds a general 4×4 transform matrix given an order of transformations (trs), an order for rotations (xyz), a vector representing the translation (t), rotation (r), scale (s) (and optionally a pivot (p), pivot rotatation (pr), and shears (shears)). The specifications for the trs and xyz parameters can be found in $HFS/houdini/vex/include/math.h
so you can see that the integer arguments, trs, and xyz are transform order and rotation order
and translate, rotate, scale (and others) are vectors as you would expect
Edited by tamte - Dec. 6, 2017 21:22:03
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- _Christopher_
- Member
- 743 posts
- Joined: April 2014
- Offline
- jsmack
- Member
- 7658 posts
- Joined: Sept. 2011
- Online
- _Christopher_
- Member
- 743 posts
- Joined: April 2014
- Offline
- jsmack
- Member
- 7658 posts
- Joined: Sept. 2011
- Online
int means single integer, vector means 3 floats, const means the function does not change the value of the input. With maketransform(), instead of typing in a literal integer, typically one would include math.h and use the defined transform orders such as XFORM_SRT or XFORM_XYZ for readability.
example:
// Defines for the maketransform() VEX function. The function takes two // integer arguments which determine the order that the transform gets made. #define XFORM_SRT 0 // Scale, Rotate, Translate #define XFORM_STR 1 // Scale, Translate, Rotate #define XFORM_RST 2 // Rotate, Scale, Translate #define XFORM_RTS 3 // Rotate, Translate, Scale #define XFORM_TSR 4 // Translate, Scale, Rotate #define XFORM_TRS 5 // Translate, Rotate, Scale #define XFORM_XYZ 0 // Rotate order X, Y, Z #define XFORM_XZY 1 // Rotate order X, Z, Y #define XFORM_YXZ 2 // Rotate order Y, X, Z #define XFORM_YZX 3 // Rotate order Y, Z, X #define XFORM_ZXY 4 // Rotate order Z, X, Y #define XFORM_ZYX 5 // Rotate order Z, Y, X
#include <math.h> vector t,r,s; t = chv('translate'); r = chv('rotate'); s = chv('scale'); matrix m = maketransform( XFORM_SRT, XFORM_XYZ, t, r, s); @P *= m;
Edited by jsmack - Dec. 7, 2017 16:28:51
- _Christopher_
- Member
- 743 posts
- Joined: April 2014
- Offline
- jsmack
- Member
- 7658 posts
- Joined: Sept. 2011
- Online
- _Christopher_
- Member
- 743 posts
- Joined: April 2014
- Offline
- tamte
- Member
- 8444 posts
- Joined: July 2007
- Offline
- jsmack
- Member
- 7658 posts
- Joined: Sept. 2011
- Online
- _Christopher_
- Member
- 743 posts
- Joined: April 2014
- Offline
- jsmack
- Member
- 7658 posts
- Joined: Sept. 2011
- Online
If you wonder how many vops work, check out voplib.h
If you want to know how mantra works check out:
How the ggx specular used by the principled and classic shader works:
Subsurface scattering:
General shading stuff:
Other math libs:
Some geometry libraries:
For the new chop based constraints, it helps to know the underlying struct and it's member functions:
If you want to know how mantra works check out:
- in the Surface folder: pbrlighting.vfl, mislighting.vfl
- in include: pbr_direct_lighting.h
How the ggx specular used by the principled and classic shader works:
- in include: bsdf.h, ggx_utils.h
- in CVex: ggx_eval.vfl, ggx_sample.vfl
Subsurface scattering:
- pbr_sss_lighting.h, singlescatter.h, approxsss.h, expsampler.h
General shading stuff:
- shading.h, cie_cmf.h, dispersion.h
Other math libs:
- math.h, complex.h
Some geometry libraries:
- subdcurve.h, spherepack.h, advect.h
For the new chop based constraints, it helps to know the underlying struct and it's member functions:
- chop_constraints.h
Edited by jsmack - Dec. 8, 2017 21:55:29
-
- Quick Links