[osg-users] [how to]control the content of saved .osg file?
Hi, I am working on a multi-texture issue, and confused about how to save the result: The Process is simple, I read a model from .osg or .ive file, then set a new texture unit 1 to it, so it bleng with the model's original texture. While test on the standard "cow.osg", saved new.osg contain all infos I need, like "textureUnit 1" "TexEnvCombine" "ColorArray" etc While test on a terrain.ive file(which created from vpb), the new.osg file only contain some basic infos without "textureUnit 1" "ColorArray" etc Any direction about the reason of the difference will be great helpful ^^ ... Thank you! Cheers, Cao -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47561#47561 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Building JNI wrapper for OSGdem
Hi Sean, We have made lot of JNI stuff in osgVirtualPlanets. Is a the GIS library for gvSIG3D that we developed. svn co https://devel.gvsig.org/svn/osgvp/trunk The wrappers are inside wrappers directory. Is not exactly what are you looking for, but maybe you find inspiration in the code. Cheers, Rafa. 2012/5/5 Sean K : > I am looking to build a Java wrapper with JNI around the code which > basically exists inside of osgdem.cpp. > > The bulk of that code resides in vpb.dll and osgDB.dll. > > Anybody tried this? I am guessing others have already done this. > > I also want to send back the console output back to the java caller > via a java callback > > basically, > > if I wrote a JNI class named OsgDem.java > > I would write code my OsgDemTest.java like this: > > class MyOsgHandler implements OsgHander { > > @Override > void OnStatus (String output) { > System.out.println(output); > } > > @Override > void OnEnd (boolean success, String resultMsg) { > if (success) { > System.out.println("good"); > } else { > System.out.println("bad"); > } > } > } > > @Test > public void testOsgdem() { > > Properties global = new Properties(); > > global.load("osgdem.properties"); > OsgDem generator = new OsgDem(global); > generator.start(handler, inputTerrainPath, > inputTexturePath, outputFilePath); > > } > > > Anybody have any JNI code that I can start with to build my OsdDem? > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Rafael Gaitán Linares CTO at Mirage Technologies S.L - http://www.mirage-tech.com gvSIG3D Developer - http://gvsig3d.blogspot.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Building JNI wrapper for OSGdem
I am looking to build a Java wrapper with JNI around the code which basically exists inside of osgdem.cpp. The bulk of that code resides in vpb.dll and osgDB.dll. Anybody tried this? I am guessing others have already done this. I also want to send back the console output back to the java caller via a java callback basically, if I wrote a JNI class named OsgDem.java I would write code my OsgDemTest.java like this: class MyOsgHandler implements OsgHander { @Override void OnStatus (String output) { System.out.println(output); } @Override void OnEnd (boolean success, String resultMsg) { if (success) { System.out.println("good"); } else { System.out.println("bad"); } } } @Test public void testOsgdem() { Properties global = new Properties(); global.load("osgdem.properties"); OsgDem generator = new OsgDem(global); generator.start(handler, inputTerrainPath, inputTexturePath, outputFilePath); } Anybody have any JNI code that I can start with to build my OsdDem? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Away on a trip for week
Hi All, I'm heading away for a one week business trip in Montreal, Canada, I'll be back at base and catching up with community on Monday 14th May. Have fun! Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgvolume brightness and sample density
HI Clement, On 4 May 2012 19:30, wrote: > Thanks again for your reply. I am a bit confused on using color map. I > would like my program to support at least 8 bit color, so how should I create > the color map? Where can I find more information? osgvolume.cpp does not > have much details related to color map. You just assign colours to the TransferFunction1D. Go have a look at the API, the osgvolume.cpp provides code that does it. This stuff should be realtively straightforward to infer from the code you have in front of you. If you are struggling then perhaps it's time you went back to basics a bit more w.r.t OpenGL and C++ as none of this is particular advanced. I'm happy to point you in the right direction, but it's really not my place to teach you how to program computer graphics applications. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgvolume brightness and sample density
Hi Robert, Thanks again for your reply. I am a bit confused on using color map. I would like my program to support at least 8 bit color, so how should I create the color map? Where can I find more information? osgvolume.cpp does not have much details related to color map. All layers are undersampled. I think I need to adjust the sample density if only first layer display. Regards, Clement From: osg-users-boun...@lists.openscenegraph.org [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield [robert.osfi...@gmail.com] Sent: Friday, 4 May 2012 7:09 PM To: OpenSceneGraph Users Subject: Re: [osg-users] osgvolume brightness and sample density Hi Clement, On 4 May 2012 08:46, wrote: > Hi Robert, > >Sorry, I just saw your reply. Is TransferFunctionProperty used for > defined colour map? > >osg::ref_ptr transferFunction = new > osg::TransferFunction1D; >transferFunction->setColor(0.0, osg::Vec4(1.0,0.0,0.0,0.0)); >transferFunction->setColor(0.5, osg::Vec4(1.0,1.0,0.0,0.5)); >transferFunction->setColor(1.0, osg::Vec4(0.0,0.0,1.0,1.0)); > >transferFunction->assign(transferFunction->getColorMap()); >osg::ref_ptr tfp = new > osgVolume::TransferFunctionProperty(transferFunction.get()); > >osg::ref_ptr cp = new > osgVolume::CompositeProperty; >layer->addProperty(cp.get()); >cp->addProperty(tfp.get()); > > > If I don't use TransferFunctionProperty, I guess osg will use default > colour map. Then I no need to create another colour map. Is that correct? If you don't use a TransferFunctionProperty then the intensity or colours coming from the Texture3D (sourced from the osgVolume::ImageLayer) will be used directly, there isn't any default colour map. > For example, the size of my volume cube is 100 * 100 * 50. If I show the > first layer (100 * 100 * 1), the colour from the back view is more brightness > than from the front view. I am not understand why it is related to > TransferFunctionProperty. The colour brightness is affected by adjusting the > SampleDensityProperty value. If your data is undersampled then it won't be as bright as it would be if the ray casting take sufficient samples to properly map your volume. > I have more question about performance. If the image is showed the first > layer, the performance is the same as showing all layers (100 * 100 * 50). > Is any possible way to increase the rendering speeding when only first layer > is shown? Many thanks. When you say layer, do you simply mean a slice of an 3D osg:Image? In osgVolume the Layer class represent as whole 3D image. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Loading OSG resources from Qt QResource system
Hi zonk, Ah okay. That worked. Thanks a bunch. Cheers, Braden -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47554#47554 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How do I create a 2D HUD with loaded images?
Hi, I'm trying to create a HUD using images instead of solid color rectangles, unfortunately the examples did not show how this could be done and I can't find any information on this function which I assumed would be often used. I've tried adding a texture to the nodes that are used in the creation of the usual solid color rectangles, but none of it seemed to do anything. In what kind of direction should I be thinking? Thank you! Cheers, Mark -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47553#47553 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] [Tutorial] Building osgAndroidExampleGLES1/2 on Ubuntu 11.10
The emulator, at least in Ubuntu, isn't reliable enough to execute OpenGL ES code. OSG doesn't work in emulated devices. I've not checked in windows. 2012/5/4 Akilan Thangamani > compiled osg3.0.1 for android for GLES1. I seleceted avd of Android2.2 > with API level of 8. There is no problem in starting the emulator.fine. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Can OSG be used on qnx os?
Hi Xiaofeng, On 4 May 2012 09:42, Xiaofeng Yang wrote: > I don't know whether osg can be used on qnx or not? > Is there someone who have compiled the osg on qnx? Several years back the OSG with OpenGL ES had been compiled and used with QNX, the group doing this work used their own Makefile and haven't published them. I don't know the current status about how easily current rev of the OSG will work under QNX, I wouldn't expect any great problems. The key issue would be getting the build system up and running. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgvolume brightness and sample density
Hi Clement, On 4 May 2012 08:46, wrote: > Hi Robert, > > Sorry, I just saw your reply. Is TransferFunctionProperty used for > defined colour map? > > osg::ref_ptr transferFunction = new > osg::TransferFunction1D; > transferFunction->setColor(0.0, osg::Vec4(1.0,0.0,0.0,0.0)); > transferFunction->setColor(0.5, osg::Vec4(1.0,1.0,0.0,0.5)); > transferFunction->setColor(1.0, osg::Vec4(0.0,0.0,1.0,1.0)); > > transferFunction->assign(transferFunction->getColorMap()); > osg::ref_ptr tfp = new > osgVolume::TransferFunctionProperty(transferFunction.get()); > > osg::ref_ptr cp = new > osgVolume::CompositeProperty; > layer->addProperty(cp.get()); > cp->addProperty(tfp.get()); > > > If I don't use TransferFunctionProperty, I guess osg will use default > colour map. Then I no need to create another colour map. Is that correct? If you don't use a TransferFunctionProperty then the intensity or colours coming from the Texture3D (sourced from the osgVolume::ImageLayer) will be used directly, there isn't any default colour map. > For example, the size of my volume cube is 100 * 100 * 50. If I show the > first layer (100 * 100 * 1), the colour from the back view is more brightness > than from the front view. I am not understand why it is related to > TransferFunctionProperty. The colour brightness is affected by adjusting the > SampleDensityProperty value. If your data is undersampled then it won't be as bright as it would be if the ray casting take sufficient samples to properly map your volume. > I have more question about performance. If the image is showed the first > layer, the performance is the same as showing all layers (100 * 100 * 50). > Is any possible way to increase the rendering speeding when only first layer > is shown? Many thanks. When you say layer, do you simply mean a slice of an 3D osg:Image? In osgVolume the Layer class represent as whole 3D image. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Can OSG be used on qnx os?
Hi everyone here, I don't know whether osg can be used on qnx or not? Is there someone who have compiled the osg on qnx? Thank you! Cheers, Xiaofeng -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47549#47549 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] [Tutorial] Building osgAndroidExampleGLES1/2 on Ubuntu 11.10
Hi I compiled osg3.0.1 for android for GLES1. I seleceted avd of Android2.2 with API level of 8. There is no problem in starting the emulator.fine. I also compiled osgAndroidExampleGLES1 without any issue on eclipse. Running the application throws the following error, 05-04 05:38:01.375: D/libEGL(275): egl.cfg not found, using default config 05-04 05:38:01.375: D/libEGL(275): loaded /system/lib/egl/libGLES_android.so 05-04 05:38:01.385: W/EGLview(275): creating OpenGL ES 1 context 05-04 05:38:01.405: W/dalvikvm(275): threadid=7: thread exiting with uncaught exception (group=0x4001d800) 05-04 05:38:01.405: E/AndroidRuntime(275): FATAL EXCEPTION: GLThread 8 05-04 05:38:01.405: E/AndroidRuntime(275): java.lang.IllegalArgumentException 05-04 05:38:01.405: E/AndroidRuntime(275): at com.google.android.gles_jni.EGLImpl._eglCreateContext(Native Method) 05-04 05:38:01.405: E/AndroidRuntime(275): at com.google.android.gles_jni.EGLImpl.eglCreateContext(EGLImpl.java:50) 05-04 05:38:01.405: E/AndroidRuntime(275): at osg.AndroidExample.EGLview$ContextFactory.createContext(EGLview.java:103) 05-04 05:38:01.405: E/AndroidRuntime(275): at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:922) 05-04 05:38:01.405: E/AndroidRuntime(275): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1246) 05-04 05:38:01.405: E/AndroidRuntime(275): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116) I like to know what went wrong Thanks -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47548#47548 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgvolume brightness and sample density
Hi Robert, Sorry, I just saw your reply. Is TransferFunctionProperty used for defined colour map? osg::ref_ptr transferFunction = new osg::TransferFunction1D; transferFunction->setColor(0.0, osg::Vec4(1.0,0.0,0.0,0.0)); transferFunction->setColor(0.5, osg::Vec4(1.0,1.0,0.0,0.5)); transferFunction->setColor(1.0, osg::Vec4(0.0,0.0,1.0,1.0)); transferFunction->assign(transferFunction->getColorMap()); osg::ref_ptr tfp = new osgVolume::TransferFunctionProperty(transferFunction.get()); osg::ref_ptr cp = new osgVolume::CompositeProperty; layer->addProperty(cp.get()); cp->addProperty(tfp.get()); If I don't use TransferFunctionProperty, I guess osg will use default colour map. Then I no need to create another colour map. Is that correct? For example, the size of my volume cube is 100 * 100 * 50. If I show the first layer (100 * 100 * 1), the colour from the back view is more brightness than from the front view. I am not understand why it is related to TransferFunctionProperty. The colour brightness is affected by adjusting the SampleDensityProperty value. I have more question about performance. If the image is showed the first layer, the performance is the same as showing all layers (100 * 100 * 50). Is any possible way to increase the rendering speeding when only first layer is shown? Many thanks. Regards, Clement From: osg-users-boun...@lists.openscenegraph.org [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield [robert.osfi...@gmail.com] Sent: Wednesday, 25 April 2012 2:30 AM To: OpenSceneGraph Users Subject: Re: [osg-users] osgvolume brightness and sample density Hi Clement, You simply need to attach a TransferFunctionProperty to the Layer assigned VolumeTile and set up this to map floating point intensity value to the colour/alpha value required. The osgvolume has example of it's setup. Robert. On 12 April 2012 03:52, wrote: > Hi, > > I am using osgVolume to display my CT data. If I set the value of > SampleDensityProperty lower, I can get more details, but the brightness will > become darker or dull. Does any method that allow to use smaller value of > SampleDensityProperty and keep image colour brighter. I tried to use > LightingProperty, but I don't know why I got an error to have this property. > > > Regards, > Clement > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] IllegalArgumentException?
Hi I compiled osg3.0.1 for android for GLES1. I seleceted avd of Android2.2 with API level of 8. There is no problem in starting the emulator.fine. I also compiled osgAndroidExampleGLES1 without any issue on eclipse. Running the application throws the following error, 05-04 05:38:01.375: D/libEGL(275): egl.cfg not found, using default config 05-04 05:38:01.375: D/libEGL(275): loaded /system/lib/egl/libGLES_android.so 05-04 05:38:01.385: W/EGLview(275): creating OpenGL ES 1 context 05-04 05:38:01.405: W/dalvikvm(275): threadid=7: thread exiting with uncaught exception (group=0x4001d800) 05-04 05:38:01.405: E/AndroidRuntime(275): FATAL EXCEPTION: GLThread 8 05-04 05:38:01.405: E/AndroidRuntime(275): java.lang.IllegalArgumentException 05-04 05:38:01.405: E/AndroidRuntime(275): at com.google.android.gles_jni.EGLImpl._eglCreateContext(Native Method) 05-04 05:38:01.405: E/AndroidRuntime(275): at com.google.android.gles_jni.EGLImpl.eglCreateContext(EGLImpl.java:50) 05-04 05:38:01.405: E/AndroidRuntime(275): at osg.AndroidExample.EGLview$ContextFactory.createContext(EGLview.java:103) 05-04 05:38:01.405: E/AndroidRuntime(275): at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:922) 05-04 05:38:01.405: E/AndroidRuntime(275): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1246) 05-04 05:38:01.405: E/AndroidRuntime(275): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116) I like to know what went wrong Thanks -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47545#47545 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org