PDA

View Full Version : Polygons perpendicular to near plane disappear



02-20-2006, 05:53 PM
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?

shelll
02-21-2006, 08:29 AM
I think your polygon disappears because it has no thickness.

<sorry for the edit, I misunderstood, dorbie>

02-23-2006, 08:56 AM
Fair enough. But I want it to appear, So my problem is how to make it appear.

dorbie
02-23-2006, 10:16 AM
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.

02-23-2006, 03:12 PM
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