• Advertisement

Archived

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

Quad drawing black triangle...help

This topic is 5058 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey im drawing somthing pretty simpile just
glBegin(GL_QUADS);					
		glVertex3f( 0.1f, 0.1f, 0.0f);			
		glVertex3f( 0.9f, 0.1f, 0.0f);			
		glVertex3f( 0.9f, 0.9f, 0.0f);			
		glVertex3f( 0.1f, 0.9f, 0.0f);
        
        glVertex3f( 0.9f, 0.1f, 0.0f);			
		glVertex3f( 0.9f, 0.9f, 0.0f);			
		glVertex3f( 0.9f, 0.1f,-2.0f);			
		glVertex3f( 0.9f, 0.9f,-2.0f); 		
	glEnd(); 
but it seems to be drawing a polygon over top of the back quad. and i cant figure out why its doing that any one no how to fix it?

Share this post


Link to post
Share on other sites
Advertisement
Make sure your colour is set correctly, and that you haven''t got a texture or light interfering with things, ie:

// set colour to white
glColor3ub(255,255,255);
// disable texturing
glDisable(GL_TEXTURE_2D);
// disable lighting
glDisable(GL_LIGHTING);

// DRAW YOUR QUADS HERE


If this works, try removing one of the lines that I have added at a time until it stops working again, then you will know what was interfering with it.

GL & HF


--
Cheers,

Share this post


Link to post
Share on other sites
Well I would get rid of the second set of 4 verts untill you get your first quad working.

Share this post


Link to post
Share on other sites
you''ve got two quads specified there, but one is "bow-tied" -- it''s vertex order is goofed.

honestly, i can''t remember which way to spec a quad in openGL, but i think it''s: lower left, lower right, upper left, upper right. your first quad is lower left, lower right, upper right, upper left. swap vert 3 and 4 and try that.

if that doesn''t fix it, swap em back and swap verts 3 and 4 from the 2nd quad.

Share this post


Link to post
Share on other sites
ok it was that bow tie thing :D and my first one was working fine and the other one was not but thanks i forgot that it mattered what order there were called in :D well thanks :D

Share this post


Link to post
Share on other sites

  • Advertisement