How to set 4x4 transform

How do transformations work in Omniverse?

I create a Matrix4x4, I get the 4th column, I change the first value, and then I set that to the 4th column.

transform_op = self.skin_mesh.MakeMatrixXform()
fxf = Gf.Matrix4d()
c1 = fxf.GetColumn(4)
c1[0]+= 5
fxf.SetColumn(4, c1)
transform_op.Set(fxf)

Which sets… The First columns… second element…?

image

Hello @user56551! I reached out to the development team for some help. I will post when I have more information!

Hello,
The rows and columns are counted starting from 0, so the 4th column is index 3,

Can you try this? : ( not sure why you are not getting an error with your code)

transform_op = self.skin_mesh.MakeMatrixXform()
fxf = Gf.Matrix4d()
c1 = fxf.GetColumn(3)
c1[0]+= 5
fxf.SetColumn(3, c1)
transform_op.Set(fxf)

Interesting, it totally makes sense, but really would have expected an index error.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.