diagonals on line-drawn polygons

If I draw quads on the screen using lines instead of fills, by doing:


	glPolygonMode(GL_FRONT,GL_LINE);
	glPolygonMode(GL_BACK,GL_LINE);

beforer drawing the polygons, diagonals for each quad are also drawn if the quad is near the edge of the screen. Why does this happen and how can I fix it?

Thanks,
-dimroed

Not sure but try glDisable(GL_SMOOTH)…

I would venture a guess that your implementation clips things that lie partially on and offscreen by decomposing them into triangles.

Thanks… I tried to use glDisable(GL_SMOOTH), but it didn’t seem to fix the problem. My base code is the same as the NeHe code from this website .

Any other ideas about how to disable this clipping?

What grafix card are you using?

I’ve seen ‘near clip’ problems on SiS
grafix chips.

I’ve also seen it on other boards but
it was usually solved by not using the
glShadeModel(GL_SMOOTH).

NeHe’s base code was usually the same
from the 2d lesson thru the 3d textured
lessons. Do you mean your base code is
from lesson 1 or from another lesson?

Yeah, I’m using a SIS card. That must be it. Thanks!

I am using NeHe’s code from those first few lessons.