Jump to content

Translation matrix help


midicon

Recommended Posts

I'm trying to create a translation and rotation matrix to move an object back to the origin. I have very little experience building these.

I have a fetched my vectors from my object and they seem right. and then added them to a float to matrix then added a matrix3 to 4, gave it the translation data then exported the matrix attrib. when I multiplied the matrix data to the original point info it works although there is a slight rotation to the object, I can't figure out where its coming from. Sorry for the long winded explanation. I have attached the file to this post. any help is much appreciated.    

matrix_test.hip

Link to comment
Share on other sites

There is no middle loop in this sphere, so, your aim vector is slightly off. Parameter references are all messed, and aim vector was not used at all.

Try visualizing vectors. For rotation matrix, you should get 3 perpendicular vectors, they must look at their local directions. Matrix's Z should look at eye's local Z and so on. Orders of inputs are important everywhere: subtractions, cross products, matrix axes. You shouldn't check orientation on spheres. Default geometry cube with axes labels is handy.

move_to_origin.hipnc

Why it's 17 kilometer size, by the way? Appears like normal_size * 2.54 * 100 * 1000 for me.

Edited by f1480187
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...