Re: [osg-users] Error: Not able to create requested visual. for osg application utilizing multi-sampling, ran with optirun.
This might be simply a driver limitation. Not all hardware and drivers support multisampling. For example, I'm using OSG on Mesa + Intel HD Graphics which doesn't support multisampling at all. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64858#64858 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How to convert bounding box to position and scale?
Hi. I want to convert bounding box to position and scale of a box. I tried to do it, but I couldn't get it right. Can anyone share the formula? Thanks. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to convert bounding box to position and scale?
Turned out, I used non-centered box to display the bounding box. Fixed it. 2015-08-21 8:04 GMT+07:00 michael kapelko korn...@gmail.com: Hi. I want to convert bounding box to position and scale of a box. I tried to do it, but I couldn't get it right. Can anyone share the formula? Thanks. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Vec3Array Deep Copy
Hi Robert, Thanks again. You da man. Erik robertosfield wrote: HI Erik, The constructor takes a reference not a pointer so try: osg::ref_ptr osg::Vec3Array pCopy = new osg::Vec3Array(*pVertexArray, osg::CopyOp::DEEP_COPY_ALL); Noe the *. Or use osg::clone() i.e. pCopy = osg::clone(pVertexArray-get()); Robert. On 20 August 2015 at 18:30, Erik Hensens () wrote: Hi everyone! I have a simple question but I just can't figure it out. What is the proper way to copy a Vec3Array? The code below is not right: Code: osg::ref_ptr osg::Vec3Array pVertexArray = new osg::Vec3Array; ... osg::ref_ptr osg::Vec3Array pCopy = new osg::Vec3Array(pVertexArray, osg::CopyOp::DEEP_COPY_ALL); I get the compilation error below: Code: error : no matching function for call to 'osg::TemplateArray osg::Vec3f, (osg::Array::Type)28u, 3, 5126 ::TemplateArray(osg::ref_ptrosg::TemplateArray osg::Vec3f, (osg::Array::Type)28u, 3, 5126 , osg::CopyOp::Options)' Thanks very much for your help! Cheers, Erik -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64852#64852 (http://forum.openscenegraph.org/viewtopic.php?p=64852#64852) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64854#64854 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Vec3Array Deep Copy
HI Erik, The constructor takes a reference not a pointer so try: osg::ref_ptr osg::Vec3Array pCopy = new osg::Vec3Array(*pVertexArray, osg::CopyOp::DEEP_COPY_ALL); Noe the *. Or use osg::clone() i.e. pCopy = osg::clone(pVertexArray-get()); Robert. On 20 August 2015 at 18:30, Erik Hensens ehens...@hunter.com wrote: Hi everyone! I have a simple question but I just can't figure it out. What is the proper way to copy a Vec3Array? The code below is not right: Code: osg::ref_ptr osg::Vec3Array pVertexArray = new osg::Vec3Array; ... osg::ref_ptr osg::Vec3Array pCopy = new osg::Vec3Array(pVertexArray, osg::CopyOp::DEEP_COPY_ALL); I get the compilation error below: Code: error : no matching function for call to 'osg::TemplateArray osg::Vec3f, (osg::Array::Type)28u, 3, 5126 ::TemplateArray(osg::ref_ptrosg::TemplateArray osg::Vec3f, (osg::Array::Type)28u, 3, 5126 , osg::CopyOp::Options)' Thanks very much for your help! Cheers, Erik -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64852#64852 ___ 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] Vec3Array Deep Copy
Hi everyone! I have a simple question but I just can't figure it out. What is the proper way to copy a Vec3Array? The code below is not right: Code: osg::ref_ptr osg::Vec3Array pVertexArray = new osg::Vec3Array; ... osg::ref_ptr osg::Vec3Array pCopy = new osg::Vec3Array(pVertexArray, osg::CopyOp::DEEP_COPY_ALL); I get the compilation error below: Code: error : no matching function for call to 'osg::TemplateArray osg::Vec3f, (osg::Array::Type)28u, 3, 5126 ::TemplateArray(osg::ref_ptrosg::TemplateArray osg::Vec3f, (osg::Array::Type)28u, 3, 5126 , osg::CopyOp::Options)' Thanks very much for your help! Cheers, Erik -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64852#64852 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [ANN] View-dependent progressive meshes on OpenSceneGraph
Hello dear OSG-community, I've upgraded OpenSceneGraph to the newest version and refined cmake scripts to suit the newest version of cmake. https://github.com/kctan0805/vdpm Best regards, Jim -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64849#64849 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] LOS materail query
Hi, I am wanting to do a dust cloud when an entity (helicopter) lands on a terrain. Ideally, would like the color of the dust cloud to be similar to the material/texture that the entity is on. Is there a way to do a material/texture color query based on an entity position, kind of like an LOS intersector test? Thank you! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64857#64857 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Problems with MultiTouchTrackballManipulator on iOS.
Hi, recently I updated my apps from OSG 3.2.0 to OSG 3.4.0 and I noticed that the MultiTouchTrackballManipulator behaves differently. Specifically while single touches are working almost the same (for instance to rotate the view), the pinch gesture is quite different because even if I try to make a very small pinch, the model disappears suddenly. I checked that the near and far planes are correctly set, so maybe the problem must be somewhere else. Is there a 'speed' parameter that controls how much the gesture affects the manipulator? I am thinking about a 'speed' parameter because actually also the camera rotation controlled by the manipulator (single touch gesture) is either very slow or incredibly fast. Thank you. Alessandro -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64850#64850 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Advice on how to implement custom file format
Aaron, this sounds a lot like something I've worked with recently. If you want to get in touch with me privately and share more details on the format you are working with, I might be able to assist you more. On Sun, Aug 16, 2015 at 3:11 PM, Aaron Andersen aa...@fosslib.net wrote: Hello, I'm planning to render a custom (preexisting) map file format using osg and was looking for some guidance. I haven't been using osg for that long so I figure it is worth asking if there is either a way to adapt some existing code in the library to fit this custom format, or if not, what people might suggest as a good way to go about implementing loading and rendering this map file format with osg. The map is composed of individual 3d mesh tiles of variable size that are snapped together side by side somewhat similar to toy Lego blocks. Most mesh tiles are relatively small so there are a large number of these mesh tiles required to draw the map. As for the file format itself, the map is broken up spatially into many separate files (known as regions). I wish to write some code so that the map will be read into my application and populate the scene graph seamlessly so there won't need to be a loading screen every time the camera zooms to a new area of the map. The maps stored in this format are *way* too large to load into memory all at once, so I will need to stream data in as the camera approaches new areas and out as it leaves other areas, always keeping the scene graph up to date. I should mention that the map file format is a little peculiar in that none of the 3d mesh tiles have any absolute position information listed at all. Each and every mesh tile is placed relative to the an adjacent mesh tile. I can arbitrarily choose any mesh tile from a map file and place it at 0,0,0 and from there start placing adjacent tiles, and for each adjacent tile place the adjacent tiles, recursively over and over, to build up the map. I mention this placement peculiarity because it means that I can only ever know the absolute position of any mesh tile that is relatively close to the camera (ie. the area of the map I'm currently rendering). If any clarification is required please let me know and thank you kindly for any advice anyone can offer me. Aaron Andersen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Legal/IP • Code Forensics • Digital Imaging • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android @alphapixel https://twitter.com/alphapixel facebook.com/alphapixel (775) 623-PIXL [7495] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Error: Not able to create requested visual. for osg application utilizing multi-sampling, ran with optirun.
Hello, I'v been having trouble using optirun with the virtualgl rendering bridge, and an osg app utilizing multi-sampling. using this simple example(attached also): #include stdio.h #include stdlib.h #include osgViewer/Viewer #include osg/ShapeDrawable osg::Node* createScene() { osg::Geode* geode = new osg::Geode(); geode-addDrawable( new osg::ShapeDrawable( new osg::Cylinder(osg::Vec3(-2.0f,0.0f,-2.0f),1.5f,2.0f) ) ); geode-addDrawable( new osg::ShapeDrawable( new osg::Cylinder(osg::Vec3(2.0f,0.0f,-2.0f),1.5f,2.0f) ) ); geode-addDrawable( new osg::ShapeDrawable( new osg::Cylinder(osg::Vec3(2.0f,0.0f,2.0f),1.5f,2.0f) ) ); geode-addDrawable( new osg::ShapeDrawable( new osg::Cylinder(osg::Vec3(-2.0f,0.0f,2.0f),1.5f,2.0f) ) ); return geode; } int main(int argc, char* argv[]) { // construct the viewer osg::ref_ptrosgViewer::Viewer viewer = new osgViewer::Viewer; // full screen antialiasing (if supported) osg::DisplaySettings::instance()-setNumMultiSamples( 4 ); // make the viewer create a 512x512 window and position it at 32, 32 viewer-setUpViewInWindow( 32, 32, 512, 512 ); // set the scene-graph data the viewer will render viewer-setSceneData( createScene() ); // execute main loop return viewer-run(); } , as well as an actual app, like Flight Gear with multi-sampling enabled, would trigger an error such as: Error: Not able to create requested visual. GraphicsWindow has not been created successfully. if i used a primus rendering bridge(/usr/bin/optirun -b primus), or actually used the Nvidia driver without Optimus technology, the problem does not show. it only does show if i used an osg multi-sampled application using virtualgl as a rendering bridge for optirun, which is the default. i used GDB to troubleshoot the built example, the problem is that the main function is considered one frame, so a backtrace was useless, but i was able to narrow it down: breakpoint at line 27: (gdb) b 27 Breakpoint 1 at 0x40102d: file mutlisample.cpp, line 27. (gdb) run Starting program: /home/hamza/build/fgbuild/openscenegraph/src/multitest Traceback (most recent call last): File /usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py, line 63, in module from libstdcxx.v6.printers import register_libstdcxx_printers ImportError: No module named 'libstdcxx' [Thread debugging using libthread_db enabled] Using host libthread_db library /lib/x86_64-linux-gnu/libthread_db.so.1. Breakpoint 1, main (argc=1, argv=0x7fffdd48) at mutlisample.cpp:27 27 viewer-setUpViewInWindow( 32, 32, 512, 512 ); (gdb) bt #0 main (argc=1, argv=0x7fffdd48) at mutlisample.cpp:27 breakpoint at line 28: (gdb) b 28 Breakpoint 2 at 0x401060: file mutlisample.cpp, line 28. (gdb) run Starting program: /home/hamza/build/fgbuild/openscenegraph/src/multitest Traceback (most recent call last): File /usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py, line 63, in module from libstdcxx.v6.printers import register_libstdcxx_printers ImportError: No module named 'libstdcxx' [Thread debugging using libthread_db enabled] Using host libthread_db library /lib/x86_64-linux-gnu/libthread_db.so.1. Error: Not able to create requested visual. GraphicsWindow has not been created successfully. Breakpoint 2, main (argc=1, argv=0x7fffdd48) at mutlisample.cpp:30 30 viewer-setSceneData( createScene() ); (gdb) bt #0 main (argc=1, argv=0x7fffdd48) at mutlisample.cpp:30 any tips would be appreciated Thanks Hamza #include stdio.h #include stdlib.h #include osgViewer/Viewer #include osg/ShapeDrawable osg::Node* createScene() { osg::Geode* geode = new osg::Geode(); geode-addDrawable( new osg::ShapeDrawable( new osg::Cylinder(osg::Vec3(-2.0f,0.0f,-2.0f),1.5f,2.0f) ) ); geode-addDrawable( new osg::ShapeDrawable( new osg::Cylinder(osg::Vec3(2.0f,0.0f,-2.0f),1.5f,2.0f) ) ); geode-addDrawable( new osg::ShapeDrawable( new osg::Cylinder(osg::Vec3(2.0f,0.0f,2.0f),1.5f,2.0f) ) ); geode-addDrawable( new osg::ShapeDrawable( new osg::Cylinder(osg::Vec3(-2.0f,0.0f,2.0f),1.5f,2.0f) ) ); return geode; } int main(int argc, char* argv[]) { // construct the viewer osg::ref_ptrosgViewer::Viewer viewer = new osgViewer::Viewer; // full screen antialiasing (if supported) osg::DisplaySettings::instance()-setNumMultiSamples( 4 ); // make the viewer create a 512x512 window and position it at 32, 32 viewer-setUpViewInWindow( 32, 32, 512, 512 ); // set the scene-graph data the viewer will render viewer-setSceneData( createScene() ); // execute main loop return viewer-run(); } ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android osgPlugins
Hi, In the meanwhile, I was working further on the topic - and cracked it this time, I think. First and foremost, I use OpenSceneGraph 3.3.8 (still) and compile it for Android, while having the necessary 3rdParty-folder inside the OpenSceneGraph root folder (little suggestion: at some point this may be changed in the makefiles to search that folder by environment variable path, such as the data folder ...). I just define the GLES profile and the android platform and build it. Next: A) For generating the PREBUILT_STATIC_LIBRARY, I took a sip from the OpenCV recipe that defines a local mk-file function that builds each 3rd Party dependency for the android package. B) These local prebuilds are then referred to via LOCAL_WHOLE_STATIC_LIBRARIES, which is necessary so that the ndk-build linker finds all referred functions. That's the actual behaviour I kind'a expected in any case for a STATIC library (containing all content), bust as Jan pointed out: Android NDK - you'll never know what you get :D This way, it works for me now, as I can load osg.Image() within Android using a jpeg image, in order to texture a geometry. Manual and code submission are still on my agenda. The appended make file is afree-for-all to try out - just take the .txt extension away. Cheers, Christian -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64855#64855 LOCAL_PATH := $(call my-dir) OSG_SRC_FILES := \ JNIosgViewer.cpp \ JNIosg.cpp \ JNIosgDB.cpp \ JNIosgUtil.cpp \ JNIosgGA.cpp \ JNIUtils.cpp \ MultiViewNode.cpp \ GLES2ShaderGenVisitor.cpp OSG_LDLIBS := \ -losgdb_osg \ -losgdb_ive \ -losgdb_rgb \ -losgdb_bmp \ -losgdb_tga \ -losgdb_stl \ -losgdb_obj \ -losgdb_dxf \ -losgdb_curl \ -losgdb_gif \ -losgdb_jpeg \ -losgdb_openflight \ -losgdb_serializers_osgvolume \ -losgdb_serializers_osgtext \ -losgdb_serializers_osgterrain \ -losgdb_serializers_osgsim \ -losgdb_serializers_osgshadow \ -losgdb_serializers_osgparticle \ -losgdb_serializers_osgmanipulator \ -losgdb_serializers_osgfx \ -losgdb_serializers_osganimation \ -losgdb_serializers_osgui \ -losgdb_serializers_osgviewer \ -losgdb_serializers_osgga \ -losgdb_serializers_osgutil \ -losgdb_serializers_osg \ -losgdb_deprecated_osgwidget \ -losgdb_deprecated_osgviewer \ -losgdb_deprecated_osgvolume \ -losgdb_deprecated_osgtext \ -losgdb_deprecated_osgterrain \ -losgdb_deprecated_osgsim \ -losgdb_deprecated_osgshadow \ -losgdb_deprecated_osgparticle \ -losgdb_deprecated_osgfx \ -losgdb_deprecated_osganimation \ -losgdb_deprecated_osg \ -losgPresentation \ -losgWidget \ -losgUI \ -losgViewer \ -losgVolume \ -losgTerrain \ -losgText \ -losgShadow \ -losgSim \ -losgParticle \ -losgManipulator \ -losgGA \ -losgFX \ -losgDB \ -losgAnimation \ -losgUtil \ -losg \ -lOpenThreads \ -ltiff \ -ljpeg \ -lgif \ -lpng \ -lcurl #-losgdb_serializers_osgpresentation \ ### Static preparation OSG_SDK:=/media/christian/DATA/android-osg-sdk/gles1/${APP_ABI} OSG_3RDPARTY_LIBS_DIR:=${OSG_SDK}/obj/local/${APP_ABI} #THRD_PARTY_SRC:=/media/christian/DATA/3rdparty #THIRD_PARTY_HEADER_PATH:= OSG_3RDPARTY_COMPONENTS:=jpeg gif png tiff zlib curl define add_osg_3rdparty_component include $(CLEAR_VARS) LOCAL_MODULE:=$1 LOCAL_SRC_FILES:=$(OSG_3RDPARTY_LIBS_DIR)/lib$1.a include $(PREBUILT_STATIC_LIBRARY) endef $(foreach module,$(OSG_3RDPARTY_COMPONENTS),$(eval $(call add_osg_3rdparty_component,$(module ### GLES1 build include $(CLEAR_VARS) OSG_SDK:=/media/christian/DATA/android-osg-sdk/gles1/${APP_ABI} OSG_SDK_LIB_PATH:=$(OSG_SDK)/lib OSG_SDK_PLUGIN_PATH:=$(OSG_SDK_LIB_PATH)/osgPlugins-3.3.8 ifneq (,$(wildcard $(OSG_SDK)/include/osg/Config)) APP_MODULES := jniosg-gles1 LOCAL_CFLAGS := -Werror -fno-short-enums -fPIC LOCAL_CPPFLAGS:= -DOSG_LIBRARY_STATIC LOCAL_SRC_FILES := $(OSG_SRC_FILES) LOCAL_MODULE := libjniosg-gles1 LOCAL_LDLIBS := -llog -lGLESv1_CM -ldl -lm# -lz LOCAL_WHOLE_STATIC_LIBRARIES+=$(OSG_3RDPARTY_COMPONENTS) LOCAL_C_INCLUDES+=$(OSG_SDK)/include TARGET_LDLIBS := $(OSG_LDLIBS) LOCAL_LDFLAGS := -L$(OSG_SDK_LIB_PATH) -L$(OSG_SDK_PLUGIN_PATH) -L$(OSG_3RDPARTY_LIBS_DIR) include $(BUILD_SHARED_LIBRARY) else $(warning Unable to find osg/Config file in the headers, not building libjniosg-gles1 module) endif ### GLES2 build include $(CLEAR_VARS) OSG_SDK2:=/media/christian/DATA/android-osg-sdk/gles2/${APP_ABI} OSG_SDK2_LIB_PATH:=$(OSG_SDK2)/lib OSG_SDK2_PLUGIN_PATH:=$(OSG_SDK2_LIB_PATH)/osgPlugins-3.3.8 ifneq ( ,$(wildcard $(OSG_SDK2)/include/osg/Config)) APP_MODULES := jniosg-gles2 LOCAL_CFLAGS := -Werror -fno-short-enums -fPIC LOCAL_CPPFLAGS:= -DOSG_LIBRARY_STATIC LOCAL_SRC_FILES := $(OSG_SRC_FILES) LOCAL_MODULE := libjniosg-gles2 LOCAL_LDLIBS := -llog -lGLESv2 -ldl -lm LOCAL_WHOLE_STATIC_LIBRARIES+=$(OSG_3RDPARTY_COMPONENTS) LOCAL_C_INCLUDES :=