Sign in to follow this  

Question about DirectX-Translation-Matrix

This topic is 4111 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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!


Share this post


Link to post
Share on other sites

This topic is 4111 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this