Polygons perpendicular to near plane disappear

I’m having a problem trying to draw poligons that cross the near plane, i.e. at least one vertex is outside the view frustum.

I’m using ortho projection, and when the polygon is perpendicular to the near plane and part of it is on the wrong side of the near plane, i.e. outside the view frustum, the polygon should render as a line, but instead it disappears. How do I avoid this, how do i get it to render a line?

I think your polygon disappears because it has no thickness.

<sorry for the edit, I misunderstood, dorbie>

Fair enough. But I want it to appear, So my problem is how to make it appear.

Antonio, when polygons are projected onto the screen if they have zero area they do not fill any pixels. Your polygon has zero area after projection.

If you still want it to apear you could outline the polygon using a GL_LINE_STRIP primitive.

Yes, thats what I’m doing, but i have to create a clip plane on top of it slight further than the near plane to record the real depth.

I was just wondering if there was a simpler way than to have to draw the scene twice, with GL_FILL and with GL_LINE