[osg-users] [vpb] build VPB on VS 10
hi, I'm trying build VPB. i downloaded VPB 0.9.7, OpenSceneGraph-3.0.1-VS10.0.30319-x86-release-12741.7z, GDAL 1.9.1 but when i compile on VS 10 in both mode release and debug it error, i could't understand it, can you show me to solve it, thank you very much: Error 1 error C2011: 'osgDB::IntLookup' : 'class' type redefinition C:\OpenSceneGraph\VirtualPlanetBuilder\include\vpb\Serializer 25 1 vpb Error 2 error C2976: 'osgDB::EnumSerializer' : too few template arguments C:\OpenSceneGraph\VirtualPlanetBuilder\include\vpb\Serializer 133 1 vpb Error 3 error C2953: 'osgDB::StringSerializer' : class template has already been defined C:\OpenSceneGraph\VirtualPlanetBuilder\include\vpb\Serializer 180 1 vpb Error 4 error C2977: 'osgDB::TemplateSerializer' : too many template arguments C:\OpenSceneGraph\VirtualPlanetBuilder\include\vpb\Serializer 226 1 vpb Warning 5 warning C4005: 'ADD_ENUM_VALUE' : macro redefinition C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 114 1 vpb Error 6 error C2514: 'osgDB::StringSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 152 1 vpb Error 7 error C2514: 'osgDB::StringSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 154 1 vpb Error 8 error C2514: 'osgDB::StringSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 155 1 vpb Error 9 error C2514: 'osgDB::StringSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 156 1 vpb Error 10 error C2514: 'osgDB::StringSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 157 1 vpb Error 11 error C2514: 'osgDB::StringSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 158 1 vpb Error 12 error C2514: 'osgDB::StringSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 159 1 vpb Error 13 error C2514: 'osgDB::StringSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 160 1 vpb Error 14 error C2514: 'osgDB::StringSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 161 1 vpb Error 15 error C3203: 'EnumSerializer' : unspecialized class template can't be used as a template argument for template parameter 'T', expected a real type C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 163 1 vpb Error 16 error C2955: 'osgDB::EnumSerializer' : use of class template requires template argument list C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 163 1 vpb Error 17 error C2514: 'osgDB::EnumSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 163 1 vpb Error 18 error C2512: 'osg::ref_ptr' : no appropriate default constructor available C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 163 1 vpb Error 19 error C2662: 'osg::ref_ptrT::get' : cannot convert 'this' pointer from 'osg::ref_ptr' to 'const osg::ref_ptrT ' C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 163 1 vpb Error 20 error C2678: binary '-' : no operator found which takes a left-hand operand of type 'osg::ref_ptr' (or there is no acceptable conversion) C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 163 1 vpb Error 21 error C2039: 'add' : is not a member of 'osg::ref_ptr' C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 163 1 vpb Error 22 error C2678: binary '-' : no operator found which takes a left-hand operand of type 'osg::ref_ptr' (or there is no acceptable conversion) C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 163 1 vpb Error 23 error C2039: 'add' : is not a member of 'osg::ref_ptr' C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 163 1 vpb Error 24 error C3203: 'EnumSerializer' : unspecialized class template can't be used as a template argument for template parameter 'T', expected a real type C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 164 1 vpb Error 25 error C2955:
[osg-users] [osgPlugins] osgQt widget + trackball manipulator only half working
Hi All, I have a simple Qt4 wrapper for my OSG 3.0 application which employs the trackball manipulator. The left and middle mouse button functions in the manipulator work as expected, but the right mouse button does not seem to do anything, which makes the manipulator kind of useless. Is this a known issue or could there be some problem with the way that I'm implementing my viewer? My widget class (which inherits osg::CompositeViewer) adds a view with the trackball manipulator like so: Code: QWidget * MyViewerWidget::addToViewWidget(osg::Camera* cam, osg::Group* root) { osgViewer::View* view = new osgViewer::View; view-setCamera(cam); addView(view); view-setSceneData(root); view-setCameraManipulator(new osgGA::TrackballManipulator); osgQt::GraphicsWindowQt* gw = dynamic_castosgQt::GraphicsWindowQt*(cam-getGraphicsContext()); return gw ? gw-getGLWidget() : NULL; } And in the constructor for my Qt main window I initialize an object of this class called viewWidget and do: Code: osg::Camera * cam1 = viewWidget-createCamera(0,0,100,100); QWidget * view1 = viewWidget-addToViewWidget(cam1, root); setGeometry(100,100,800,600); grid-addWidget(view1, 0, 0); viewWidget-setLayout(grid); setCentralWidget(viewWidget); I am running all of this on linux (Fedora 15). Thanks for any input! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48417#48417 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android: Problem with static intialization in osgViewer/Scene.cpp (from r13031)
+1 I had to revert this change as well to get the latest SVN rev (r13093) to run without crashing on Android. FWIW, there is nothing wrong with static initialization on Android, and the change to Scene.cpp is definitely a bug. Without compiler specific directives, there is no way to ensure that static variables will be initialized in any particular order. (AKA the Static Initialization Order Fiasco.) Thanks, James -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48365#48365 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Problems with moving the Camera with the Keyboard
Hi, i have tried to move the Camera in my scene with the keyboard. I have created a subclass of the GUIEventHandler()-Class and i have overridden the handle()-funtion. I want to use the UP/DOWN/LEFT/RIGHT Buttons. I can see on the console that if i press one of these Buttons that i get the correct cout Statement that i have implentet in the switch/case-Statement for every button. But it seems that the viewer-getCamera()-setViewMatrixAsLookAt(...) does not do anything. Can someone give me a hint what is wrong??? Here is the Code. And sorry for my bad English. ;) class KeyboardEventHandler: public osgGA::GUIEventHandler { public: KeyboardEventHandler(){} ~KeyboardEventHandler(){} virtual bool handle(const osgGA::GUIEventAdapter ea, osgGA::GUIActionAdapter us) { osgViewer::Viewer *viewer = dynamic_castosgViewer::Viewer*(us); viewer-getCamera()-setAllowEventFocus(false); osg::Vec3 eye(1.0, 10.0, -3.0); osg::Vec3 center(2.0, 0.0, -2.0); osg::Vec3 up(1.0, 0.0, 0.0); viewer-getCamera()-setViewMatrixAsLookAt(eye, center, up); switch(ea.getKey()) { case(osgGA::GUIEventAdapter::KEY_Down): { viewer-getCamera()-setViewMatrixAsLookAt(osg::Vec3(1.0, 15.0, -3.0), osg::Vec3(2.0, 0.0, -2.0), osg::Vec3(1.0, 0.0, 0.0)); std::cout down endl; return true; } case(osgGA::GUIEventAdapter::KEY_Up): { std::cout up endl; return true; } case(osgGA::GUIEventAdapter::KEY_Left): { cout left endl; return true; } case(osgGA::GUIEventAdapter::KEY_Right): { cout right endl; return true; } default: return false; } } }; //main.cpp osgViewer::Viewer viewer; viewer.setSceneData(root); viewer.addEventHandler(new KeyboardEventHandler); viewer.realize(); while(!viewer.done()) { viewer.frame(); } Thank you very much! Cheers, Christian Wolf -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48405#48405 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] ECEF to openGl
Hi. I have a big problem. not sure this is the good place to post this, but here goes. I am working on some aircraft simulation game... Problem for me are coordinates conversion. All my coordinates are in ECEF. I have problem setting up my camera properly and then later transforming ECEF positions of aircraft so they can be rendered correctly. can someone please tell me the right way to do it, or even better some code would be nice. for example. my camera is at lat 15, lon 10, elevation 0. i want it to look at lat 15.01, lon 10, elevation 0. I convert both of theses to ecef, so i have my cameraPosition and cameraTarget. how to convert models ecef position so i have opengl x-right, y-up, z-forward? Thank you! Cheers, Pilip -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48305#48305 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android: Problem with static intialization in osgViewer/Scene.cpp (from r13031)
Yes, we already reported the same bug. We are waiting for Robert to decide what's best because that code was changed to fix another bug when OSG was closing. For now i'm working with the trunk and changin those two variables as they were in previous versions because the bug at exit doesn't happen in Android. 2012/6/19 James Athey james.at...@gmail.com WIW, there is nothing wrong with static initialization on Android, and the change to Scene.cpp is definitely a bug. Without compiler specific directives, there is no way to ensure that static variables will be initialized in any particular order. (AKA the Static Initialization Order Fiasco.) Thanks, James ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Node visitor pattern
Hi Michael, The way the OSG applications normally manage updates to the scene graph is to either use a NodeCallback attached as UpdateCallback on nodes or for the application to run the updates manually during the frame loop - just by adding calls in between the viewer.advance() and the viewer.renderingTraversals() (see the implementation of Viewer::frame() to see how this is done or tutorials on the composition of the frameloop). For own application the idea of TimerListerner doesn't fit directly into the normal OSG usage but you could easily add your own custom management of updates in a custom frame loop, is simply use an update callback. The OSG's update and event traversals only traverse subgraphs that have update and event callbacks respectively so they don't traversal subgraph they don't need to so are generally pretty efficient ways of managing updates. Robert. On 21 June 2012 13:34, michael kapelko korn...@gmail.com wrote: Hi. I'm going to use OSG as one of my game engine components. Currently I have Timer singleton. Classes that wish to be notified regularly should inherit from TimerListener and add themselves to the queue like Timer-addListener(this, 30); where 30 is 30 milliseconds, i.e., they will be notified approximately each 30 milliseconds. In listeners I do 'animations' (moving, scaling, etc). In OSG, however, each node gets traversed, even several times. Currently I'm unsure how to implement my new Timer with OSG. The single deciding Timer class seems to require less power, since it doesn't call each listener each frame, instead, it knows when to call each listener and only does it when necessary. May be I'm misunderstanding current visitor pattern? May be it's really necessary to traverse each listener each frame and let each listener decide? ___ 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] LightPointNode BlinkSequence class modification questions.
HI Brad, On 21 June 2012 23:23, Brad Colbert bcolb...@rscusa.com wrote: How would you feel about changing the osg::Vec4 BlinkSequence::color(double time,double length) const to virtual? I would like to customize the behaviour of this call but I'm currently unable to because it is inlined and not virtual. The method is original inline for performance reasons so the question I'd pose is simply what performance impact would we see with changing to virtual. This would depend on just how many light points in the scene might have a BlinkSequence attached. How many are you using or would you expect to be used on screen at any one time? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Node visitor pattern
Am I understanding correctly that Object::STATIC is a flag that says something won't be traversed/updated each frame (based on some internal decision), and Object::DYNAMIC says: traverse/update it each frame? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] build VPB on VS 10
Hi Nguyen, I'm afraid you won't be able to compile VPB-0.9.7 against VPB-3.0.1, you'll either need to use an older version of the OSG matched to VPB-0.9.7 or update to later VPB such as the svn/trunk. VPB and OSG svn/trunk both work together and if they don't just ping the list and I'll get it fixed. Robert. On 18 June 2012 12:25, nguyen duy nam namd...@gmail.com wrote: hi, I'm trying build VPB. i downloaded VPB 0.9.7, OpenSceneGraph-3.0.1-VS10.0.30319-x86-release-12741.7z, GDAL 1.9.1 but when i compile on VS 10 in both mode release and debug it error, i could't understand it, can you show me to solve it, thank you very much: Error 1 error C2011: 'osgDB::IntLookup' : 'class' type redefinition C:\OpenSceneGraph\VirtualPlanetBuilder\include\vpb\Serializer 25 1 vpb Error 2 error C2976: 'osgDB::EnumSerializer' : too few template arguments C:\OpenSceneGraph\VirtualPlanetBuilder\include\vpb\Serializer 133 1 vpb Error 3 error C2953: 'osgDB::StringSerializer' : class template has already been defined C:\OpenSceneGraph\VirtualPlanetBuilder\include\vpb\Serializer 180 1 vpb Error 4 error C2977: 'osgDB::TemplateSerializer' : too many template arguments C:\OpenSceneGraph\VirtualPlanetBuilder\include\vpb\Serializer 226 1 vpb Warning 5 warning C4005: 'ADD_ENUM_VALUE' : macro redefinition C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 114 1 vpb Error 6 error C2514: 'osgDB::StringSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 152 1 vpb Error 7 error C2514: 'osgDB::StringSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 154 1 vpb Error 8 error C2514: 'osgDB::StringSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 155 1 vpb Error 9 error C2514: 'osgDB::StringSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 156 1 vpb Error 10 error C2514: 'osgDB::StringSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 157 1 vpb Error 11 error C2514: 'osgDB::StringSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 158 1 vpb Error 12 error C2514: 'osgDB::StringSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 159 1 vpb Error 13 error C2514: 'osgDB::StringSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 160 1 vpb Error 14 error C2514: 'osgDB::StringSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 161 1 vpb Error 15 error C3203: 'EnumSerializer' : unspecialized class template can't be used as a template argument for template parameter 'T', expected a real type C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 163 1 vpb Error 16 error C2955: 'osgDB::EnumSerializer' : use of class template requires template argument list C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 163 1 vpb Error 17 error C2514: 'osgDB::EnumSerializer' : class has no constructors C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 163 1 vpb Error 18 error C2512: 'osg::ref_ptr' : no appropriate default constructor available C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 163 1 vpb Error 19 error C2662: 'osg::ref_ptrT::get' : cannot convert 'this' pointer from 'osg::ref_ptr' to 'const osg::ref_ptrT ' C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 163 1 vpb Error 20 error C2678: binary '-' : no operator found which takes a left-hand operand of type 'osg::ref_ptr' (or there is no acceptable conversion) C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 163 1 vpb Error 21 error C2039: 'add' : is not a member of 'osg::ref_ptr' C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 163 1 vpb Error 22 error C2678: binary '-' : no operator found which takes a left-hand operand of type 'osg::ref_ptr' (or there is no acceptable conversion) C:\OpenSceneGraph\VirtualPlanetBuilder\src\vpb\BuildOptionsIO.cpp 163 1 vpb
Re: [osg-users] [osgPlugins] osgQt widget + trackball manipulator only half working
Hi Joe, Does the osgviewerQt work OK for you? Robert. On 21 June 2012 21:45, Joe Doob cstat...@gmail.com wrote: Hi All, I have a simple Qt4 wrapper for my OSG 3.0 application which employs the trackball manipulator. The left and middle mouse button functions in the manipulator work as expected, but the right mouse button does not seem to do anything, which makes the manipulator kind of useless. Is this a known issue or could there be some problem with the way that I'm implementing my viewer? My widget class (which inherits osg::CompositeViewer) adds a view with the trackball manipulator like so: Code: QWidget * MyViewerWidget::addToViewWidget(osg::Camera* cam, osg::Group* root) { osgViewer::View* view = new osgViewer::View; view-setCamera(cam); addView(view); view-setSceneData(root); view-setCameraManipulator(new osgGA::TrackballManipulator); osgQt::GraphicsWindowQt* gw = dynamic_castosgQt::GraphicsWindowQt*(cam-getGraphicsContext()); return gw ? gw-getGLWidget() : NULL; } And in the constructor for my Qt main window I initialize an object of this class called viewWidget and do: Code: osg::Camera * cam1 = viewWidget-createCamera(0,0,100,100); QWidget * view1 = viewWidget-addToViewWidget(cam1, root); setGeometry(100,100,800,600); grid-addWidget(view1, 0, 0); viewWidget-setLayout(grid); setCentralWidget(viewWidget); I am running all of this on linux (Fedora 15). Thanks for any input! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48417#48417 ___ 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] Problems with moving the Camera with the Keyboard
Hi Christian, The only reason I'd expect this not to work would be if a CameraManipulator is attached to the viewer and this is overriding the values you are setting. Your code segment isn't attaching a CameraManipulator so I wouldn't expect this to be an issue, however if you call viewer.run() it will attach a TrackballManipultaor. Robert. On 21 June 2012 11:52, Christian Wolf chris05...@gmx.de wrote: Hi, i have tried to move the Camera in my scene with the keyboard. I have created a subclass of the GUIEventHandler()-Class and i have overridden the handle()-funtion. I want to use the UP/DOWN/LEFT/RIGHT Buttons. I can see on the console that if i press one of these Buttons that i get the correct cout Statement that i have implentet in the switch/case-Statement for every button. But it seems that the viewer-getCamera()-setViewMatrixAsLookAt(...) does not do anything. Can someone give me a hint what is wrong??? Here is the Code. And sorry for my bad English. ;) class KeyboardEventHandler: public osgGA::GUIEventHandler { public: KeyboardEventHandler(){} ~KeyboardEventHandler(){} virtual bool handle(const osgGA::GUIEventAdapter ea, osgGA::GUIActionAdapter us) { osgViewer::Viewer *viewer = dynamic_castosgViewer::Viewer*(us); viewer-getCamera()-setAllowEventFocus(false); osg::Vec3 eye(1.0, 10.0, -3.0); osg::Vec3 center(2.0, 0.0, -2.0); osg::Vec3 up(1.0, 0.0, 0.0); viewer-getCamera()-setViewMatrixAsLookAt(eye, center, up); switch(ea.getKey()) { case(osgGA::GUIEventAdapter::KEY_Down): { viewer-getCamera()-setViewMatrixAsLookAt(osg::Vec3(1.0, 15.0, -3.0), osg::Vec3(2.0, 0.0, -2.0), osg::Vec3(1.0, 0.0, 0.0)); std::cout down endl; return true; } case(osgGA::GUIEventAdapter::KEY_Up): { std::cout up endl; return true; } case(osgGA::GUIEventAdapter::KEY_Left): { cout left endl; return true; } case(osgGA::GUIEventAdapter::KEY_Right): { cout right endl; return true; } default: return false; } } }; //main.cpp osgViewer::Viewer viewer; viewer.setSceneData(root); viewer.addEventHandler(new KeyboardEventHandler); viewer.realize(); while(!viewer.done()) { viewer.frame(); } Thank you very much! Cheers, Christian Wolf -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48405#48405 ___ 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] ECEF to openGl
Hi Pilip, The OSG can handle ECEF just fine, in fact VirtualPlanetBuilder and osgEarth both create databases in ECEF and when you using the standard camera manipulator they will also be in effect in ECEF. The only real problem in handling ECEF is that precision problems can exist when you don't manage the coordinates correctly, the solve this the OSG by default uses double for all Matrix for both the Camera and internal transform in the scene graph and when accumulating the modelview matrix the matrix math is all kept in doubles to maintain precision as long as possible. The final bit of jigsaw is that the scene graph that you are rendering will need to broken up into tiles with each tile with it's own MatrixTransform above it that places a tile with a local coordinate frame and origin in the final ECEF. This combination of scene graph structure and use of doubles in internal Matrices avoids the precision issues normally found with ECEF database. In terms of setting up ECEF and lat/longs the OSG uses an osg::CoordinateSystemNode to decorate the scene graph generated by VPB or osgEarth, and this has a osg::ElipsoidModel helper object that provides methods for conversion between ECEF and lat/longs. Robert. On 14 June 2012 12:15, Pilip Rogati lim...@net.hr wrote: Hi. I have a big problem. not sure this is the good place to post this, but here goes. I am working on some aircraft simulation game... Problem for me are coordinates conversion. All my coordinates are in ECEF. I have problem setting up my camera properly and then later transforming ECEF positions of aircraft so they can be rendered correctly. can someone please tell me the right way to do it, or even better some code would be nice. for example. my camera is at lat 15, lon 10, elevation 0. i want it to look at lat 15.01, lon 10, elevation 0. I convert both of theses to ecef, so i have my cameraPosition and cameraTarget. how to convert models ecef position so i have opengl x-right, y-up, z-forward? Thank you! Cheers, Pilip -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48305#48305 ___ 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] Node visitor pattern
Hi Michael, On 22 June 2012 10:30, michael kapelko korn...@gmail.com wrote: Am I understanding correctly that Object::STATIC is a flag that says something won't be traversed/updated each frame (based on some internal decision), and Object::DYNAMIC says: traverse/update it each frame? DataVariance on Node's isn't used during the normal frame traversals like update, event and cull traverals, it's only used as hint to the osgUtil::Optimizer traversals to know whether it can optimize away/modify nodes for scene graph optimization purposes. However, the DataVarinace on StateSet and Drawable is used during draw dispatch when using the DrawThreadPerContext and CullThreadPerCameraDrawThreadPerContext threading models - it's used to prevent the next frame from commensing while there are still dyanmic leaves to be dispatched to OpenGL. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How to read OSG models in MulthiThreaded Program
Hi, I need to load multiple OSG models of huge size (each model 60MB). So I wrote a multi threaded program to read each model in a seperate thread. But I am getting runtime error. Here I am giving code to read 2 models. Code: CRITICAL_SECTION cs; struct ModelObj { Model *obj; int id; }; std::vector HANDLE T; UINT ThreadProc1(LPVOID lpvoid) { ModelObj *temp = (ModelObj*)lpvoid; temp-obj-trans[temp-id] = new osg::MatrixTransform; //Transformation node temp-obj-modelSwitch-addChild(temp-obj-trans[temp-id].get()); //Added to model swithc temp-obj-model[temp-id] = osgDB::readNodeFile(temp-obj-fileNames[temp-id]); //Reading model if(temp-obj-model[temp-id]) { temp-obj-trans[temp-id]-addChild(temp-obj-model[temp-id].get()); } return 0; } In main function //model is a class ModelObj *obj1; obj1=new ModelObj; obj1-id=0; obj1-obj = model; ModelObj *obj2; obj2=new ModelObj; obj2-id=1; obj2-obj = model; strcpy(model.fileNames[0],1.osg); strcpy(model.fileNames[1],2.osg); InitializeCriticalSection(cs); T.push_back (CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) ThreadProc1, (LPVOID)obj1, CREATE_SUSPENDED, NULL)); T.push_back(CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) ThreadProc1, (LPVOID)obj2, CREATE_SUSPENDED, NULL)); ResumeThread(T[0]); ResumeThread(T[1]); WaitForMultipleObjects(2, T[0], TRUE, INFINITE); //wait till all models are red DeleteCriticalSection(cs); std::cout-- R E A D ALL M O D E L Sstd::endl; ... //here rendering frames when I run this code i am getting runtime error. With out reading model code in ThreadProc1 function the behaviour is correct. That is main function is waiting till all the threads are finished. Do I need to take any care while reading OSG models. Is there any other way to read OSG files faster? Can you please guide to read OSG models in multi thread applicaiton. ... Thank you! Cheers, Koduri -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48434#48434 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] osgQt widget + trackball manipulator only half working
Yes, oddly enough it works just fine. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48435#48435 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] osgQt widget + trackball manipulator only half working
I took another look through the osgviewerQt source and found a solution, though I'm not sure I understand why my extra step is necessary: Manually initializing the projection matrix for the camera using setProjectionMatrixAsPerspective fixes things. Code: camera-setProjectionMatrixAsPerspective(30.0f, static_castdouble(traits-width)/static_castdouble(traits-height), 1.0f, 1.0f ); -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48436#48436 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Ideas about a resource system, and deferred rendering framework
I was going to raise that point. Flightgear has for some years now a system where designers can express their statesets in XML files called effects. A statesets is called a Pass in FG (or a FG Pass is implemented with a stateset). You can add multiple passes in a Technique, allowing you to redraw the same geometry with multiple statesets (including render bins details). An effect file gathers multiple techniques that have a predicate, based on supported extensions and internal FG switches, which is evaluated at run time. The multiple techniques allow us to render the water or the urban areas differently based on user preferences and GPU capabilities. Beside that effect system, we introduced a deferred renderer called 'Rembrandt' (currently still experimental but it will be present in the next release in August) where the different stages of the renderer are also described in XML. In that XML we can add rendering buffers (textures for RTT), specify rendering orders and assign effects to stages. The default pipeline has boom and ambient occlusion that can be switched on and off at run time. If you have any question, you can consult the wiki page or ask Regards, -Fred - Mail original - De: Sergey Kurdakov Hi Wang, might be not quite a significant point, but osg based Flightgear has a ongoing Project Rembrandt http://wiki.flightgear.org/Project_Rembrandt it has some similar things done, so could serve for inspiration. Regards Sergey ___ 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] Ideas about a resource system, and deferred rendering framework
Hi Fred and Sergey, Thanks for the great information. I viewed the Rembrandt wiki page and love the design of the effect files. I will consider merge some of the concepts of Rembrandt if possible, along with current osgPPU and osgPostEffects projects, to try designing an extensible system for all. I would like to submit some of my initial code here for all of you to review and see if it could fit everyone's taste. I hope I could have done that in the following week. Thanks, Wang Rui 2012/6/22 Frederic Bouvier fredlis...@free.fr I was going to raise that point. Flightgear has for some years now a system where designers can express their statesets in XML files called effects. A statesets is called a Pass in FG (or a FG Pass is implemented with a stateset). You can add multiple passes in a Technique, allowing you to redraw the same geometry with multiple statesets (including render bins details). An effect file gathers multiple techniques that have a predicate, based on supported extensions and internal FG switches, which is evaluated at run time. The multiple techniques allow us to render the water or the urban areas differently based on user preferences and GPU capabilities. Beside that effect system, we introduced a deferred renderer called 'Rembrandt' (currently still experimental but it will be present in the next release in August) where the different stages of the renderer are also described in XML. In that XML we can add rendering buffers (textures for RTT), specify rendering orders and assign effects to stages. The default pipeline has boom and ambient occlusion that can be switched on and off at run time. If you have any question, you can consult the wiki page or ask Regards, -Fred - Mail original - De: Sergey Kurdakov Hi Wang, might be not quite a significant point, but osg based Flightgear has a ongoing Project Rembrandt http://wiki.flightgear.org/Project_Rembrandt it has some similar things done, so could serve for inspiration. Regards Sergey ___ 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
Re: [osg-users] Building a slimmed down static version of OSG
Hi, I got a basic scene graph running (manually created a simple mesh and was able to view it). I ran into problems trying to run the osg file loader plugins and didn't troubleshoot that part any further. Also, I was building from git. Do you run into the same crash with 32 and 64 bit builds? What does the stack trace from the crash say? Also the reimplementation of GraphicsWindowEmbedded::requestRedraw should be calling GraphicsWindow::requestRedraw(): void requestRedraw() { GraphicsWindow::requestRedraw(); } ... but that doesn't seem to be your issue here. Preet On Thu, Jun 21, 2012 at 11:13 PM, David Smith mo...@mokon.net wrote: Hi Preet, Did you make any progress on this? I'm getting a similar error and I am stumped. I have a fedora 16 32bit machine with osg 3.0.1 where my code compiles fine and then I have a fedora 17 64bit machine also with osg 3.0.1 where I get this undefined reference. I added a virtual void requestRedraw(){} ; to the GraphicsWindowEmbedded header file just to see what would happen and it compiles but I get a crash right away on an addChild in Qt land. Thanks, David -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48421#48421 ___ 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] LightPointNode BlinkSequence class modification questions.
Hello Robert, My gut tells me that the time to make a call to a virtual function versus inlined code is far less than the actual code being executed. That said, a little gedanken experiment to get an idea of how many blinking lights we may have to deal with is in order: Let us say, for the sake of argument, for a flight simulation in a non urban area it would be a couple per aircraft. Given that most simulations tend to not have a lot of aircraft then we aren't talking about a lot. Let's say 10 (why not :) ). In an urban environment we are talking about hazard lights to indicate large towers and buildings of significant height (relative to the surrounding buildings). Let's say 100 buildings (including towers), each with a few lights, so 300. Generally not all of those lights will be in the field of view, and it wouldn't be prudent to render them all of the time at distance (LOD controlled). So, let's say our worse case is 310 lights. My analysis may be a bit self serving but I don't feel that it will be a noticeable issue in the general case. -B -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: Friday, June 22, 2012 2:19 AM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] LightPointNode BlinkSequence class modification questions. HI Brad, On 21 June 2012 23:23, Brad Colbert bcolb...@rscusa.com wrote: How would you feel about changing the osg::Vec4 BlinkSequence::color(double time,double length) const to virtual? I would like to customize the behaviour of this call but I'm currently unable to because it is inlined and not virtual. The method is original inline for performance reasons so the question I'd pose is simply what performance impact would we see with changing to virtual. This would depend on just how many light points in the scene might have a BlinkSequence attached. How many are you using or would you expect to be used on screen at any one time? 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] Android: Problem with static intialization in osgViewer/Scene.cpp (from r13031)
Hi All, On 22 June 2012 09:41, Jorge Izquierdo Ciges jori...@gmail.com wrote: Yes, we already reported the same bug. We are waiting for Robert to decide what's best because that code was changed to fix another bug when OSG was closing. I'm currently review static usage usage more generally in the OSG, the static's in Scene.cpp are part of this. The problem being that one platform and OSG usage breaks one way and another breaks doing another so in cases like Android breaking with the static change in Scene.cpp it's not a straight forward case of just reverting changes - to do so would fix a problem for one user only to break it for another. Static/singleton's are a useful mechanism for solve a range of problems but come with their own baggage, there may be places in the OSG where we can just remove the use of statics completely, but others we still need them so it's a case of how do we enforce initialization in an appropriate way. In the Scene.cpp case my current preference is to create a single static for the container and the mutex that protects it, and in other places I feel this would be appropriate too, unfortunately there isn't any universal pattern to our static usage to be able to standardize it easily so we it's likely we'll be stuck with individual solutions in different cases. Thanks for your patience, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgWidget Frame borders
Thank you for your help. Modifying the textures to use CLAMP_TO_EDGE has a positive effect, but does not fix the problem entirely. See attached image. The dark pixels seem to come from some other blending going on... If I switch the theme I use to a full white 66x66 image, the lines do not show. Do you have any more advice for me? Jason -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48442#48442 attachment: frame.png___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using the notification API with multi-threading - heap corruption errors
Hi Mathias, On 14 June 2012 17:29, Robert Osfield robert.osfi...@gmail.com wrote: W.r.t static initialization, this is something we need to sort out, and as long as there isn't a performance overhead in how we tackle it then I have no problem with it being the only code path for initialization of the singletons that manage the notification. What I have gone for with src/osg/Notify.cpp is to use a NotifySingleton class that holds all the global notify variables and initializes these in it's constructor, then a static getNotifySingleton() function returns a reference to locally defined static NotifySingleton. Finally to force the NotifySingleton to initialize automatically rather than on first invocation of osg::Notify() I have used a static proxy class that simple calls the getNotifySingleton() to make sure that it's called right after loading the library. My hope that this combination will ensure that the threading problems relating to the initialization of the global notify variables you've seen will not occur. This doesn't make the noitfy() handlers themselves thread safe, I'll defer this to your own custom implementation. I have checked in my changes to svn/trunk and also attached the modified Notify.cpp. Could you please test this and let me know if this works. Thanks, Robert. /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ #include osg/Notify #include osg/ApplicationUsage #include osg/ref_ptr #include string #include stdlib.h #include stdio.h #include sstream #include iostream #include ctype.h #define OSG_INIT_SINGLETON_PROXY(ProxyName, Func) static struct ProxyName{ ProxyName() { Func; } } s_##ProxyName; namespace osg { class NullStreamBuffer : public std::streambuf { private: std::streamsize xsputn(const std::streambuf::char_type *str, std::streamsize n) { return n; } }; struct NullStream : public std::ostream { public: NullStream(): std::ostream(new NullStreamBuffer) { _buffer = dynamic_castNullStreamBuffer *(rdbuf()); } ~NullStream() { rdbuf(0); delete _buffer; } protected: NullStreamBuffer* _buffer; }; /** Stream buffer calling notify handler when buffer is synchronized (usually on std::endl). * Stream stores last notification severity to pass it to handler call. */ struct NotifyStreamBuffer : public std::stringbuf { NotifyStreamBuffer() : _severity(osg::NOTICE) { } void setNotifyHandler(osg::NotifyHandler *handler) { _handler = handler; } osg::NotifyHandler *getNotifyHandler() const { return _handler.get(); } /** Sets severity for next call of notify handler */ void setCurrentSeverity(osg::NotifySeverity severity) { _severity = severity; } osg::NotifySeverity getCurrentSeverity() const { return _severity; } private: int sync() { sputc(0); // string termination if (_handler.valid()) _handler-notify(_severity, pbase()); pubseekpos(0, std::ios_base::out); // or str(std::string()) return 0; } osg::ref_ptrosg::NotifyHandler _handler; osg::NotifySeverity _severity; }; struct NotifyStream : public std::ostream { public: NotifyStream(): std::ostream(new NotifyStreamBuffer) { _buffer = dynamic_castNotifyStreamBuffer *(rdbuf()); } void setCurrentSeverity(osg::NotifySeverity severity) { _buffer-setCurrentSeverity(severity); } osg::NotifySeverity getCurrentSeverity() const { return _buffer-getCurrentSeverity(); } ~NotifyStream() { rdbuf(0); delete _buffer; } protected: NotifyStreamBuffer* _buffer; }; } using namespace osg; static osg::ApplicationUsageProxy Notify_e0(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE, OSG_NOTIFY_LEVEL mode, FATAL | WARN | NOTICE | DEBUG_INFO | DEBUG_FP | DEBUG | INFO | ALWAYS); struct NotifySingleton { NotifySingleton() { // _notifyLevel // = _notifyLevel = osg::NOTICE; // Default value char* OSGNOTIFYLEVEL=getenv(OSG_NOTIFY_LEVEL); if (!OSGNOTIFYLEVEL) OSGNOTIFYLEVEL=getenv(OSGNOTIFYLEVEL); if(OSGNOTIFYLEVEL) { std::string stringOSGNOTIFYLEVEL(OSGNOTIFYLEVEL); // Convert to upper case for(std::string::iterator i=stringOSGNOTIFYLEVEL.begin(); i!=stringOSGNOTIFYLEVEL.end(); ++i)
[osg-users] Heightmap from static mesh
Hi, Is it possible to create heightmap form static mesh terrain? ... Thank you! Cheers, Umid -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48451#48451 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org