Hi YHWH_777,
> My understanding is that MoI exports vertex normals
> in the OBJ file.
Correct.
> But then when Blender imports the OBJ file, it then ignores
> the vertex normals in the file and recalculates its own vertex
> normals, which can then lead to issues.
Yup, although for the older Blender 2.49 version you can get the vertex normals read in either by using Anthony's LWO import script here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=979.1
Or by using this modified alternate OBJ import script from here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=3164.11
But I think that the script interface has changed for the newest Blender release, so these scripts that run on 2.49 will not work on the latest 2.5x releases.
> - Why are the calculations of the vertex normals different
> between MoI and Blender?
MoI uses a method called "NURBS surfaces" to represent 3D objects. This kind of model data is made up of splines, which are actually mathematically smooth objects, not just a bunch of planar facets that are trying to approximate a smooth object by having a lot of little flat pieces like a polygon model.
So when MoI makes a vertex normal, it comes directly from the NURBS surface data, it basically represents the ideal shape and shading of the object, not just an approximation of it.
> I would think that the calculation of vertex normals would
> be the same for all 3D modeling apps.
No, there are actually a variety of different ways that 3D models can be represented, like polygons, NURBS, voxels, etc... each of these methods can structure data kind of differently so it's not like "3D" is just one single technology...
There are some common formats that are based around a particular technology though, like OBJ.
But one of the features of the OBJ format is that it can hold not just the polygons but also vertex normals that represent how the polygons should be shaded when rendered - renderers use vertex normals to shade a flat polygon to pretend that the polygon is actually a smooth surface even though it is really just a flat facet.
OBJ format allows storing vertex normal data along with the mesh, in addition to storing the 3D point location of each vertex and also a UV coordinate. When it is present, those vertex normals are supposed to be used to shade the polygons, but that's the part that does not happen with Blender.
> - How does MoI calculate vertex normals?
It takes the normal from the original smooth NURBS surface that the polygon was created from. When those normals are then used for rendering, it makes the polygon shading look the same as the original NURBS surface, regardless of whether the polygons are pretty rough or have some kind of non-uniform topology.
> - How does Blender calculate vertex normals?
Blender does not have the original NURBS surface data available to it, so it calculates vertex normals just by averaging all the flat polygon face normals of the polygons that share that vertex.
Since that normal is dependent just on the faceted polygon data, it is sensitive to things like the arrangement of polygons, things like long polygons next to short ones will kind of have equal weight on the averaging, sort of stretching the influence of the short polygon on the normal's position and basically leaving some hints of the polygon structure in the shading, since the shaded appearance is only being derived from polygons in that case and not from the actual smooth NURBS surface.
> - And does the calculation only differ for certain shapes,
> such as spheres vs cubes? Or curves vs flat surfaces? Or
> does the calculation differ for all object shapes?
Well, it doesn't differ for objects only made out of flat faces like a box or something like a faceted diamond shape, because those shapes are described exactly by the planar polygon facets.
But once you have some curved pieces in your model, the polygons are no longer exactly describing the curved surface, they're just some approximation of the ideal curved surface. That's when you'll see a difference.
It will be particularly noticeable with mechanical type models where you may have a mix of small and large polygons created in the output. In an organic polygon model where all the polygons are of the same shape and very evenly distributed it is not as noticeable because there isn't any areas in the model that have a sudden shift in shape like you have with a mechanical model.
> - Finally, is there a way that Blender could calculate the
> correct vertex normals from the information that it has?
No, because it doesn't have the NURBS surface data available to it - the NURBS data is basically the master definition of the model that contains its exact shape and therefore also generates exact shading normals.
One thing you can do is to try to produce a mesh that has more evenly sized and regularly spaced polygons in it, by using the "Divide larger than" setting when exporting, because if your polygons are all of the same general size it helps to make the shading glitches more localized to smaller zones and less noticeable.
However, in general for rendering mechanical CAD data is very important for the vertex normals that are stored in the file to be used for shading it, to ensure that your rendering looks the same as the actual original NURBS model. When they are used, it results in basically a perfect shading with no glitches of any kind. When they are not used you will not get the same shading as your original model.
- Michael