PDA

View Full Version : Different quad with same vertexes...



IG
01-17-2006, 09:07 AM
Need some help pls.
I'm Drawing Quad as follows:
glBegin(GL_QUADS)
glVertex3f(100, 100, 10);
glVertex3f(200, 100, 0);
glVertex3f(200, 200, 0);
glVertex3f(100, 200, 0);
glEnd();
Now, if I'm switching the order of the vertexes (v2-v3-v4-v1 instead of v1-v2-v3-v4):
glBegin(GL_QUADS)
glVertex3f(200, 100, 0);
glVertex3f(200, 200, 0);
glVertex3f(100, 200, 0);
glVertex3f(100, 100, 10);
glEnd();
I'm getting a different quad on the screen !!!
How can it be ???

memfr0b
01-17-2006, 10:30 AM
That's probably because your quad is not a valid quad. It is not planar, as it should be.

dorbie
01-17-2006, 10:40 AM
Hardware will usually decompose quads to two triangles. This can affect shading interpolation but as also noted non planar vertices could also affect the results.