Greetings,
I need to interpolate transformations between two matrices, unless there is a fucntion that do just that, I need to extract all transformations separately and interpolate the transformations one by one and rebuild a new matrix from the result. To help me in this process, UT_DMatrix4::getTranslates and UT_DMatrix4::extractRotation are very handy but my question is:
How do we get the scaling from a UT_DMatrix4?
Extracting Scaling from a Matrix4
Started by Neo, Jun 05 2012 10:23 AM
4 replies to this topic
#1
Posted 05 June 2012 - 10:23 AM
#2
Posted 05 June 2012 - 08:19 PM
I'm not sure if there is a method off of the top of my head.
You could extract the scale by taking vec3.x = matrix4[0][0], vec3.y = matrix4[1][1], vec3.z = matrix4[2][2] since the scale is stored along the diagonal.
I suggest looking at spherical linear interpolation. I think that there would be a slerp and lerp function in the HDK for matrices.
Edit:
Also, this website is very good.
http://www.euclidean...forms/index.htm
You could extract the scale by taking vec3.x = matrix4[0][0], vec3.y = matrix4[1][1], vec3.z = matrix4[2][2] since the scale is stored along the diagonal.
I suggest looking at spherical linear interpolation. I think that there would be a slerp and lerp function in the HDK for matrices.
Edit:
Also, this website is very good.
http://www.euclidean...forms/index.htm
Edited by mightcouldb1, 05 June 2012 - 08:19 PM.
#3
Posted 06 June 2012 - 12:53 AM
You can use the explode method do get sperate translation,scale and rotation matrices.
#4
Posted 07 June 2012 - 08:20 PM
If you want to do it the "best" way, you should use UT_Matrix3::splitRotationScale() (assign to a UT_Matrix3 variable from your UT_Matrix4 variable to use the method). This gives you back rotation/scale matrices which can then be extracted for interpolation (UT_Quaternion for the rotation, component-wise interpolation for the scale). For an idea of what could go wrong for bad cases, look at the pictures from this 1992 paper http://research.cs.w...olar-decomp.pdf
don't panic!
#5
Posted 19 June 2012 - 09:33 AM
Thank you all for your suggestions, I managed to exorcised any Math reference whit my own library. Much simpler that way.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users










