   Matrices (x, y, z....w?)
  I've been writing a bit of a toy in my spare time that uses GDI so that I can analyze and learn a little more about matrices, vectors, transformations, projections, etc.My current question is regarding the 4x4 matrices. W looks like it's only used in translation, and even then it's only the column and not the row.column: m14, m24, m34, m44row: m41, m42, m43, m44Translation is m14/m24/m34 (in the order of x/y/z), correct?What is m41, m42, m44? m43 can be used 1/d for perspective, or so I've read, but I'm still just not getting it when I want to apply a matrix to a 3D point.When you multiply a vector by a matrix, is the vector supposed to be x/y/z/w (w = 1) and then divide your x/y/z results individually by w? x = x/w y = y/w z = z/w Any help would be appriciated, thanks.   
  You're kind of mixing up a bunch of concepts, here, and tossing in a few implementation-defined constraints and bits of graphics programming theory that don't really have anything to do with the pure mathematical concept of matrices.This is a fairly clear explaination of the matrix product (the sum in the first equation). You can also "think of" the product as a series of successive dot products between the rows and columns.It's important to take note of the restriction noted in the first paragraph -- to multiply matrix A and matrix B, the inner dimensions of A and B must be equal. This is important; this is why we have the W component in vertices in computer graphics. A 3x3 matrix can only provide rotation and scale (and a few other basic transformations -- but the point is, is cannot provide translation) to points in 3D -- in order to do so, the matrix has to be extended to 4x4, but in order to do that , the vector must be extended to a 4-component vector as well, otherwise the inner dimensions will not match. Futhermore, the value of that final component has to be 1 in order for the translational aspect of the transformation to compute as you would expect.The actual meaning of the values of the columns and rows in a matrix isn't fixed. It varies based on how the matrix was built, and whether you are multiplying on the left or the right, et cetera. Relying on that kind of information in the general sense is incorrect and dangerous.Division by the resulting w component of a vector after the projection transformation is a concept specific to computer graphics, not matrix multiplication in general.You may want to pick up a good book. These books (sans Design Patterns) cover the appropriate subjects well.   ;  I started by following some basic thoughts of my own and doing things without matrices at all, but then realized just how helpful they can be vs doing all the math on every single point you'd want to move around.After that, I finally found this link: http://www.gamedev.net/reference/articles/download/course1.pdfI'm pretty sure I got the multiplication of the matrices in my code correctly put together, and I have some methods for translation, scaling, and rotation. I just wasn't sure what the proper usage of that 4th row was.If I take the 4x4 matrix I create after all the transformations and multiply that by a (x, y, z, w) vector (where w = 1) I didn't quite grasp the purpose of the returning w value. That's where my question regarding dividing x, y, and z by the returning value w came into play, because otherwise I wouldn't know what to do with it.  Thanks a lot for the links, I'll take a peek at them as well. I've found it a little difficult to find something that was more of a game related explanation rather than just the math associated with it.   ;  For most purposes in computer graphics, the last row of the transformation matrix is always [0 0 0 1], and the w element of vectors is 1. The only time this isn't the case is when doing stuff with projections, where it is common for the last row to be something else, to compute some other value to go into the w slot to be used for something else. The projection matrix is the last matrix the vector is multiplied by so there's no need to keep the last coordinate 1. During all the other transformations that 1 and the last row are needed to be able to perform translations.If the matrix math is implemented in hardware, or if there are SIMD instructions available, then explicitly storing that last row and the w coordinate might actually increase the processing speed. If you're just implementing the transformations with SISD instructions then you can do without the last row and the w coordinate; just use a 3x3 rotation matrix and a translation vector instead of the complete matrix.   ;  Maybe some clarification will help. The various elements of a matrix aren't assigned to particular functions, the math just happens to work out that way. In other words, there is no standard or convention that declares that the 4th column or row is used for translation, or that m43 has any particular function. The only conventions are the order of the elements, the method of multiplication, and the use of certain values to take advantage of properties of matrix multiplication.   ;  Ty very much Vorpy and JohnBolton, I'm really getting it down pretty well.I've got my transformations all working properly and visually everything looks about right.I would have a follow up question that isn't really that important to me just now, but it will be later..  Does anyone know of any good resources for culling/clipping?Since I'm doing all this through the software end manually at the moment, most of these processes are extraordinarily slow leaving me with a LOT of room for improvement. I've had quite a bit of fun in doing these things myself, but I need to start pushing some of these methods onto hardware instead.   