Sign in to follow this  
jujumbura

Generating Vertex Normals

Recommended Posts

jujumbura    209

Hello all,

 

I have been making some functions that create "rounded" vertex meshes for me by sweeping over two angles ( vertical and horizontal ) and then using trigonometry to determine x, y and z position values.  The normal for a sphere made this way is simple, but I have started generating more complicated shapes where the normal can't be easily stripped from the position.

 

So, I am trying to determine the best way to find this normal value.  I know that the normal is given by the reciprocal of the tangent of an equation, and I can find the tangent by taking the derrivative.  But I can I use my original equations for x, y and z in terms of the two angles, or do I need to use different equations?

 

Thank you for any advice!

Share this post


Link to post
Share on other sites
Quick way is to sum the normals of each face touching a vertex, then renormalise. It usually looks ok. If it doesn't look good you can weight the face normal contribution to the vertex normal based on the area of the face (which is proportional to the magnitude of the cross product of the edge vectors of the face which touch the vertex). Edited by Paradigm Shifter

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