Hi:
We're trying to load an osg model from an stream. We got the code like this
membuf sb((char *)Data, Size);
std::istream stream(&sb);
osgDB::ReaderWriter* reader =
osgDB::Registry::instance()->getReaderWriterForExtension("osg");
if(reader)
{
osgDB::ReaderWriter::ReadResult rr = reader->readNode(stream,0);
if(rr.success())
{
osg::Node *new_model = new osg::Node(*rr.getNode());
return new_model;
}
}
return NULL;
Its seems to load as it should. Rr is successfull but when I try to
add the node to a treenode I didn't saw it on screen. If I change the
code before for the code to load it from disk It works perfectly. Any
idea? There are a problem with the plugin of osg file when a stream is
used to read the node?
Regards from Canary Islands
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org