Hi guys, I'm Plaue. I've been trying to wrap my head around Matrix and transformation stuffs lately, but there's still something intriguing to me that I can't figure out, especially pivot and vector cracktransform(int trs, int xyz, int c, vector pivot, matrix xform) function! For example:
1. Where is the "pivot" information stored in a 4*4 matrix ?
2. Apparently typing different "pivot" in the cracktransform function yields different results. Then is there a "correct" pivot to use in the cracktransfrom() function to get a meaningful result?
3. I know that the @pivot intrinsic attribute will be created when a packed prim is created, and this attribute might be the "correct" pivot information to use in the cracktransform function. However, for regular non-packed geometry, is {0,0,0} always the "correct" pivot information to use even if the geometry is not centered at origin?
I don't know if I've made myself clear, pls let me know if you don't get me Many thanks!
The "pivot" in cracktransform() and matrix?
1711 1 0- Plaue_Charles
- Member
- 5 posts
- Joined: March 2021
- Offline
- UtilitasArts
- Member
- 16 posts
- Joined: April 2021
- Offline
Hey there,
Allright, here we go.
the pivot inside the functions cracktransform and maketransform are actually more or less a function themselves.
For example in the function maketransform:
The pivot is applied like this:
Inside of a point attribute wrangle paste this code:
vector T = chv("T");
vector R = chv("R");
vector S = chv("S");
vector pivot = chv("P");
matrix m = maketransform(0,0,T,R,S);
matrix m2 = ident();
translate(m2,-pivot);
m2 *= m;
translate(m2,+pivot);
v@P *= m2;
if you create wrangle and apply this wrangle to a cube, you will start to understand it.
As you can see I did not use the "pivot" inside the maketransform function, I just recreated what it does behind the scenes.
The pivot is something that "alters" the actually stored transform.
In the function cracktransform it does the opposite of this. therefore it changes the rotationpoint of the matrix before extracting the data out of it.
Allright, here we go.
the pivot inside the functions cracktransform and maketransform are actually more or less a function themselves.
For example in the function maketransform:
The pivot is applied like this:
Inside of a point attribute wrangle paste this code:
vector T = chv("T");
vector R = chv("R");
vector S = chv("S");
vector pivot = chv("P");
matrix m = maketransform(0,0,T,R,S);
matrix m2 = ident();
translate(m2,-pivot);
m2 *= m;
translate(m2,+pivot);
v@P *= m2;
if you create wrangle and apply this wrangle to a cube, you will start to understand it.
As you can see I did not use the "pivot" inside the maketransform function, I just recreated what it does behind the scenes.
The pivot is something that "alters" the actually stored transform.
In the function cracktransform it does the opposite of this. therefore it changes the rotationpoint of the matrix before extracting the data out of it.
-
- Quick Links