Advertisement

What would happen if I... (OpenGL question)

Started by August 09, 2000 01:25 AM
1 comment, last by AnCcE 24 years, 5 months ago
Okay... geometrically speaking, any three points in space, no matter where they are, lie on a common plane. The fourth point, though, doesn''t have to, and that''s what''s got me thinking... On my hardware, if I give OpenGL a four sided polygon in which the last vertex is not on the same plane as the other three, the polygon appears as two triangles, one that covers the first three vertices, and another that connects the last one to the first three. It''s kinda hard to explain... For instance, if I put in glBegin(GL_POLYGON); glVertex3f(5, 5, -5); glVertex3f(-5, 5, -5); glVertex3f(-5, -5, -5); glVertex3f(10, -10, -10); glEnd(); I get two triangles, one made up of the first three vertices, and the second made up of the first one, the third one, and the fourth one. It looks like somebody folded a rectangle from corner to corner. Anyway, what I''m wanting to know is whether or not this is an implementation-specific behavior, or if I can count on getting the same result on any OpenGL system. Thanks in advance. Hi there, I''m AnCcE, and you''d be too if you weren''t somebody else.
Hi there, I''m AnCcE, and you''d be too if you weren''t somebody else.
I understand what your saying and Im pretty sure it turns out that way on ALL hardware. I think a Quad is always two triangles, as the Hardware can only Render Triangles, Please Correct me if Im wrong, because Im not sure,
Advertisement
Yeah, I believe that''s right. But you shouldn''t really rule out the fact that some card manufacturer might do it differently.

If you''re worried about wich points are chosen for the triange vertices, just use a triangle stip or fan rather than a polygon or quad.

Further point - although any three points are planar, if two or more of the points are co-incident then there are infinite solutions for the plane. Not that makes any difference to your question anyway.

This topic is closed to new replies.

Advertisement