<<< Cartesian coordinates | Index | Matrix >>> |
For vertices OpenGL is using 4-component vectors, which are sets of four numbers:
( x, y, z, w )
where x, y, z are coordinates, and w serves two purposes:
If w == 1, then the vector ( x, y, z, 1 ) is a position in space
If w == 0, then the vector ( x, y, z, 0 ) is a direction
Why use homogeneous coordinates?
They allow to apply the same mathematical formulas to deal with all matrix transformations in 3D graphics.
An ( x, y, z, w ) vector in homogeneous coordinates actually means ( x/w, y/w, z/w ) in a 3D space.
Read more: http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/ matrices tutorial from www.opengl-tutorial.org
<<< Cartesian coordinates | Index | Matrix >>> |