Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calculating Vertex Normals of a mesh [duplicate]

Tags:

graphics

I have legitimately done every research possible for this, and it all just says to simply calculate the surface normals of each adjacent face. Calculating surface normals is easy, but how the heck do you find the adjacent faces for each vertex? What kind of storage do you use? Am I missing something? Why is it so easy for everyone.

Any guidance would be greatly appreciated.

like image 274
Jimmy Dean Avatar asked May 02 '13 14:05

Jimmy Dean


1 Answers

but how the heck do you find the adjacent faces for each vertex?

Think it otherway round: Iterate over the faces and add to the normal of the vertex. Once you processed all faces, normalize the vertex normal to unit length. I described it in detail here

Calculating normals in a triangle mesh

If you really want to find the faces for a vertex, the naive approach is to perform (linear) search for the vertex in the list of faces. A better approach is to maintain an adjancy list.

like image 157
datenwolf Avatar answered Nov 15 '22 08:11

datenwolf