very beginer

Started by
12 comments, last by AaronMK 12 years, 9 months ago

Being 'row basis' or 'column basis' is the better math term.

Assuming you have a transformation matrix, the basis is the 3x3 portion that defines the new coordinate set.

This is a simplification, but basically the three 3x1 vectors define the x axis direction, y axis direction, and z axis direction, respectively. In the identity matrix, looking at the basis of the matrix, X is defined as [1,0,0], Y is [0,1,0], and Z is [0,0,1].

In an ideal world those vectors should always be completely orthogonal to each other as part of the affine transformation matrix. When they are not orthogonal you don't get a perfect transformation in 3D, and points will start to drift or explode or otherwise degrade.

Having a row basis or column basis defines the direction your three basis vectors are oriented in the data.

I assume that was directed at fisyher or the OP and not at me, but as I mentioned earlier, I generally refer to a transform matrix that's been constructed for use with row vectors and therefore has the basis vectors in the rows as a 'row-basis' matrix (and similarly for column-basis matrices), just as you said.
Advertisement
@jyk: You have mentioned:

- With row vectors, matrix-vector multiplication takes the form v*M, and with column vectors it takes the form M*v

- With row vectors, the matrix product A*B applies the represented transforms in the order A->B, while with column vectors the transforms are applied in the order B->A[/quote]

I was actually referring to the latter form M*v and A*B is a transform applied in the order B, then A because I'm most familiar with that. Then the term I should be using is "column-basis" and not "row-basis" matrix, right?

I have forgotten most of these linear math terms which I have learnt in high school and college, so I'm a little confused over what you have said. I mostly just stick with the M*v type of transformations when doing computer graphics.

I was actually referring to the latter form M*v and A*B is a transform applied in the order B, then A because I'm most familiar with that. Then the term I should be using is "column-basis" and not "row-basis" matrix, right?

Yes, that sounds right :) What you described would correspond to the use of column vectors and column-basis matrices rather than row vectors and row-basis matrices.
After a google search, the information in this thread seems to be what I am looking for, but I have some questions:

Terminology
- So "row-major" and "colunm-major" refer to how a 4x4 (in this case) matrix is laid out in memory, and
- "row-vector" and "column-vector" refer to whether <x,y,z,w> is a 1x4 or 4x1 matrix, respectively?
- Pre-multiply is v' = v*M (implying "row-vector"), and post-multiply v' = M*v (implying "column-vector")

The thing that confuses me is that it does not seem that being row or column major should change the actual "pencil/paper" math. Let's say that A and B are 4x4 matrices. Regardless on whether they are arranged in memory in row or column major order, A * B = C should always result in the same C. However, many posts seem to associate an order of transformations with a "row-major" or "column-major" layout. For transformation multiplication order, I'd think that whether you are pre or post multiplying would be the determining factor.

If I am just trying to create a single transformation matrix, it will be a different matrix depending on whether I am pre or post multiplying, one will be the transpose of the other, correct?

Now, how does this all translate to pre OpenGL 3.2 transform stacks? Take the following pseudo code for example.

loadIdentity()
pushMatrix( lookAt(eye, center, up) );
pushMatrix( translate(x, y, z) );
pushMatrix( rotate(axis, theta) );


Thank you for any assistance.

This topic is closed to new replies.

Advertisement