7 ms·
If we relax the restriction that the columns of the 3x3 transformation matrix must be unit vectors, we also get the ability to apply scaling and shear transform
by jpeloquin 6y ago
If we relax the restriction that the columns of the 3x3 transformation matrix must be unit vectors, we also get the ability to apply scaling and shear transformations. In solid mechanics, this is called the F tensor, and is used to describe deformation of materials [1].
There is also an augmented 4x4 form if translation is needed as well:
| Q ... Δx | | vx |
| . Δy | | vy |
| . Δz | dot | vz | = new vector
| 0 0 0 1 | | 1 |
where "Q" is the 3 × 3 transformation matrix (e.g., rotation matrix) that is the subject of the OP, and [vx, vy, vz, 1] is the augmented form of a vector "v" = [vx, vy, vz] that is being transformed.
The augmented form is especially useful for transforming voxel indices in an 3D image array to spatial coordinates, such as for MRI or CT image data [2]. It is helpful if the index coordinate system has its origin at zero (zero-indexed arrays), like a normal coordinate system.
Finally, if we have many [x, y, z, 1] data points that each have an old and a new position, we can compute the overall best-fit transformation from the old to new positions with the least-squares solution to
A x = b
where "A" is the (unknown) augmented matrix representing the transformation, "x" is a 4 × n array storing the points' old augmented-form positions, and "b" is a 4 × n array storing the points' new augmented-form positions. If we allow the points to have arbitrary dimension, without any particular spatial interpretation, we get least squares curve fitting and the foundation of machine learning.
[1] http://homepages.engineering.auckland.ac.nz/~pkel015/SolidMechanicsBooks/Part_III/Chapter_2_Kinematics/Kinematics_of_CM_02_Deformation_Strain.pdf http://homepages.engineering.auckland.ac.nz/~pkel015/SolidMe...
[2] https://nifti.nimh.nih.gov/nifti-1/documentation/nifti1fields/nifti1fields_pages/qsform.html https://nifti.nimh.nih.gov/nifti-1/documentation/nifti1field...
- shezi 6y agoWhat you describe is very standard in 3D graphics, and it's alluded to in the article by the question at the end. You can even use the last row of the matrix as scaling factors (you'll have to re-normalize the output vector). From a mathematical standpoint, this is now a projective vector space. Some references: https://en.wikipedia.org/wiki/Transformation_matrix https://en.wikipedia.org/wiki/Transformation_matrix https://www.quora.com/Why-does-OpenGL-use-4D-matrices-for-everything https://www.quora.com/Why-does-OpenGL-use-4D-matrices-for-ev... https://guide.handmadehero.org/code/day362/ https://guide.handmadehero.org/code/day362/
- sannee 6y agoNote that projective spaces are not vector spaces. There is no meaningful way of adding vectors nor multiplying by a scalar. Meaning we have to be very careful about treating our projective transformations as linear maps, as they are, in fact, nothing like that. Of course people doing graphics often pick a section of the projective space ("last component is 1"), then map that onto R^3 and off they go, sort of ignoring the "planes at infinity" and praying for the best. This is messy but I do not see a better way.
- jpeloquin 6y agoYour wikipedia link reminds me that I should have listed rotation, scaling, shear, and reflection transformations. Oops. In your second link, I like the trick of storing positions as [x, y, z, 1] and directions as [vx, vy, vz, 0]. Regarding, "Hey, Markus! How come this matrix is 4x4?", I'm not sure if Markus was referring to an affine transformation, part of a perspective projection, a matrix representation of a quaternion, or something else. The mere fact a matrix is 4x4 (or some other size) unfortunately doesn't say much about what it's meant to do. Which probably contributes to Markus getting so many questions.