Advertisement

help: lesson 37

Started by January 20, 2003 08:22 AM
1 comment, last by Angela 22 years, 1 month ago
Hi, I'd like to have some explanation about the code for outline drawing in lesson 37. The glCullFace (GL_FRONT) allows to draw only the backfacing polygons, so the code for drawing the faces will draw all the backfacing using GL_TRIANGLES. So why is necessary to have the command glPolygonMode (GL_BACK, GL_LINE) ? If I remove glPolygonMode (GL_BACK, GL_LINE) from the code, the outline is not drawn. It's not clear for me why, I think I didn't understand what this function actually does. Thanks in advance, Angel. [edited by - Angela on January 20, 2003 9:30:42 AM]
if you remove that line the polygons will be drawn but since they face the wrong way the will not be visible.

glPolygonMode (GL_BACK, GL_LINE) draws the triangles as lines instead of being filled(note: a line can be seen from all angles and thus can''t be culled)

glPolygonMode (GL_BACK, GL_FILL) sets it back to normal.

It''s allso using the fact that lines must have a width that can be set to whatever value you like, polygons are hard to manipulate in that way.
Advertisement
>if you remove that line the polygons will be drawn but since >they face
>the wrong way the will not be visible.

Why not? The glCull doesn''t set to be culled the frontfacing, instead
of the backfacing?

>glPolygonMode (GL_BACK, GL_LINE) draws the triangles as lines
>instead of being filled(note: a line can be seen from all >angles
>and thus can''t be culled)

I think I didn''t understand what the glCull does.
Could you explain me?
I thought that to cull a face meant not to draw a face.

>glPolygonMode (GL_BACK, GL_FILL) sets it back to normal.

ok.

Thanks , Angela

This topic is closed to new replies.

Advertisement