Hello OSG users,

I extract geometries from the scene graph and perform some line intersections 
directly on them. If there are some transformations above in the tree then the 
intersections will not take them into account. I'd like to use 
osgUtil::Optimizer::FLATTEN_STATIC_TRANSFORMS so that the geometries are 
flattened and the intersections work on the transformed/flattened geometries. 
So I do:

// Create a node visitor to set all transforms to static in scene.

// Optimize
osgUtil::Optimizer optimzer;
optimzer.optimize(pScene.get(), osgUtil::Optimizer::FLATTEN_STATIC_TRANSFORMS |
                                           osgUtil::Optimizer::MERGE_GEOMETRY |
                                           osgUtil::Optimizer::CHECK_GEOMETRY |
                                           
osgUtil::Optimizer::MAKE_FAST_GEOMETRY);

// Gather geometries.

// Do intersections.

When I do this the geometries look transformed/flattened but the line 
intersections do not. However, if I write / read the scene to disk before I 
gather geometries then the intersections are good (transformation/flattened):

// Optimize
// ...

osgDB::writeNodeFile(*pScene.get(), "tmp.osg");
pScene = osgDB::readNodeFile("tmp.osg");

// ...

I'd rather not do that ! What am I missing here ??!


cheers,


bill

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

Reply via email to