Why won't this display the front face of the triangle with lines.
Code:glBegin(GL_TRIANGLES); glPolygonMode(GL_FRONT, GL_LINE); glVertex3f(-1.0f, -1.0f, -5.1f); glVertex3f( 0.0f, 1.0f, -5.1f); glVertex3f( 1.0f, -1.0f, -5.1f); glEnd();
Why won't this display the front face of the triangle with lines.
Code:glBegin(GL_TRIANGLES); glPolygonMode(GL_FRONT, GL_LINE); glVertex3f(-1.0f, -1.0f, -5.1f); glVertex3f( 0.0f, 1.0f, -5.1f); glVertex3f( 1.0f, -1.0f, -5.1f); glEnd();
There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!
"...The only real game I thank in the world is baseball..." --Babe Ruth
"Life is beautiful"-Don Corleone right before he died.
"The expert on anything was once a beginner" -Baseball poster I own.
Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.
I dropped that in place of the triangle create lines in one of my programs, and it drew a triangle just fine.
With just the lines? Not filled......I mean draw a triangle with lines.....not filled....Thanks btw
See I want the triangle to drawn ( at least the front part ) using not lines, not filled, I thought this was the function used to do this.
glPolygonMode(GL_FRONT, GL_LINE);
but it doesn't seem to work.
There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!
"...The only real game I thank in the world is baseball..." --Babe Ruth
"Life is beautiful"-Don Corleone right before he died.
"The expert on anything was once a beginner" -Baseball poster I own.
Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.
The default is to fill the region with color. To change the way polygons are drawn, you would use:
void glPolygonMode(GLenum face, GLenum mode);
The only thing i can think is that the mode is set to fill (default) still and is over-riding the command to draw in lines. I have never used the above method before, so you will have to look it up.
your front is actually your back.
it is actualy showing(logical back ) which is your front.
draw it counter clockwise and it will be ok.
you can't call glPolygonMode() in-between glBegin() and glEnd(). call it before.
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.
EDIT, got it work people, apparently you have to call glEnable (GL_LINE_SMOOTH) for some reason.
Thanks no one it's working now.....hey people I am also having problems with this.......it won't smooth out the lines.
Code:glPolygonMode(GL_BACK, GL_LINE); glBegin(GL_TRIANGLES); glEnable(GL_POLYGON_SMOOTH); glVertex3f(-1.0f, -1.0f, -5.1f); glVertex3f( 0.0f, 1.0f, -5.1f); glVertex3f( 1.0f, -1.0f, -5.1f); glEnd();
The book says something about lines of with (1.0) but I don't really understand what it's refering to.
Last edited by incognito; 03-15-2003 at 07:55 PM.
There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!
"...The only real game I thank in the world is baseball..." --Babe Ruth
"Life is beautiful"-Don Corleone right before he died.
"The expert on anything was once a beginner" -Baseball poster I own.
Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.
glEnable() should not be called inbetween glBegin() and glEnd()