Re: [osg-users] Segfault when using addChild on Group object
Hmm, I am using this CMake file, so I am not using a -I flag manually, and I don't see one in the generated Makefile. I checked the ldd output and they don't see anything inconsistent with itself. Code: linux-vdso.so.1 => (0x7ffe606c9000) libosg.so.99 => /usr/lib/libosg.so.99 (0x7fd9b71be000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x7fd9b6eba000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x7fd9b6ca4000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x7fd9b68df000) libOpenThreads.so.14 => /usr/lib/libOpenThreads.so.14 (0x7fd9b66d7000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x7fd9b64cf000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x7fd9b62cb000) libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x7fd9b6065000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x7fd9b5d5f000) /lib64/ld-linux-x86-64.so.2 (0x7fd9b768e000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x7fd9b5b41000) libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x7fd9b591a000) libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x7fd9b5708000) libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x7fd9b5505000) libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x7fd9b52ff000) libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x7fd9b50fd000) libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x7fd9b4dc8000) libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x7fd9b4bb1000) libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x7fd9b49ac000) libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x7fd9b47a9000) libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x7fd9b45a6000) libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x7fd9b43a) libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x7fd9b4181000) libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x7fd9b3f7f000) libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x7fd9b3d79000) libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x7fd9b3b6c000) libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x7fd9b3968000) libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x7fd9b3762000) I'm not so strong on UNIX build tools so sorry if I'm missing something obvious. Here is the CMakeLists.txt Code: cmake_minimum_required( VERSION 2.6 ) project( proj ) find_package( OpenThreads ) find_package( osg ) find_package( osgDB ) find_package( osgUtil ) find_package( osgViewer ) macro( config_project PROJNAME LIBNAME ) include_directories( ${${LIBNAME}_INCLUDE_DIR} ) target_link_libraries( ${PROJNAME} ${${LIBNAME}_LIBRARY} ) endmacro() add_executable( proj main.cpp ) config_project( proj OPENTHREADS ) config_project( proj OSG ) config_project( proj OSGDB ) config_project( proj OSGUTIL ) config_project( proj OSGVIEWER ) Thanks, Andre -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=66949#66949 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Segfault when using addChild on Group object
Hi, I'm trying to use OpenSceneGraph on my machine running. When I run the following code, I always get a segfault on the line with addChild: Code: #include #include #include #include int main(int argc, char** argv) { osg::ref_ptr a = new osg::Node(); osg::ref_ptr b = new osg::Group(); b->addChild(a.get()); osgViewer::Viewer viewer; viewer.setSceneData(b); viewer.run(); return 0; } Any ideas why this would happen? I'm on Ubuntu 14.04.4, and using the libopenscenegraph-dev package from apt-get. Thanks, Andre -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=66931#66931 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Changing the color of a model
Ah, that seems to have done the trick for what I'm doing at the moment, thanks! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65334#65334 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Changing the color of a model
Hi OpenSceneGraph forum! I'm very new to OSG, and while I'm very familiar with programming, and somewhat familiar with 3D graphics, I am now devoting actual time working in a lab to properly learn C++, and OSG as well. My issue is as follows: I am loading an existing model as a Node, and I want to be able to change the color of the model in real time. How should I go about doing this? I know how attach an update callback to the Node, but it's the color that I can't seem to change. I am able to set the diffuse color on a primitive object using a material like so: Code: osg::ref_ptr mat = new osg::Material; mat->setDiffuse (osg::Material::FRONT_AND_BACK, osg::Vec4(0.8, 0.1, 0.4, 1.0)); myNode->getOrCreateStateSet()->setAttributeAndModes(mat, osg::StateAttribute::ON); but this doesn't seem to work on the model. I found that if I changed the model's .osg file to not define material colors on particular components of the model, then this color I defined for the model would affect those parts. However I feel there should be a better way to do this, as I will probably end up using models that actually need these colors within their respective .osg files. I know I can probably do this with a shader, and if that's necessary then fine, but if there's an easier way then that would be great. So essentially my question is: What is the easiest way to change the overall diffuse color of an object? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65321#65321 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org