Hello

The vertex expressed in homogeneous coordinates (x ,y ,z ,w) is the same vertex expressed in cartesian coordinates (x/w, y/w, z/w)

w is set to 1.0 for vertices because it permits to avoid to do the division by w when dealing with affine transformations.

But when dealing with perspective projections, w can become not equal to 1.0, so the division by w is needed.

And when w=0, (x, y, z, w) represents all the vectors : a*(x ,y ,z ), a>0. (it defines a *direction*).

Concisely, w is set to 1 for vertices, w is set to 0 for vectors (like normals). And if a transformation involves at least one perspective projection, the division by w is needed.