From Björn Hein, "it seems that for generating "per vertex normals" as stated in the

comment, two of them are missing. This results in wrong display of
STL-files regarding normals. Following simple fix seems to work:

Index: ReaderWriterSTL.cpp
===================================================================
--- ReaderWriterSTL.cpp    (Revision 13797)
+++ ReaderWriterSTL.cpp    (Arbeitskopie)
@@ -108,6 +108,8 @@
                     ++itr)
                 {
                     perVertexNormals->push_back(*itr);
+                    perVertexNormals->push_back(*itr);
+                    perVertexNormals->push_back(*itr);
                 }

                 geom->setNormalArray(perVertexNormals.get(),
osg::Array::BIND_PER_VERTEX);
"
This commit is contained in:
Robert Osfield
2013-10-02 11:09:29 +00:00
parent 59caf4a48e
commit 60d4b71d2b

View File

@@ -108,6 +108,8 @@ private:
++itr)
{
perVertexNormals->push_back(*itr);
perVertexNormals->push_back(*itr);
perVertexNormals->push_back(*itr);
}
geom->setNormalArray(perVertexNormals.get(), osg::Array::BIND_PER_VERTEX);