Sign in to follow this  
pontifikas

A question about normal culculation

Recommended Posts

I follow the instructions of an algorithm in order to perform some alterations in a 3D mesh. The algorithm requires that I compute the normal vectors as: "The weighed average ("by the AREA of triangles") of the normals to the triangles in the 1-ring neighbourhood of the vertex". I cannot figure out what the above means. The terms "by the AREA of triangles" and "1-ring neighbourhood" totaly confuse me. I know, one way to compute vertex normals is to compute the sum of the normals of the facets which contain the vertex and then normalize the result. Perhaps maybe apply some weights for better results. But this doesnt sound the same with the above.

Share this post


Link to post
Share on other sites
The first ring of triangles of a vertex will just be the set of triangles that have the specified vertex as one of its vertices. So you'd calculate the normals of all triangles that the vertex is in and use the weighed average as the vertex normal, to get a smooth result.

Now the weighed average by the area of the triangles means that the greater the area of the triangle the more its normal count in the result. So you should calculate the area of the triangle and multiply the normal by this value. In the end you'd divide the result by the total area of all trhe triangles, but since you normalize it any way this will be redundant.

Greetings.

Share this post


Link to post
Share on other sites
Haven't encountered the term '1-ring neighborhood' before, but google seems to indicate that it's simply the triangles that include the vertex in question. As for weighting by surface area, a fairly straightforward way to do so is simply to leave the normals of the triangles un-normalized; they will then be proportional to the areas of the triangles, and triangles with larger areas will be favored when averaging.

Share this post


Link to post
Share on other sites
Quote:
Original post by pontifikas
What would the "weighting" factor be?
It says, the "weighted" average.
With the 'un-normalized normals' method, the weight is simply the length of the normal. Just compute the triangle normals using the cross product (don't normalize!), then sum the normals of the triangles in the '1-ring neighborhood' for each vertex, and normalize the result.

Share this post


Link to post
Share on other sites
Quote:
Original post by pontifikas
What would the "weighting" factor be?
It says, the "weighted" average.


Well the area of the triangle which normal you calculate:

if you got a,b,c in vertices, .5*|det(a-b, c-b)| = .5 * |((a-b) x (c-b))| should give you the area (correct me if i am wrong)

Greetings.

EDIT: @jyk: that's even better, otherwise you would be doing the same calculation twice :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this