Archived

This topic is now archived and is closed to further replies.

Angela

help: lesson 37

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
>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

Share this post


Link to post
Share on other sites