How can I calculate a vertex normal for a hard edge?
- by K.G.
Here is a picture of a lovely polygon:
Circled is a vertex, and numbered are its adjacent faces. I have calculated the normals of those faces as such (not yet normalized, 0-indexed):
Vertex 1 normal 0: 0.000000 0.000000 -0.250000
Vertex 1 normal 1: 0.000000 0.000000 -0.250000
Vertex 1 normal 2: -0.250000 0.000000 0.000000
Vertex 1 normal 3: -0.250000 0.000000 0.000000
Vertex 1 normal 4: 0.250000 0.000000 0.000000
What I'm wondering is, how can I determine, taken as given that I want this vertex to represent a hard edge, whether its normal should be the normal of 1/2 or 3/4? My plan after I glanced at the sketch I used to put this together was "Ha! I'll just use whichever two faces have the same normal!" and now I see that there are two sets of two faces for which this is true.
Is there a rule I can apply based on the face winding, angle of the adjacent edges, moon phase, coin flip, to consistently choose a normal direction for this box?
For the record, all of the other polygons I plan to use will have their normals dictated in Maya, but after encountering this problem, it made me really curious.