[osg-users] why geode==null,please read my following codes.Thanks。

Thrall, Bryan bryan.thrall at flightsafety.com
Tue Nov 17 08:26:02 PST 2009


Xiao Han wrote on Tuesday, November 17, 2009 10:13 AM:
> How can I get group's geodes? Thanks.

The best way is to create a subclass of osg::NodeVisitor and override the visit(osg::Geode) function. There are lots of examples that do this, such as the osgcallback example.

> Wang Rui wrote:
>> Hi Xiao Han,
>> 
>> Check the root of 'road_deming.ive' first, is it really a geode?
>> 
>> Cheers,
>> Wang Rui
>> 
>> 
>> 2009/11/17 Xiao Han < ()>
>> 
>>> Hi,everyone,
>>> 
>>> Please why gn==null in following codes?
>>> 
>>> "
>>>                osgViewer::Viewer* viewer=new osgViewer::Viewer();
>>>        osg::Group*root= new osg::Group();
>>>        osg::Node*node=new osg::Node();
>>>        node=osgDB::readNodeFile("road_demimg.ive");//cow.osg");
>>>        osg::Geode* gn=dynamic_cast<osg::Geode*>(node); "
>>> Thank you!
>>> 
>>> Cheers,
>>> Xiaohan


-- 
Bryan Thrall
FlightSafety International
bryan.thrall at flightsafety.com


More information about the osg-users mailing list