I am working on a transformation matrix, and what I want done is to remove the rotation transformation and preserve the scaling, translation, etc.
How do I do this? I am seeking to create a manually-programmed solution.
You need to use an affine matrix decomposition, there are a few methods with different pros and cons. You'll have to look into it. Here are a few links to get you started though:
http://callumhay.blogspot.com/2010/10/decomposing-affine-transforms.html
http://www.itk.org/pipermail/insight-users/2006-August/019025.html
This could be simpler or more complicated depending on the nature of your transformation though, I'm assuming it's affine. But if it's linear / rigid then this is much easier, if it's a perspective transformation then I imagine it will be more complex.
If you know for sure that your matrix is rotation+translation+scaling then you can just extract the parameters you need:
rotation = atan2(m12, m11)
scale = sqrt(m11*m11 + m12*m12)
translation = (m31, m32)
I didn't notice that you are interested in 3d transformations, in that case the rotation part is the annoying one, but if you just want translation and scale...
translation = (m41, m42, m43)
scale = sqrt(m11*m11 + m12*m12 + m13*m13)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With