adlnet-archive / 3D-Repository

The ADL 3D Repository is a website for uploading, finding, and downloading 3D models.
25 stars 16 forks source link

Normals in Sketchup Parser #10

Closed rchadwic closed 12 years ago

rchadwic commented 12 years ago

Sketchup parser generates crazy normals.

rchadwic commented 12 years ago

Having hard time with this - temporary workaround - manually creating normals. will result in tessellated surfaces.

rchadwic commented 12 years ago

Made some good progress. Previously, I was creating an osg::Geode for each "polygon" in the skp file. This worked fine for small files, but was crazy for 100,000 faces. Turns out all the polygons are triangles - so I've updated the parser to collect all triangles from faces with matching materials into long triangle lists. Much much more efficient. Normals were being destroyed by the osg::Optimizer when the transform stack has mirrored matrices - remove a flag from the optimizer. Might be slightly less efficient, but we do have to have normals on skp.... Seems to work well, but older files not working. Seems to be related to json parse, not skp conversion. New skp examples work great. Also, updated to newest SKP SDK, now can parse Version 8 files. Checked into SVN repo for 3D tools, not in GIT yet.