very beginer

Started by
12 comments, last by AaronMK 12 years, 9 months ago
I not understand the word/view/projection matrix.
I understand that is a change of geometric reference, the first problem is
1)if you multiply a point for two or three different transformation matrixes what I obtain?
what is the reference?
2)I must multiply the normals for the rotation of the world matrix? (only for the rotation , not for the translation because the normals must be normalized)
3)I see that the diffuse component is not relative to the camera position , instead the specular component is relative to the camera , what are other components that are relative to camera ?

thanks
Advertisement
Since no one has replied to you for the past hour, I will try to help alittle and try my best to answer as simple as possible.

1)if you multiply a point for two or three different transformation matrixes what I obtain?
what is the reference?[/quote]

The new reference would be the concatenated matrix of all the transformation matrices applied. For example, if there are 3 modelview transformation matrices M1,M2,M3 applied to a single point (0,0,0) in that order, then the new reference for that point would be:

M_f = M3*M2*M1, assuming row-major, pre-multiplication type of transformation matrices.

2)I must multiply the normals for the rotation of the world matrix? (only for the rotation , not for the translation because the normals must be normalized)[/quote]

Read this: http://www.gamedev.n...transformation/
Basically, you would need to compute the inverse transpose of the final 4x4 Modelview matrix with the translation component zeroed to find the transformed normal

3)I see that the diffuse component is not relative to the camera position , instead the specular component is relative to the camera , what are other components that are relative to camera ?[/quote]

If you are talking lighting components of the Phong lighting model, then I would say only the specular component is relative to the camera view.

If you are still very new to Computer Graphics, I sugge[font="Arial"]st reading[/font][font="Arial"] Computer Graphics with OpenGL (3rd Edition) by Hearn Baker, which what I bought some years ago for my basic CG course. It teaches the basics of computer graphics such as modelview and project transformation. However, it uses OpenGL 1.1 which is the old fixed-pipeline functionality and therefore have no information on Shaders but it is still a very good book.[/font]
[color="#1C2837"]concatenation is when things are put together, like concatenating strings x and y: xy. [color="#1C2837"]Or if x = abc and y = def xy = abcdef.[color="#1C2837"]

M_f = M3*M2*M1, assuming row-major, pre-multiplication type of transformation matrices.

As I often point out, matrix 'majorness' is actually not related to multiplication order (at least not directly); rather, it has to do with the layout of the matrix in memory. (The term is often misused though.)
for that that i understand ,multiply a point for a matrix is equals to translate/rotate his orientation of axises.
And the axises orientation becomes the same for all points multiplied by the matrix , concatenate matrix multiplication is equal to increment the rotation/translation of axis, matrix by matrix.
may be?

thanks.

[quote name='fisyher' timestamp='1302517377' post='4797037']
M_f = M3*M2*M1, assuming row-major, pre-multiplication type of transformation matrices.

As I often point out, matrix 'majorness' is actually not related to multiplication order (at least not directly); rather, it has to do with the layout of the matrix in memory. (The term is often misused though.)
[/quote]

@jyk: When I stated row-major, I was refering to the fact that each row in a rotation matrix represents the direction vector of the rotated axes in terms of original reference coordinates, which is the case for pre-multiplication type of transformation matrices as opposed to the post-multiplication type where each column represted the rotated axes vectors. I was not talking about the layout of matrix in memory, which I honestly do not have much understanding in that area. I think I may have used the wrong term to express my intended meaning. Is there a more technically correct term for that?

@giugio: I'm not too sure what you described is correct or not because it's not really clear, at least to me. I personally prefer not to process in my head, matrix multiplication on a vertex as "rotations/translations of its axes or change of reference". Rather I would just fixed a reference frame and describe it as "a transformation that move the original point to a new point".

Maybe you should post this question the math section since this "change of reference" concept is really a linear algebra question. You might get a much better and well-explained answer by experts there.

for that that i understand ,multiply a point for a matrix is equals to translate/rotate his orientation of axises.
And the axises orientation becomes the same for all points multiplied by the matrix , concatenate matrix multiplication is equal to increment the rotation/translation of axis, matrix by matrix.
may be?

thanks.



What do you mean by "equal to increment the rotation/translation of axis"?

If you perform Mc = M1*M2*M3, then multiply your points by Mc, it is the same as if you multiplied the points by M1, then M2, then M3.

As for it affecting the orientation of the points and their resulting geometry, that depends on the contents of each matrix. The affine transformations used in graphics manipulation are only a tiny subset of the things you can represent in linear algebra.

This math is generally covered in college/university studies, but many of the For Beginners posts are much younger than that. I strongly recommend that beginners such as the OP either get some good books on linear algebra and graphics and work through them as though they were a college student, or rely on existing engines to do the heavy lifting for them.

@jyk: When I stated row-major, I was refering to the fact that each row in a rotation matrix represents the direction vector of the rotated axes in terms of original reference coordinates, which is the case for pre-multiplication type of transformation matrices as opposed to the post-multiplication type where each column represted the rotated axes vectors. I was not talking about the layout of matrix in memory, which I honestly do not have much understanding in that area. I think I may have used the wrong term to express my intended meaning. Is there a more technically correct term for that?
[/quote]

I believe the correct term is 'row vectors' vs 'column vectors'.
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game

I think I may have used the wrong term to express my intended meaning. Is there a more technically correct term for that?

Yeah, the term you're looking for is 'row vector'. I also sometimes refer to such a matrix as a 'row-basis' matrix, although I'm not sure if that terminology is common or standard.

You probably already know all this, but just to summarize, in linear algebra, an N-dimensional vector can be expressed either as a 1xN row vector, or as an Nx1 column vector. The rules of matrix multiplication and the layout of the types of transforms we typically use dictate the following:

- 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

- When using row vectors, the basis vectors of a transform are generally stored in the rows of a transform matrix (e.g. translation vector in the bottom row), whereas with column vectors they're generally stored in the columns (e.g. translation vector in the right-most column)

Using the terms row- and column-major to refer to basis orientation, though incorrect, is very common, and many people are very surprised to learn that this isn't the correct terminology. (In fact, I've managed to elicit surprisingly hostile responses on these very forums by even daring to suggest that 'row major' is not the correct term for a matrix with the basis vectors stored in the rows :) This isn't helped by the fact that the usage is fairly common on discussion forums and in references and tutorials, and so is more or less constantly reinforced.

I learned the difference initially because I misused the term in a forum post (when I was first learning about 3-d math), and someone pointed out the error to me. So, in turn I generally try to point out the misuse of terminology when it occurs, in the hopes of encouraging correct usage of the terms in question (sometimes it seems like a losing battle though :).

[Edit: Like karwosts said.]

Yeah, the term you're looking for is 'row vector'. I also sometimes refer to such a matrix as a 'row-basis' matrix, although I'm not sure if that terminology is common or standard.



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.

This topic is closed to new replies.

Advertisement