Question about DirectX-Translation-Matrix

Started by
1 comment, last by COleException 17 years, 7 months ago
Hello, I am a little bit confused about the book "Mathematics for Game Developers" from Chrstopher Tremblay, esp. the part about the translation-matrix (page 130). Mr. Tremblay builds the translation-matrix as follows: 1 0 0 x 0 1 0 y 0 0 1 z 0 0 0 1 The DirectX-SDK says this, which at least I think is correct: 1 0 0 0 0 1 0 0 0 0 1 0 x y z 1 The other matrices (RotationX, Y and Z and scaling) are all the same: in the book and in the SDK. The book uses row-major-matrices, only to prevent questions in this direction. Can you tell me, if this is an error in the book or something I didn't understand completely? Thanks in advance!
Advertisement
Quote:Original post by COleException
The other matrices (RotationX, Y and Z and scaling) are all the same: in the book and in the SDK.
If you look more closely, you should see that the rotation matrices are in fact not the same, but rather are transposes of each other. A scale matrix is symmetrical, so will be the same between the two references.
Quote:The book uses row-major-matrices, only to prevent questions in this direction.
The issue at hand (at least based on what you posted) is not row- vs. column-major matrix layout, but rather row vs. column vector notation. To be clear, you cannot tell by looking at a written example like the ones you posted whether a matrix is row major or column major. That is an implementation detail. It has to do with how the matrix is represented in memory only; it has nothing to do with linear algebra per se.

The two issues are related in some incidental ways however, which unfortunately is the cause of much confusion.

So to reiterate, the issue here is one of notation. In column vector notation, the vector is represented as a column matrix and multiplied on the right of the matrix, like this:
v' = M*v
OpenGL references, as well as many others, use this convention. This corresponds to the first example you posted, where the basis vectors of the transform are in the columns of the matrix.

With row vector notation, vectors are written as row matrices and are multiplied on the left like this:
v' = v*M
DirectX, and references such as '3D Math Primer', among others, use this convention.

Does that help at all?
Quote:Does that help at all?


Hi,

yes, I had to think about it, but your answer helped me. I think, it's a bit confusing in the book referring to DirectX-Matrix-Notation expressly, but then on the other hand using M*v-Notation in multiplication, that's not very consequential in my eyes.

But now it's a bit more clear for me, thank you very much!


This topic is closed to new replies.

Advertisement