Render Every Second Line?

Just trying to use the stencil buffer and stencil ops to render every second line of my scene. Is there any quick way to do this? Anyone have a quick’n’dirty code listing for this? I think PolyStipple might be the way to go as far as the stencil buffer but either I get nothing in the stencil buffer or garbage.


The pixel mask ordering is a bit strange, but I managed to get the effect of ‘every other line’ with this code :

GLubyte a[128] ;
for (i=0;i<128;i+=1) {
a[i]=0xFF; // init to ‘draw all’
do {
a[i]=0x00; // clear 4*8 pixels
i+=8; // jump a line
} while (i<128);

Good luck.

EDIT: and if you use only polygons (no lines or glBitmaps) you won’t need a stencil buffer mask. Just enable stippling and draw everything, it will work.

[This message has been edited by ZbuffeR (edited 12-15-2003).]

Sounds like vertical interlaced stereo.
See here
Search for my nickname and “stereo” to find more answers.