[osg-users] Convert a node into byte array, serialize a node?

2012-06-07 Thread James Lue
Hi, I want to send a geometry or a node to other computer via socket. Some people suggest serialization and de-serialization, but I'm not sure how exactly to do so. Can someone giva me a hint? Right now I think I can write the node by osgDB::writeNodeFile and read the file as a byte array

Re: [osg-users] Convert a node into byte array, serialize a node?

2012-06-07 Thread James Lue
Rafa Gaitan wrote: Hi James, I did something similar, and is easy, but you need to use the ReaderWriter API, that supports serialization to a stream. Here is my code: void IOSocket::writeObject( const osg::Object* obj) {     OpenThreads::ScopedLockOpenThreads::Mutex lock(_rwMutex);  

[osg-users] fail to read image by osgDB in Android

2012-04-30 Thread James Lue
Hi, I want to load an image as my texture image in Android. I just tried to load a jpg image from sdcard by OSG, but it always fails. Here is my code: osg::ref_ptrosg::Image img=osgDB::readImageFile(/mnt/sdcard/data/img.jpg); if(!img) __android_log_write(ANDROID_LOG_ERROR,Load Image,Not Loaded);

Re: [osg-users] fail to read image by osgDB in Android

2012-04-30 Thread James Lue
Jorge Izquierdo Ciges wrote: It can be two things... A) You need the jpg plugin (which is not by default) B) You've written wrong the address to the file 2012/4/30 James Lue () -- Post generated by Mail2Forum Thank you Jorge! Yes I need to add USE_OSGPLUGIN(jpeg

Re: [osg-users] [forum] OSG on Android

2012-04-29 Thread James Lue
amidofu wrote: Hi, I currently wrote code to use OSG on android, right now I basically just try to do something similar but simpler to the osgAndroidExampleES1. Right now I can show the blue screen, but no geometry is rendered ( I use OpenGLES1.x). My root node does have children (I

[osg-users] [forum] OSG on Android

2012-04-28 Thread James Lue
Hi, I currently wrote code to use OSG on android, right now I basically just try to do something similar but simpler to the osgAndroidExampleES1. Right now I can show the blue screen, but no geometry is rendered ( I use OpenGLES1.x). My root node does have children (I print out the number of