diff --git a/src/osgPlugins/lib3ds/ReaderWriter3DS.cpp b/src/osgPlugins/lib3ds/ReaderWriter3DS.cpp index 0c086a78c..c2dfbeb47 100644 --- a/src/osgPlugins/lib3ds/ReaderWriter3DS.cpp +++ b/src/osgPlugins/lib3ds/ReaderWriter3DS.cpp @@ -391,7 +391,9 @@ osg::GeoSet* ReaderWriter3DS::createGeoSet(Lib3dsMesh *m,FaceList& faceList) // normalize the normal list to unit length normals. for (i=0; isetNormals(osg_normals,osg_indices); diff --git a/src/osgUtil/SmoothingVisitor.cpp b/src/osgUtil/SmoothingVisitor.cpp index e43e6b135..87f476a7e 100644 --- a/src/osgUtil/SmoothingVisitor.cpp +++ b/src/osgUtil/SmoothingVisitor.cpp @@ -119,7 +119,8 @@ void SmoothingVisitor::smooth(osg::GeoSet& gset) for(j = 0; j < ncoords; j++ ) { - norms[j].normalize(); + float len = norms[j].length(); + if (len) norms[j]/=len; } gset.setNormalBinding(osg::GeoSet::BIND_PERVERTEX);