[osg-users] Loading Models from byte array

2010-02-22 Thread Oleg Shistik
Hi,

I am new QSG user. I am trying to load the model from externally created 
buffer. I have the .IVE file loaded int .NET byte [] buffer. I can easy convert 
it into unmanaged, C type array (void*). I attempted to create std::string with 
my data inside and passed it to the ReaderWriter readNode method. Unfortunately 
that did not work. I am getting invalid osg::Node.

Maybe anybody knows if it is the right direction or I should look for another 
way to load model from byte array.

Any help is very appreciated.

Thank you!

Cheers,
Oleg

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=24550#24550





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


Re: [osg-users] Loading Models from byte array

2010-02-22 Thread Chris 'Xenon' Hanson
On 2/21/2010 3:33 AM, Oleg Shistik wrote:
 I am new QSG user. I am trying to load the model from externally created 
 buffer. I have the .IVE file loaded int .NET byte [] buffer. I can easy 
 convert it into unmanaged, C type array (void*). I attempted to create 
 std::string with my data inside and passed it to the ReaderWriter readNode 
 method. Unfortunately that did not work. I am getting invalid osg::Node.

  Ok. You don't really say WHY you're trying to do it this way -- often what 
you regard as
a problem is just not doing it the intended way. Maybe if you told us the 
goal, we could
suggest an easy way to get there that doesn't even involve the technique (and 
problem)
you're currently faced with.

 Maybe anybody knows if it is the right direction or I should look for another 
 way to load model from byte array.

  I don't think ReadNode can read from a byte array. I think it wants something 
that looks
like a filestream. If you're familiar with C++, I think you could use the 
stringstream
classes to create somethign that looks and behaves like a file/stream from your 
byte
array, and possibly pass that to ReadNode. I'd have to go look at the readnode 
prototypes
to see if this is possible.

 Any help is very appreciated.
 Thank you!
 Cheers,
 Oleg

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Loading Models from byte array

2010-02-22 Thread Oleg Shistik
Hi Chris,

Thanks you for your response. You are right, I used the istringstream class and 
it works fine.
I am working with byte arrays because actually I don't have files. The data 
comes from the server as a byte array and I passing it directly to the OSG.
... 

Thank you!

Cheers,
Oleg

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=24647#24647





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