# interpreting matrix transform

Are there multiple ways to interpret the same matrix? For example,

``````
1 0 0 0
0 1 0 1
0 0 1 0
0 0 0 1

``````

if using the standard basis one way to understand the above matrix is that it’s moving points one unit up in the standard basis, in other words a translation.

Another way to interpret it is that the above matrix is the inverse matrix of the following matrix:

``````
1 0 0 0
0 1 0 -1
0 0 1 0
0 0 0 1

``````

so when you multiple points by the first matrix you are finding new coordinates in the second matrix’s basis.

are both of these interpretations right? neither?

A transformation matrix from coordinate system A to coordinate system B is a matrix that, if you multiply into it points in coordinate system A, it will return the equivalent points in coordinate system B. The values in this transformation matrix are the basis vectors and origin point of coordinate system A, expressed relative to coordinate system B.

This matrix will only produce reasonable results if you pass points that are in coordinate system A. If you pass points that are in coordinate system B, you’ll just get nonsense.

If you invert this matrix, you have a transformation matrix that goes from coordinate system B to coordinate system A. It’s values express coordinate system B’s basis vectors and origin relative to coordinate system A.

You cannot “interpret” a matrix this way. It’s not a matter of convention where you can do one or the other. Inverting a matrix creates a new matrix that has the exact opposite purpose. The B-to-A matrix, the inverse of the A-to-B matrix, does not take points in the space of A. It takes points in the space of B.

You cannot pass the same points to these two matrices and get reasonable results.

If I understand you correctly then the below matrix represents the basis vectors + origin of coordinate system A relative to coordinate system B (standard basis). And if I multiply points in coordinate system A by the matrix below I will get the equivalent points in coordinate system B?

``````
1 0 0 0
0 1 0 1
0 0 1 0
0 0 0 1

``````

But this is a little confusing because what exactly does it mean to multiply two transformation matrices together? Lets take the the shear and translation matrices from here: http://www.arcsynthesis.org/gltut/Positioning/Tut06%20Fun%20with%20Matrices.html

When you multiply ST you are saying that the values in T are relative to the coordinate system setup by S. Whereas if you multiply TS you are saying the values in S are relative to the coordinate system set by T.

If the result of the matrix multiplication is say R and we want to multiply some points by R. In what coordinate system do these points have to be in? In the “T coordinate system” (if we do T*S)?

When you construct a transformation matrix, you are trying to perform a transformation from some known space X to some known space Y. You do this by expressing the known space X relative to the known space Y.

The input positions (or normals) are already in a space. Your task when constructing a transformation matrix is to re-express this space relative to the space that you want to transform them into. The goal you wish to achieve is to take objects in space X and transform them into space Y.

The meaning of matrix/matrix multiplication is exactly what is stated on that page: “successive transformations”. You apply a matrix that transforms from the original space to some intermediate space. Then you apply a matrix that transforms from the intermediary space to the final space.

By multiplying these two in the proper order (final * initial), you create a single transformation matrix that goes directly from the initial space to the final space. What defines the “proper order” depends on what association you want to make between the initial and final spaces.

The diagram on that page shows the difference between the two sequences of transforms. Neither is correct and neither is wrong. They are only right or wrong depending on what association you want to make between the initial space and the final one. If you want the top one, then doing S*T is not the way to do it.