w coordinate

what is the sense of this forth component of a vertex. still don’t understand it…

:frowning:

When you stipple a w value that’s different of 1.0, this means you’re not under an homeogenous coordinate system. When you don’t stipple it or if you put it at 1.0, you’re under homogeneous coordinates. But OpenGL defauts to non-homogeneous coordinates system and homogeneous coordinates are just a special case of that whole, meaning:

glVertex4f (x,y,z,w) will be interpreted by GL as x/w, y/w, z/w simply and glVertex3f (x,y,z) will be interpreted as x/1,y/1,z/1.

Hope that helps.

is the division done after the vertex shader (for example lighting)?

GL uses the 4 values for all the stuff, I’m pretty sure about it, so I guess it keeps it all along the work. I can hope this has something to do with memory alignment.

Well I must admit I’ve made an error: (x,y,z,w) are homogeneous coordinates, but (x,y,z) are just what called euclidian coordinates | thousands sorries for that :smiley: I’m so not used to use 4 values, instead I - always - use 3 values.

Euclidian spaces are generally flat spaces whereas non-eclidian can be curve-spaces.

sorry again for the mistake.

no problem. understood it now.

Homogeneous coordinates are required for projective space. Think about a landscape painting; an object gets smaller if it moves further from eyepoint, or two parallel lines can meet each other at horizon.

These phenomena simply cannot be explained with Cartesian coords.

More explanation is here: Homogeneous Coordinates

Yes, the perspective division by w occurs after lighting calculation and clipping by viewing volume clipping planes.
==song==