• Advertisement
Sign in to follow this  

Face normals to Vertex normals... How?!

This topic is 4815 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

AHOY! I have some problems with OGL normals, I made a small script to export models from 3DS, but the 3DS just export the face normals. Now I need to convert the face normals to vertex normals to use the index matrix. The big question is, how can I convert face normals to vertex normals?! Thanks!!!

Share this post


Link to post
Share on other sites
Advertisement
I'm not an OpenGL expert, so I don't know if there is a pre-made function in OpenGL that will generate vertex normals for you. But the generic algorithm to find vertex normals when you have only face normals is to take each vertex, find all the faces that use that vertex, and average those face normals. That will be the normal for that vertex. You'll need to do that for every vertex in your mesh.

Hope that helps,

roger_hq

Share this post


Link to post
Share on other sites
If you're still looking for the actual routine, for each vertex find every face that that vertex helps create and add the surface normals all together. Then just normalize it and you're done.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement