I was watching this lecture on YouTube on Projective geometry and Homogeneous Coordinates. Now, i understand that Euclidean geometry is in fact a special case of Projective Geometry where the last coordinate is 1. i.e a point in Cartesian coordinates say [2,1] is actually [2, 1, 1] in Projective geometry.

Now, i was able to visualize that a point in Cartesian coordinate is actually a line in Projective Space. But, how do i visualize a 3D point? say i have a point [2, 2, 5] in Cartesian coordinates, how do i visualize the fourth dimension?

A point is still a point in both 2D and 3D so i guess it would create a line with a different vector and origin.
The main problem is that 3d volumetric monitors are hard to come by so you have to project it down into 2D space in order to visualize it on a flat surface.

The 3D-projective space is the set of one-dimensional subspaces of the 4D euklidean space, so you’d have to visualize a 4D space first. Usually this doesn’t work too well.

So you should try to visualize a projective line or projective plane first. This should be sufficient to learn the principles of projective spaces, just like visualizing only 1D, 2D and 3D euklidean spaces can help you to get an understanding how the math works in an 78D vector space.

3D homogeneous coordinates are very simple, no need for visualizing, they represent simply 3D points.

The point (x, y, z, w) is simply the point (x/w, y/w, z/w) in Cartesian coordinates, so ‘w’ is simply a scaling factor.

The only trick happens when w=0, in such cases the interpretation is a bit different. The point (x, y, z, 0) is actually also a point but one that cannot be represented using Cartesian coordinates. Actually this point is an infinitely far point and as infinitely far points can be defined only by providing a direction where the point is, the (x, y, z) can be interpreted as a direction vector towards the infinitely far point.

That’s all, nothing magical here (no need for 4D and stuff to visualize 3D homogeneous coordinates).

What represents a Mat4 (m16]) if the elements of index [3], [7], [11] are not zero?
(i know that perspective projection matrix has -1 on [7] elements, if i recall correct…)

What happens if a vec4 rappresenting direction (x,y,z,0) is transformed with this matrix? It’s still a “direction” vector? Is it logically plausible such computation?

In projective geometry the infinite far plane (= all points having w = 0) is in no way special. A Matrix multiplication will simply transform it into another plane.

A matrix where the last row is (0,0,0,1) does not alter the w coordinate, so it maps the infinite plane onto the infinite plane (and the “finite” portion of the projective space onto the finite portion).

A matrix where the last row is not (0,0,0,1) maps the infinite plane into the finite space and one of the planes of the finite space becomes the new infinite plane.

This is used in fact when you do the conversion from eye to clip coordinates: The camera plane (i.e. the plane containing the camera point and perpendicular to the view vector) becomes the infinitely far plane.

As the camera point is the intersecion of all view rays, moving this to infinity causes all view rays to become parallel, so the view frustum in eye space is transformed into a view cube in clip space.