Jad Killian
2018-07-27 12:06:29 UTC
Hi,
When I import a .obj file with readNodeFile, the result is a triangle strip instead of triangles. Even if the .obj file is a simple square with 4 vertices and 2 triangular faces, the resulting primitive set in the geode geometry contains
1 face, 4 indices with mode = 5 (TRIANGLE_STRIP).
I tried using the osg::Optimizer, but it doesn't seem to do anything:
Code:
osg::ref_ptr<osg::Node> node = osgDB::readNodeFile(filepath.toStdString());
osgUtil::Optimizer optimizer;
optimizer.optimize(node, osgUtil::Optimizer::INDEX_MESH);
for optimizer flags I tried INDEX_MESH, TESSELLATE_GEOMETRY, DEFAULT_OPTIMIZATIONS, nothing seems to work.
Any ideas?
Thanks
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74401#74401
When I import a .obj file with readNodeFile, the result is a triangle strip instead of triangles. Even if the .obj file is a simple square with 4 vertices and 2 triangular faces, the resulting primitive set in the geode geometry contains
1 face, 4 indices with mode = 5 (TRIANGLE_STRIP).
I tried using the osg::Optimizer, but it doesn't seem to do anything:
Code:
osg::ref_ptr<osg::Node> node = osgDB::readNodeFile(filepath.toStdString());
osgUtil::Optimizer optimizer;
optimizer.optimize(node, osgUtil::Optimizer::INDEX_MESH);
for optimizer flags I tried INDEX_MESH, TESSELLATE_GEOMETRY, DEFAULT_OPTIMIZATIONS, nothing seems to work.
Any ideas?
Thanks
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74401#74401