Giering Joseph wrote on Saturday, October 03, 2009 9:26 AM:
> I have a problem to load a model by using this code:
>
> // load model
> osg::Node* pLoadedModel = osgDB::readNodeFile(
> "C:\Programme\ADTF\2.1.1\lib\OpenSceneGraph-2.6.1\bin\tour.obj" );
> if(!pLoadedModel) {
> std::cout << "Error: Couldn't find model!" << std::endl;
> }
> m_pTransform->addChild(pLoadedModel);
> GetRoot()->addChild(m_pTransform.get());
>
> The readNodeFile can't find the tour object-file. Where needs the file
to be
> stored? Must I compile the obj-plugin? How Can I compile this plugin?
In C and C++, you need to escape back-slashes within strings using
additional back-slashes, like so:
osg::Node* pLoadedModel =
osgDB::readNodeFile("C:\\Programme\\ADTF\\2.1.1\\lib\\OpenSceneGraph-2.6
.1\\bin\\tour.obj" );
I think using forward slashes instead (which don't need to be escaped)
would work as well.
HTH,
--
Bryan Thrall
FlightSafety International
[email protected]
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org