PDA

View Full Version : What's wrong with this.......(Displaying a triangle)



incognito3k
03-14-2003, 05:27 PM
glBegin(GL_TRIANGLES);
glVertex3f(0.0, 1.0,0.0);
glVertex3f(0.0, 1.0, 00);
glVertex3f(0.0, 3.0,0.0);
glEnd();

neumiwj
03-14-2003, 06:09 PM
Originally posted by incognito3k:




glBegin(GL_TRIANGLES);
glVertex3f(0.0, 1.0,0.0);
glVertex3f(0.0, 1.0, 00);
glVertex3f(0.0, 3.0,0.0);
glEnd();



//Try this
glBegin(GL_TRIANGLES);
glVertex3f( 0.0, 1.0, 0.0 );
glVertec3f(-1.0, 0.0, 0.0);
// Note above line used to contain 00
// instead of 0.0 Picky, I dunno.
glVertex3f( 1.0, 0.0, 0.0);
glEnd();
// This should draw you a triangle.
// glVertex3f( float x, float y, float z );

Jambolo
03-15-2003, 12:09 AM
Originally posted by incognito3k:



glVertex3f(0.0, 1.0,0.0);
glVertex3f(0.0, 1.0, 00);


These vertices are at the same location. It looks like a typo.

oliii
03-15-2003, 05:58 PM
looks like it's exactly what he is trying to do. Copy/paste from code. All vertices are aligned, and two are at the same position. You won't see a triangle, but maybe a line if you're lucky. Also be careful of the winding order.

try glDisable(GL_CULL_FACE); if you still can't see a triangle