[osg-users] osgUtil::Optimizer::MergeGeometryVisitor

68 views
Skip to first unread message

Poirier, Guillaume

unread,
Feb 2, 2011, 2:17:48 PM2/2/11
to osg-...@openscenegraph.org

Hello OSG community !

 

Just a quick question on the MergeGeometryVisitor. What is it supposed to do exactly ? My expectation is that it will merge all geometry drawables of a geode into one ? I created and exported a simple cube in 3DSMax. The file has one geode and 6 drawables, one for each face.

 

osg::ref_ptr<osg::Node> pScene = osgDB::readNodeFile("cube.3ds");

// create a geode and add all pScene geometries to it as drawables

// [...]

 

// attempt to merge geometries

pScene = 0;

osgUtil::Optimizer::MergeGeometryVisitor mgv;

mgv.setTargetMaximumNumberOfVertices(1000000);

mgv.mergeGeode(*createdGeode.get());

 

At this point the createdGeode still has 6 drawables... It looks like the mergeGeode() function can only return false, which is not very helpful,

and does not really tell you if there is a problem with the input and what it might be. It seems that  geometryContainsSharedArrays() returns true for all my geometries, which might be why it does not do what I want.

 

So, is it my expectation of what the MergeGeometryVisitor does that is erroneous ? It does not like my input somehow ?

 

Anyone has an idea or suggestion ?

 

 

cheers !

 

 

bill

 

Robert Osfield

unread,
Feb 3, 2011, 3:57:54 AM2/3/11
to OpenSceneGraph Users
Hi Bill,

You can only merge Geometry objects that share the same type of array
usage and bindings.

Robert.

> _______________________________________________
> osg-users mailing list
> osg-...@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply all
Reply to author
Forward
0 new messages