#### Archived

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

# Polygon vertex order

This topic is 6699 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey, I''m a newbie in the 3d field and I seethat for lighting your polygon has to haveits vertices aligned in clockwise order. Does this mean the 2d projection points have to be in 2d order? And how exactly would I go about doing this, any well known methods? ------------------------------ fclose(fp) ------------------------------

##### Share on other sites
You have right hand systems and left hand systems. Normals are derived from crossing two vectors defining edges of a polygon.

I have written 4 cross functions:
crosscwrhs
crossccwrhs
crosscwlhs
crossccwlhs

Actually, I wrote only one cross function, and #defined 3 others which reverse the input order if necessary.

Each of these functions will return a vector normal to the plane defined by the two input vectors. The normal returned will be facing you if you are using the cross function that is consistent with the cooridnate system and the conssistent with the winding of the vectors. If you reverse the order of the input vectors, you have changed their winding from clockwise to counter-clockwise or the opposite.

If you are in 3d space and outside an object and want a normal facing you, then you have to calculate the cross correctly. This is dependent on the winding of the input vectors, and whether you are using a right hand or left hand cooridnate system.

Winding (cw or ccw) is only consistent for all edges of a polygon if it is convex. If it is concave, further processing is required.

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 9
• 9
• 9
• 14
• 12
• ### Forum Statistics

• Total Topics
633296
• Total Posts
3011245
• ### Who's Online (See full list)

There are no registered users currently online

×