Fixed then normal smoothing function in the .3ds loader and the
osgUtil::SmoothingVisitor so that unused normals at left at 0,0,0 insead of being normalized, which results in (nan,nan,nan).
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user