a section always cut out of my quads

Started by
6 comments, last by Protteus13 20 years, 8 months ago
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.
Advertisement
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
--------------------------------------------------------There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.There is another theory which states that this has already happened...
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.
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.
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.
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
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


If you''re lazy, just go

glDisable(GL_CULL_FACE);
-=|Mr.Oreo|=-Code Monkey, Serpent Engine
Last post is VERY lazy.... not a good idea. =)

"Game Maker For Life, probably never professional thou." =)
"Game Maker For Life, probably never professional thou." =)

This topic is closed to new replies.

Advertisement