Archived

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

Protteus13

a section always cut out of my quads

Recommended Posts

How do you draw your quad? Post some code pls

--------------------------------------------------------

"If it looks good, it is good computer graphics"
"If it looks like computer graphics, it is bad computer graphics"

Corrail
corrail@gmx.at
ICQ#59184081

Share this post


Link to post
Share on other sites
glBegin(GL_QUADS);
glVertex3f(1.0f, 1.0f, 0.0f);
glVertex3f(-1.0f, 1.0f, 0.0f);
glVertex3f(1.0f, -1.0f, 0.0f);
glVertex3f(-1.0f, -1.0f, 0.0f);
glEnd();

thats how I do them it always cuts a section thats like a triangle out of them.

Share this post


Link to post
Share on other sites
even when i execute other peoples programs wiht quads in them it cuts a triangle section out of each quad. I''m wonderimg if it''s my computer. Its getting very frustrating because i only see part of mapped textures and quads, because there is a triangle cut out of them.

Share this post


Link to post
Share on other sites
quote:
Original post by Protteus13
glBegin(GL_QUADS);
glVertex3f(1.0f, 1.0f, 0.0f);
glVertex3f(-1.0f, 1.0f, 0.0f);
glVertex3f(1.0f, -1.0f, 0.0f);
glVertex3f(-1.0f, -1.0f, 0.0f);
glEnd();

switch the last two glVertex3f() calls.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
vertex coordinates need to be in either clockwise or counter clockwise order...

A B
(-1.0, 1.0) | (1.0, 1.0)
. | .
-----------------|----------------
. | .
(-1.0, -1.0) | (1.0, -1.0)
C D

you were processing them in this order...
B A D C

the A-D was causing the triangle

the correct order as posted by krez would draw it
B A C D


Share this post


Link to post
Share on other sites