How is a transformation matrix broken down? For example, if you had the following matrix:
[x1 x2 x3 0]
[y1 y2 y3 0]
[z1 z2 z3 0]
[0 0 0 0]
How to these relation to position/rotation/scaling/orientation? I guess my real question is this: how do you denote an objects’s location in 3D space using a matrix?
Thanks guys. I’ve already checked out those Wiki articles - they helped a little but not enough. I’ll check out the other link today If anyone else knows of any good resources let me know!
The top 3x3 is a rotation and scaling matrix.
The three columns or rows (depending on notation) will be the x, y and z vectors of the triplet you’re used to see as a manipulator.
Their orientation will be the rotation, the magnitude of each the scaling on that axis.
The bottom 3 entries (assuming row) will be a single vector representing the displacement from the parent/frameset, it’s what’s considered the translation.
The last component of each of those trivector is for homogenization, it’s seldom used for just plain transforms (such as hierarchies of objects), and that’s why it’s not uncommon to reduce matrices to 3x4, as you can 99% of the time (in the applications pertinent to transforms in CGI) to just have 0s for the axis vectors, and 1 for the translation vector.
You’ll find it off that path when you deal with projections, and things such as distance (say from camera) might require homogenization of the transform.
In those regards, your matrix would be atypical, as a 0 in the bottom right corner would indicate a non homogenous transform.
All of the above can be found explain in just as simple and even more extensive terms, with pretty pictures included, all over the interwebs.
Look at right and left handed transforms, handedness etc. to see some visual and intuitive representations of how to use your hands to deal with transform related problems
I guess I’m just confused. Am I right in saying an object in a 3D scene is always associated with a 4x4 matrix? Or does it just have the x, y, and z values and these 4x4 matrices are applied to the vector?
No, not really.
How you posted it in your OP is what they really are. 4 vectors basically, the three axis X, Y, and Z, and one translation vector.
Look at the translation manipulator in your software of choice. See those three arrows? Those three arrows are a vector for each axis. That is exactly what a 3x3 matrix looks like, it’s exactly what it describes.
The scaling will be built into the length of those three vectors, it can’t be simply isolated to a float like you seem to indicate.
The translation isn’t part of the 3x3 matrix, the scaling comes from the length of the vectors (which is going to be a single entry in the matrix only in the case of an ID matrix) and rotations between vectors aren’t calculated by picking up just one of their three elements. So, yeah, pretty off I’m afraid
I guess I’m just confused. Am I right in saying an object in a 3D scene is always associated with a 4x4 matrix? Or does it just have the x, y, and z values and these 4x4 matrices are applied to the vector?
An object in a 3D DCC app will usually have a transform of some kind associated with it.
A transform node in maya, a kine property in xsi and so on.
A transform will usually be a more complex object than just a matrix, as there is much that a 4x4 matrix can’t describe univocally (such as euler rotations, rest states if they need to be used and so on).
A 4x3 matrix can give you where an object sits (last row or column, the displacement/translation compared to its parent), and how it will be oriented and then scaled on each of the three axis.
4x4 will include data that will allow you to deal with non-homogeneous transforms (projections etc.), or will just contain “defaults” for the last column or row for when all transforms are homogeneous (0,0,0,1).
You need to visualise the problem more. Look for pictures and handedness, you are making it harder on yourself than it needs to be if you find it confusing.
S - scale
R - rotation
T - translation
x = [XX XY XZ 0]
y = [YX YY YZ 0]
z = [ZX ZY ZZ 0]
w = [TX TY TZ 1]
the 3x3 Rotation matrix (x,y,z) makes up the rotation. It's common to convert this to quat if you need to discover the rotation values. Attempting to convert those to euler angle triplets is a bug.
The scaling can be found by taking the magnitude of those vectors.
SX = magnitude(x)
SY = magnitude(y)
SZ = magnitude(z)
I guess I’m just confused. Am I right in saying an object in a 3D scene is always associated with a 4x4 matrix?
Yes, that is correct.
Or does it just have the x, y, and z values and these 4x4 matrices are applied to the vector?
It has both. ish. Typically you store translate/rotate/scale values, and convert to a matrix internally. Depending on the system, the rotations may either be stored as quats, axis angles, or euler angle triplets.
Thanks for the info! This helps a lot and I’m finally understanding it. I took a look at Maya’s composite matrix and separate translation/rotation/scale matrices, and it’s all starting to make sense.
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.