cpusorcerer

07-14-2003, 01:18 PM

Hi all! I have a question about the modelview matrix. How are the vectors stored within it, and what do they represent? The OGL Blue and Red books told me a lot about how to transform and multiply the matrices, but I have not found this information.

I know the vectors are composed of x,y,z and w coordinates, so that explains the number of coordinates in the vectors. However, there must be four vectors then, right? So what vectors could they be? Positive x, positive y, positive z and ... what? Also, I saw a reference to a matrix equation for a plane, "Ax + By + Cz + D = 0" in the red book. Does anyone know what D is supposed to represent? The fourth coordinate, w, is also a mystery to me. If anyone would explain that to me, that'd be great!

Finally, when submitting a matrix to openGL in the format m[16] where m is the matrix of GLfloats, m[0] to m[3] is positive x, m[4] to m[7] is positive y, m[8] to m[11] is positive z and m[12] to m[15] is positive w, right? I've done some basic linear algebra, but I don't know how the ARB is representing the 3D positions in the modelview matrix. I'm also aware that this isn't a very advanced question, but I didn't think it was beginner level either, so I posted it here to err on the side of getting an answer. :~)

I'm just trying to climb out of newbie-ism and into the guts of OGL here to do some more powerful stuff. I've been programming in OGL for 2 years and I'm trying to throw together my first real playable-and-enjoyable 3D game. Any help is much appreciated!

-Matt

I know the vectors are composed of x,y,z and w coordinates, so that explains the number of coordinates in the vectors. However, there must be four vectors then, right? So what vectors could they be? Positive x, positive y, positive z and ... what? Also, I saw a reference to a matrix equation for a plane, "Ax + By + Cz + D = 0" in the red book. Does anyone know what D is supposed to represent? The fourth coordinate, w, is also a mystery to me. If anyone would explain that to me, that'd be great!

Finally, when submitting a matrix to openGL in the format m[16] where m is the matrix of GLfloats, m[0] to m[3] is positive x, m[4] to m[7] is positive y, m[8] to m[11] is positive z and m[12] to m[15] is positive w, right? I've done some basic linear algebra, but I don't know how the ARB is representing the 3D positions in the modelview matrix. I'm also aware that this isn't a very advanced question, but I didn't think it was beginner level either, so I posted it here to err on the side of getting an answer. :~)

I'm just trying to climb out of newbie-ism and into the guts of OGL here to do some more powerful stuff. I've been programming in OGL for 2 years and I'm trying to throw together my first real playable-and-enjoyable 3D game. Any help is much appreciated!

-Matt