|
|
| clockwise : anticlockwise - vertices |
|
Morpheous
Member #3,812
August 2003
|
From what I understand, when you talk about vertices, you usually talk about them as they exist when the shape is initially created. Before the vertices are transformed or whatever. My understanding is that, if you have a face that is initially seen by the camera, you must (should?) define the vertices in anti-clockwise order (this, I'm told is pretty standard). Does this mean that any faces that are not seen (i.e. the back faces), need their (initial) vertices defined in clockwise fashion, so that when they do face the camera, the vertices will be then be anti-clockwise? Or maybe I'm just confused. Also, could someone explain to me what a "concave" polygon is, please? I understand what a "self-intersecting" polygon is (I think), but "concave" makes it sound like it's not a closed shape. Quote:
-- From the Allegro API -- ... Unlike the regular polygon() function, these routines don't support concave or self-intersecting shapes ...
|
|
Plucky
Member #1,346
May 2001
|
A concave polygon is a polygon where at least one of its internal angles is greater than 180 degrees. Another description: there can exist a line segment connecting two vertices that does not fully lie within the polygon; it intersects the outer boundary at one point. A convex polygon is where all line segments between vertices are contained in the polygon. [edit] |
|
gnolam
Member #2,030
March 2002
|
At least in OpenGL you can specify which orientation your polygons have (using glFrontFace()). Counter-clockwise order is the standard though, both in 3d programming and in mathematics (e.g. vector analysis). -- |
|
Billybob
Member #3,136
January 2003
|
You do "backface culling" after transformations. The rendering pipeline will find the normal of the polygon and then cull appropriatly. You can accually turn this off, but it help proformance by 2x in some cases. As for specifying the normal, I'm guessing when it knows the normal off the bat, it'll transform that during the transfomations so it points the right way later. Also, be careful not to confuse this normal, with the one used for lighting. As I understand, you can specify a different normal for the lighting routines.
|
|
Morpheous
Member #3,812
August 2003
|
But do I have the right idea? You specify the front faces anti-clockwise and the back ones clockwise? That's basicly what I want to know. |
|
Billybob
Member #3,136
January 2003
|
Sorta kinda...
|
|
Goodbytes
Member #448
June 2000
|
By sorta kinda, William means yes. Err, actually, maybe he means sorta kinda, because sometimes you'll get faces that face neither towards nor away from the camera... say, pointing along the x-axis or something... It's easier if you think of it as specifying all vertices in anti-clockwise order as if the polygon in question on whatever 3D model you're constructing is facing you. Just rotate the model in your head. I'm assuming you're constructing something fairly simple like a cube, here, because otherwise you would be using a 3D modeling program and it does these things for you... |
|
Morpheous
Member #3,812
August 2003
|
Actually, I'm working on a framework for my own modeling program. |
|
Tobias Dammers
Member #2,604
August 2002
|
Quote: From what I understand, when you talk about vertices, you usually talk about them as they exist when the shape is initially created. Before the vertices are transformed or whatever.
No. At least not in this case. --- |
|
|