midicon Posted January 24, 2017 Share Posted January 24, 2017 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 Quote Link to comment Share on other sites More sharing options...
f1480187 Posted January 25, 2017 Share Posted January 25, 2017 (edited) 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 January 25, 2017 by f1480187 Quote Link to comment Share on other sites More sharing options...
midicon Posted January 25, 2017 Author Share Posted January 25, 2017 Hey F1 Thanks for getting back to me! I thought the center ring was the issue. I had the aim in there at one point but looking at the file I sent you it dropped off some how. I really appreciate your help! Rob Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.