Advertisement

Cant draw a quad?

Started by April 22, 2003 01:03 AM
8 comments, last by AriasXP151 21 years, 10 months ago
hello, i am having a bit of trouble drawing a quad in lesson 19... im quite sure there is nothing wrong with my code to draw a quad... it put it in right before the loops that draws the particle strip... heres how im drawing the quad...

	glColor3f(0.0f,0.0f,1.0f);
	glBegin(GL_QUADS);
		glVertex3f(-21.5f,Apady,0.0f);
		glVertex3f(-21.0f,Apady,0.0f);
		glVertex3f(-21.0f,Bpady,0.0f);
		glVertex3f(-21.5f,Bpady,0.0f);
	glEnd();
 
maybe im over looking somthing... Apady is set to 1.0f and Bpady is set to -1.0f i have also tried setting the z values to -6.0f and 6.0f to make sure it wasnt behind me or somthing... and i know the x shouldnt be the porblem because i can move the triangle strip emiter to -22.0f and its still visible... so i dunno... any help is appreciated
just a guess (i''m a newby with opengl): you are drawing your vertices clockwise which, in opengl, draws the backface rather than counterclockwise which draws the front face.
---------------------------------------------------There are 10 kinds of people in the world:Those that understand binary, and those that dont...Mage
Advertisement
does it have a texture on it?

---------------------------
The pipes clangor all the time.
---------------------------The pipes clangor all the time.
no it doesnt, im just trying to draw a blue quad... but it doesnt show up
Try making all the z values -4.0f or something, maybe you''re drawing too close to the screen. If that don''t work make sure that GL_TEXTURE_2D is disabled and so is back face culling.

Hyperdev

"To err is human, to really mess up requires a computer"
"To err is human, to really mess up requires a computer"
GL_TEXTURE_2D is enabled because the particles from when i disable it the particles look like utter crap... and as stated in my first post i have tried moving it out to -6.0f


ahhh i cant figure this out =(
Advertisement
Try something like this:

glColor3f(0.0f,0.0f,1.0f);

glDisable(GL_TEXTURE_2D);

glBegin(GL_QUADS);
glVertex3f(-21.5f,Apady,0.0f);
glVertex3f(-21.0f,Apady,0.0f);
glVertex3f(-21.0f,Bpady,0.0f);
glVertex3f(-21.5f,Bpady,0.0f);
glEnd();

glEnable(GL_TEXTURE_2D);

---------------------------
The pipes clangor all the time.
---------------------------The pipes clangor all the time.
i tried that, still no quad to be seen
Then your quad is way off the screen in order to see it with the partical thing then your going to have to back off way back like

glTranslatef(0.0f,0.0f,-60.0f);

far off!

And make shure you glDisable(GL_TEXTURE_2D); and
glEnable(GL_TEXTURE_2D);
---------------------------
The pipes clangor all the time.

[edited by - pipes clangor on April 22, 2003 4:42:52 AM]
---------------------------The pipes clangor all the time.
hehe yea it was WAY off the screen *smacks forehead*

now i wish i had tried -60.0f at first instead of -6.0f lol

This topic is closed to new replies.

Advertisement