   Theory of Homogenous Coordinates...
  I was reading along in chapter 9 in the book "3D Math Primer for Graphics and Game Development" and was reading the section on homogenous coordinates.They explain it in 2D in order to get the point across in 3D.  In 2D, you would have 3 coordinates (x, y, w).  There is a plane in this "3D homogenous space" corresponding to w = 1.  To map a homogenous coordinate to the plane, we divide all 3 components by w: (x/w, y/w, w/w).If w = 0, then it's a "point at infinity" - it represents a direction rather than a location.When I was reading it, I was wondering why the method was to divide the x and y coordinates by w in order to map the point to the plane: why didn't they design it so that they could just chop the w coordinate off -- ie an orthographic projection?Reading around I suspect that this is the answer:1) Having the division gives us a way to represent points at infinity (directions) -- it's a way of dealing with division by zero2) In some applications, such as perspective project in 3D rendering, it results in a useful kind of projection - the pinhole camera affect, allowing a realistic view of a sceneIs this correct?  I just figured I'd run it by someone, so that I'd know the why.   
  It appears you've got the gist of it. Homogeneous coordinatesQuote:In mathematics, homogeneous coordinates, introduced by August Ferdinand Möbius in his 1827 work Der barycentrische Calcül[1], make calculations possible in projective space just as Cartesian coordinates do in Euclidean space. Homogeneous have a range of applications, including to computer graphics where they allow affine transformations to be easily represented by a matrix....Homogeneous coordinate systemQuote:A homogeneous coordinate system is a coordinate system in which there is an extra dimension, used most commonly in computer science to specify whether the given coordinates represent a vector (if the last coordinate is zero) or a point (if the last coordinate is non-zero). A homogeneous coordinate system is used by OpenGL for representing position....;  Imagine you are going to be painting. Your eye is the origin of the x-y-z coordinate system. z=1 is the canvas, where you have painted the coordinate axes x and y. Now any point in 3D space will be projected on the canvas to form your image. The point (4,6,2) maps to (2,3,1), which is on the canvas. The whole half line that connects the origin with (2,3,1) maps to the point (2,3,1). We call this whole line a "projective point". Well, the Math is much easier if you project points behind you as well, so (-4,-6,-2) also maps to (2,3,1). You basically look at R^3 from the origin, and what you see is a 2D structure, because you lose the notion of depth. This structure is called the projective plane. As I said before, a "projective point" is an equivalence class of points by the relation of having proportional coordinates.You really don't need the canvas in front of you to do projective geometry, but by looking only at the projective points that intersect the canvas, we recover the traditional affine plane. If we do that, the projective points that we are not including (which correspond to lines that pass through the origin and are parallel to the canvas) seem to represent a direction, not a point. We call them "points at infinity", but it's important to notice that this is a fairly arbitrary classification: We could put the canvas somewhere else, and most of these points would become regular points on the canvas.If instead of building this geometric structure using projection through the origin we would have used orthogonal projection, as you suggest, the resulting structure would have been exactly the old affine plane and nothing extra. The projective plane is much more interesting, especially if you are trying to put a camera somewhere inside the scene.I don't know if that explanation was clear at all. If it doesn't really address your question, ask again.   ;Quote:Original post by datahead8888I was reading along in chapter 9 in the book "3D Math Primer for Graphics and Game Development" and was reading the section on homogenous coordinates.They explain it in 2D in order to get the point across in 3D.  In 2D, you would have 3 coordinates (x, y, w).  There is a plane in this "3D homogenous space" corresponding to w = 1.  To map a homogenous coordinate to the plane, we divide all 3 components by w: (x/w, y/w, w/w).If w = 0, then it's a "point at infinity" - it represents a direction rather than a location.When I was reading it, I was wondering why the method was to divide the x and y coordinates by w in order to map the point to the plane: why didn't they design it so that they could just chop the w coordinate off -- ie an orthographic projection?It's not that this is *the* way to project a point onto a plane, it's just that having a coordinate system of one dimension higher than the space you're actually working in, where each scalar multiple of a vector represents the same point, is what we happen to call homogeneous coordinates.The reason for using homogeneous coordinates so often is not that the actual points we are modeling are in some way of a higher dimension (we are just working in 3D, nothing 4D about it), it's really just a mathematical trick that has the nice benefit that the set of possible transformations you can encode with just a matrix gets extend with translation and projection. And the simple fact that you only need matrices to encode any transformations you want gives you the opportunity to work with transformations using normal algebra, which is a huge benefit.Just compare it to factions, which are in fact 1D homogeneous coordinates. The fraction 1/2 has two components, so it could be considered a 2D vector, but what it represents really is just a scalar value. A different fraction, 2/4 has different components, so even though it's vector representation would be different, the actual value it represents is still the same as that of 1/2.The final w divide in your example is nothing more than converting from homogeneous coordinates back to normal coordinates, just like you convert a fraction to a decimal number by dividing the numerator by the denominator.   