Advertisement

It's me again, with yet another stupid questions :)

Started by March 15, 2003 10:18 AM
8 comments, last by incognito 21 years, 11 months ago

  

		glBegin(GL_TRIANGLES);
		glPolygonMode(GL_BACK , GL_LINE);
		glVertex3f(-1.0f, -1.0f, -5.1f);
		glVertex3f( 0.0f, 1.0f, -5.1f);
		glVertex3f( 1.0f, -1.0f, -5.1f);
		glEnd();


  
I am trying that the back of the triangle (which is the side facing me, or so I''ve been told), be drawn with lines and not filled......any ideas? Thanks in advance. PROGRAMMING IS THE FUTURE........ THE FUTURE IS HERE!!!!!!!
PROGRAMMING IS THE FUTURE........ THE FUTURE IS HERE!!!!!!!
put glPolygonMode out of glBegin/glEnd block

You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
Advertisement
Whohooooooooooo it works. Thank you.

PROGRAMMING IS THE FUTURE........ THE FUTURE IS HERE!!!!!!!
PROGRAMMING IS THE FUTURE........ THE FUTURE IS HERE!!!!!!!
Bleh, the book does this (so far) only with a message on the windows procedure, so I tried to do it on the code itself just to practice and it''s not working.....(I am talking about antialiasing polygons.....) here''s what I have.....



  		glPolygonMode(GL_BACK, GL_LINE);		glEnable(GL_POLYGON_SMOOTH);		glBegin(GL_TRIANGLES);					glVertex3f(-1.0f, -1.0f, -5.1f);		glEnable(GL_POLYGON_SMOOTH);		glVertex3f( 0.0f, 1.0f, -5.1f);		glEnable(GL_POLYGON_SMOOTH);		glVertex3f( 1.0f, -1.0f, -5.1f);		glEnd();  


Maybe I have this out of order or something. Thank you in advance people. ANY help would be greatly appreciated.

PROGRAMMING IS THE FUTURE........ THE FUTURE IS HERE!!!!!!!
PROGRAMMING IS THE FUTURE........ THE FUTURE IS HERE!!!!!!!
What exactly isn''t working?

The only thing I see wrong is that every glEnable(GL_POLYGON_SMOOTH) after the first one is redundant.

GL_POLYGON_SMOOTH will be enabled forever until you disable it.
the lines are not being anatialised.

(it's not making them smoth like I wanted)

PROGRAMMING IS THE FUTURE........ THE FUTURE IS HERE!!!!!!!




[edited by - incognito on March 15, 2003 8:37:21 PM]
PROGRAMMING IS THE FUTURE........ THE FUTURE IS HERE!!!!!!!
Advertisement
You probably need to turn on line smoothing instead of polygon smoothing since you''re telling it to draw lines.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Thank you.

Yeah it works that way, weird....another Q is
glHint(GL_LINE_SMOOTH, GL_NICEST);

supposed to be called before calling
glEnable(GL_LINE_SMOOTH); or after?

PROGRAMMING IS THE FUTURE........ THE FUTURE IS HERE!!!!!!!

[edited by - incognito on March 15, 2003 8:53:43 PM]
PROGRAMMING IS THE FUTURE........ THE FUTURE IS HERE!!!!!!!
Doesn''t matter which is called first, as long as you call them both before rendering anything. But it is not nessecary to call it more than once, so put it in your init code.
You should not call glEnable between glBegin and glEnd

This topic is closed to new replies.

Advertisement