Nick Prudent a écrit :
> David, 
>
> Let me get this straight: you want to read models that are already in memory? 
> What did you use to load them in memory in the first place? If you have a lot 
> of models in formats supported by OSG, it should not be a problem. 
>   
David is maybe trying to implement an encryption pseudo-loader or 
something . Am I right ?
If so, then you can subclass an osgDB::ReaderWriter, then within the
                virtual ReadResult readImage(std::istream& in,const 
Options* options =NULL) const
                {
                   // process the stream and provide a new processed 
stream ( a stringstream for instance )
                   std::stringstream decryptionBuffer ;
                   ...
                   // get a reader writer
                    ReaderWriter* rwOSG = 
Registry::instance()->getReaderWriterForExtension("osg");
                   //  then apply it to the new processed stream
                   return 
rwOSG->readImage(decryptionBuffer,local_opt.get());
               }

> Anyone correct me if I'm wrong, but there's only one way to read file: 
> osgDB::readNodeFile(..) group of functions. You can also stream from the web, 
> but I guess this is not what you want.
>
>   
He could also create the ReaderWriter with the Registry mechanism and 
apply it to a memory stream as shown above.

Rémy
>> I have a lot of 3d models, but I want save these models in database, then I 
>> read the models , not in the local file. But I did not find the function to 
>> read or parse the 3d model from memory. I know my models' file 
>> format(3ds/OpenFlight...). did I must save the model to local disk first?
>> Thanks!
>> ________________________________
>> 网 易 Yeah.net 免 费 邮 箱 全 新 改 版,珍 藏 帐 号 开 放,快 来 抢 注 >>
>>     
-- 
Remy Deslignes

Ingenieur Developement / Software Engineer 

Tel: +33 (0)1.53.90.11.19

===========================================
 Silicon Worlds S.A.
 224, rue Saint Denis
 75002 Paris  France
 Tel: +33 (0)1.53.90.11.11
 Fax: +33 (0)1.53.90.11.12
 http://www.silicon-worlds.fr
=========================================== 


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to