Archived

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

Protteus13

a section always cut out of my quads

Recommended Posts

Protteus13    122
Whenever i make quads i always get a triangle section of it that is cut out and not there and I have no idea why it does this, it will butcher all the sides but the first.

Share this post


Link to post
Share on other sites
Corrail    133
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
Protteus13    122
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
Protteus13    122
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
krez    443
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   
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