View Single Post
Old 29th August 2005, 12:23 PM   #1
Gary E Sanders
Junior Member
Member
 
Join Date: Nov 2003
Posts: 12
Default How are AC3D Normal Calculations done?

I'm using ac3d files directly in an OpenGL program. In doing the normal calculations I notice a couple of things.

1) My method is significantly slower than AC3D
2) I smooth over adjacent surfaces that AC3D doesn't.

Basically for each surface set to smooth I check for a shared vertex with any other surface in that object, then calculate the average of the surface normals of all smooth surfaces joining at that vertex to get the vertex normal.

An illustration of the problem is a box drawn in ac3d and set to smooth surfaces doesn't look any different than the same box with the surfaces set to flat when viewed in AC3D. Using the normal calculation methodology above it looks like a poor sphere.

What I would like to do is duplicate the surface normal calculation done in ac3d ( I know I can export normals, but I want to use the .ac file directly) Perhaps someone, (Andy?) can give a hint on determining which surfaces need to be included in the vertex normal calculation.

thanks
ges
Gary E Sanders is offline   Reply With Quote