How can I calculate a vertex normal for a hard edge?
Posted
by
K.G.
on Game Development
See other posts from Game Development
or by K.G.
Published on 2012-03-23T03:04:03Z
Indexed on
2012/03/23
5:39 UTC
Read the original article
Hit count: 320
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.
© Game Development or respective owner