Jump to content

[Solved] How does the pivot work in the Make Transform node


Recommended Posts

How does the pivot work when using the make transform Vop node?

I am trying break down and figure out the function of the Make Transform node using python (Outside of any 3d software).

The Translate is pretty basic as I can just place them into a matrix as they are x = m[3][0], y = m[3][1] and z = m[3][2].

For rotation I am using the following:

def EulerToMatrix(Rotation):
	x, y, z = Rotation
	XM = M3([[	1, 	0, 	0],
			[0, math.cos(x), -math.sin(x)],
			[0, math.sin(x), math.cos(x)]])
	YM = M3([[math.cos(y), 0, math.sin(y)],
			[0,	1,	0],
			[-math.sin(y), 0, math.cos(y)]])		
	ZM = M3([[math.cos(z), -math.sin(z), 0],
			[math.sin(z), math.cos(z), 0],
			[0,	0,	1]])
	return (ZM * YM * XM)

I can then just pipe this information into the Matrix4.

The problem I have now is that I cannot find any information that I can understand on how to apply the pivot to the matrix4. It's not as simple as just adding.

I have attached a file that has the make transform that I am using to test against. The pivot seems to be linked to the rotation and so I am guessing it is related to the scale as well. Is there any way to break down how this pivot transforming works?

MakeTransPiv.hip

Edited by FruehBird
Link to comment
Share on other sites

I got closer with setting the pivot as the transform of a second matrix and multiplying the two but something is still off. 

With the pivot the position becomes (0.42052, 11.0109, 7.3853)

With the multiplying it becomes  (0.54003, 11.050306, 7.68421)

ApplyTransPiv.hip

Edited by FruehBird
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...