4 ms·
The easiest way to understand homogeneous coordinates in general, IMO, is to understand the 2D case. In that case, your homogeneous coordinates have 3 componen
by nice_byte 9y ago
The easiest way to understand homogeneous coordinates in general, IMO, is to understand the 2D case.
In that case, your homogeneous coordinates have 3 components, and it's pretty easy to visualize them in 3D space. The z=1 plane is your actual 2D plane. Now consider the set of all lines passing through the 3D origin, those are either parallel to z=1 plane or intersect it at precisely one point. That point of intersection is (x0, y0, 1), and if you multiply by any constant factor, the point just moves along its corresponding line.
Thus, any 3d point with z!=0 can be mapped 1:1 to your 2D plane by simply dividing by z. Points where z = 0 don't map to z=1 plane, they're considered "infinitely far away", and can be used to specify directions on your 2D plane (since they don't get affected by translation!).
Once you wrap your head around the 2D case, it's fairly easy to extend it to 3D.
There isn't anything inherently magical about homogeneous coordinates, it's just a convenient notation for referring to points in space that just happens to lend itself particularly well to affine transforms in that space.
For anyone interested, I highly recommend reading this article: http://deltaorange.com/2012/03/08/the-truth-behind-homogenous-coordinates/ http://deltaorange.com/2012/03/08/the-truth-behind-homogenou...
- geokon 9y agoI understand what you're saying, but they're still very magical to me. They are taking something that is a non-linear operation in R3 (like a translation) and making it linear by using a trick and giving it an extra dimension. This is somehow very unsettling to me. (what is the set of operations that can be linearized like this?) I wish I "got it" better
- Sharlin 9y agoThe trick is that a translation of a point (a1, ..., an) is essentially a shear of a point (a1, ..., an, 1) - a linear operation in R^(n+1). But because the points that are of interest lie on a (hyper)plane that is not a vector space - it does not intersect the origin - a shear looks like a nonlinear operation after projection to R^n. ^ |---a | | --+---------> | ^ | ,---a |/ / --+---------> |
- Sharlin 9y agoAnd you can see how points on the a_(n+1) = 0 plane ("infinitely far away" in projective terms) are invariant under this operation - so they behave like pure direction vectors and can be used as normals and transformed with the same matrix as points!
- UnquietTinkerer 9y agoThis explanation really helped, thank you.
- deleted 9y ago[deleted]
- contravariant 9y agoThe translation part is not that complex, you're basically just introducing an extra coordinate 'w' which is always 1, so you can write x -> x + w, which is linear, rather than x -> x + 1, which is not. Things start to get weird when you note that this works even when w isn't 1. If you then decide that e.g. (x,y,w) and (x/w, y/w, 1) should be the same point, you can do some rather interesting things. Although, if you identify (x:y:w) with all the points on the line (lx:ly:lw) (for any l) then suddenly (x/w, y/w, 1) is just the point where this intersects the plane w=1, which isn't too hard to visualize. And if you think about it this also kind of explains why this coordinate system can be used to project a 3D scene onto a 2D surface with correct perspective.