How to do the interlaced rendering effect

How to do interlaced( an output where we draw a line and we skip (or darken) the next and so on) rendering effect in opengl.

I have read that we can use the stencil buffer to mask the lines.

I am not able to figure out the code for this , if someone can show me how this can be done.