Notifications
Clear all

[Closed] Get Transform Matrix

Say I have a transform which contains scale:

(matrix3 [1.45957,-0.41383,0.862164] [0.943314,0.881728,-1.17373] [-0.157291,1.44784,0.961228] [11.7975,-45.8531,66.706])



How can I get this same transform with normalized scale, which would result in the scale being the default values of [1,1,1]?

In short I just want the rotation and position without scale, so I can apply this transform to another object.

2 Replies

a = (matrix3 [1.45957,-0.41383,0.862164] [0.943314,0.881728,-1.17373] [-0.157291,1.44784,0.961228] [11.7975,-45.8531,66.706])
aInv = inverse (copy a)
b = (scale a aInv.scale)
someObject.transform = b

–some scaled object
$Teapot01.transform
(matrix3 [1.5031,0,0] [0,1.5031,0] [0,0,1.5031] [50,50,50])

tempScale = $Teapot01.transform.scalepart

scaleTM = inverse (scaleMatrix tempScale)
(matrix3 [0.665292,0,0] [0,0.665292,0] [0,0,0.665292] [0,0,0])

–assign Teapot01 transform (with scale stripped out)
$Teapot02.transform = scaleTM * $Teapot01.transform
(matrix3 [1,0,0] [0,1,0] [0,0,1] [50,50,50])