Transform GameObject using a Transformation Matrix (Matrix4x4) generated by two custom orthonormal axis.

194807-example.png

Hi, I’m making a game that required me to make mesh snap between objects, and I decided to make the snap code myself. But here is my problem… I had already estimated two orthonormal axis: one in my origin object and one in my target object. If I align these two axis I will align my two objects the way I desire them to be. With the two orthornormal axis, I estimated the transformation matrix that is able to transform the points of the object in the coordinate system of the origin object to the coordinate system of the target object.

The transformation matrix is a Matrix4X4. The problem is that I’m not being able to apply this transformation directly to the gameobject. I dont know how to do this exactly, since I cant just multiply the game object to this Matrix4x4, and I dont want to multiply the mesh points to this matrix, I want to move the entire gameobject of the origin object using this matrix.

If anyone can help, I will be very pleased.

Solved. The solution on this page worked for me: