Re: [osg-users] Testing of OpenSceneGraph svn/trunk in prep for 3.1 dev release
Hi Robert, I compiled OSG for iOS 5 and GLES2 from console, I'm preparing a submission with a couple of fixes necessary to do it. I hope I can finish it before 3.1 release, but I need to do a bit of testing and clean the CMake code. I will post the changes here and maybe Stephan or others could check them. Cheers. 2012/2/23 Torben Dannhauer tor...@dannhauer.info Hi Robert, OSG compiles and runs as expected on Kubuntu 10.04 I'll compile it on windows 7 with VS2008 Sp1 today evening. Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45704#45704 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Dynamic datavariance clarification
Thanks for these clarifications Paul. Currently my application still crashes even I've put Dynamic datavariance on every modified node... and this crash appears also in SingleThreaded mode. It always crashes on the frame() viewer's function which I use in a custom thread in Qt. My main problem is that when it crashes, it seems impossible to know which node is the problem because I can't see any thing clearly in my Visual Studio debugger. The stack is only talking about UpdateTraversal. So when you say UpdateTraversal is only for convenience, it means you can update a position or a stateset from anywhere in your code without any crash even in multi threaded modes ? Regards -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45707#45707 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Strange results from osgviewer
Hi, Robert, thank you for your suggestions. I used the svn version and there is no difference. Now, when I can add some images to my post I included a screen-shot of 'osgviewerQt', when the two 3D models are not displayed correctly, these are 'cow' and 'dumptruck', left top and right top windows respectively. [Image: http://obrazki.elektroda.pl/2590187500_1329991217_thumb.jpg ] (http://obrazki.elektroda.pl/2590187500_1329991217.png) Secondly, after building OSG last night, I have noticed that now I cannot even run the examples showing use of textures, I have problem with 'osgtexture2d.exe' - this one crashes, 'osgtexture3d.exe' is fine but it doesn't display the texture, it says only that it could not open files. What is the difference between 3d model of 'cessna' and 'cow', why only one of them is displayed ok. Thank you! Cheers, Chris -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45708#45708 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Help: problems of intersectorVisitor with Qtmutex
HI Shuiying, The OSG doesn't have an IntersectorVisitor, but does have a modern IntersectionVisitor and a long deprecated and less flexible IntersectVisitor, if you are using the later I'd recommend using the more modern IntersectionVisitor. As for threading, visitors are written to be used single threaded, and when you want to run multiple traversals at the same time the appropriate technique is to create one visitor per thread. In cases like InteresectionVisitor they are pretty light weight so can be created and used on the the fly - there shouldn't be a need to store one per application. Creating the visitor on demand in the thread that needs it avoids any threading issues. Robert. On 22 February 2012 21:32, wang shuiying shuiying.w...@fu-berlin.de wrote: Hello, My program has an osg::viewer as a view widget of a Qt window. An intersectorVisitor object is initialised at the start of the program. The osg::viewer updates its children nodes as a normal viewer does, and updates the transform matrix of intersectorVisitor at the same time. I make another thread to do call of node-accept(intersectorVisitor), where the node is the root node of osg::viewer. In case that the two processes might conflict with each other I set lock with Qmutex when the osg::viewer updates and when node-accept(intersectorVisitor) is called in another thread. But the result turns out to be wrong. When I let the two processes run freely without locking them, then the result is right. I am wondering what happens here. That is to say, what intersectorVositor will do when it itself is locked or the nodes that it visits are locked. Thank you very much in advance! Shuiying ___ 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] Counting OpenGL Draw calls in Stats
Hi Jason, On 22 February 2012 18:34, Jason Daly jd...@ist.ucf.edu wrote: I'm interested in determining how many OpenGL draw calls are made during the rendering of a frame (counting and storing them as a Stats variable). I'm sure this is possible, but I wonder if it would be feasible to do without significantly affecting performance. Anyone have any thoughts? The OSG doesn't have any stats collection on individual OpenGL draw calls, such low level instrumentation would be rather expensive to implement code wise and expensive w.r.t run-time cost. The best solution for this type of low level instrumentation is to use a wrapper around the OpenGL driver as suggested by others in this thread. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Strange results from osgviewer
Hi Chris, What hardware are you using? Could you try another system with different hardware and drivers? Also could you try running the following in a console: osgconv cow.osgt cow_fromosgt.osg And then post the cow_fromosgt.osg, this might offer some insight in what might be going amiss. You could also try: osgconv cow.osg cow_fromosg.osgt osgviewer cow_fromosg.osgt And: osgconv cow.osg cow_fromosg.osgb osgviewer cow_fromosg.osgb If the binary (.osgb) works and the text (.osgt) version doesn't it would suggest something wrong with the parsing of the text file. In the past we have seen problems with some ascii file loaders with handling different local settings - i.e ten point 1 being 10.1 vs 1,10. The only possibility I can think of is that you have an out of date OpenSceneGraph-Data. Robert. On 23 February 2012 10:03, Chris Blizniak bliznia...@hotmail.com wrote: Hi, Robert, thank you for your suggestions. I used the svn version and there is no difference. Now, when I can add some images to my post I included a screen-shot of 'osgviewerQt', when the two 3D models are not displayed correctly, these are 'cow' and 'dumptruck', left top and right top windows respectively. [Image: http://obrazki.elektroda.pl/2590187500_1329991217_thumb.jpg ] (http://obrazki.elektroda.pl/2590187500_1329991217.png) Secondly, after building OSG last night, I have noticed that now I cannot even run the examples showing use of textures, I have problem with 'osgtexture2d.exe' - this one crashes, 'osgtexture3d.exe' is fine but it doesn't display the texture, it says only that it could not open files. What is the difference between 3d model of 'cessna' and 'cow', why only one of them is displayed ok. Thank you! Cheers, Chris -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45708#45708 ___ 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] Dynamic datavariance clarification
Hi Eric, I think it is not enough to mark every changed node as dynamic, you also have to mark all their child subgraph nodes as dynamic! Cheers, Martin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45711#45711 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Strange results from osgviewer
Hi, I tried to convert cow.osg and cow.osgt to .osgt, .osg, and .osgb all possible combinations. Using osgviewer, the results are the same. The 3D model is loaded only with few vertices, exactly the same as on the screen-shot above. In terms of the hardware - I'm using a laptop, not too old, and the only problem is the Intel's integrated graphics card. To be honest I had a problem with video streaming in Qt when I used openGL to display video frames, it was incredibly slow. Anyway, I think I will stop here as I need to move on with my work. Textures work fine in few cases, I can load some simple objects, therefore it should be enough. I am not planning to do anything huge at the moment so the current setup should be enough. I have different problem but I will post that as a new post as it is not related to this one. Thank you for your time. Cheers, Chris -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45714#45714 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Fishtank VR project
Hi, I'm trying to implement something similar to: http://linuxtoosx.blogspot.com/2010/06/fishtank-vr-project-with-opencv-and_30.html When I'm doing that using OpenGL only, I'm getting satisfactory results. The code is exactly the same as the one suggested on the website, Code: glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(-0.5 + x, 0.5 + x, -0.5 + y, 0.5 + y, nearPlane - z, 100.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(x, y, z); But when I try to achieve the same result in OSG, the output is not exactly the same, currently I'm using the following code: Code: osgViewer.getCamera()-setProjectionMatrixAsFrustum(-0.5 + x, 0.5 + x, -0.5 + y, 0.5 + y, nearPlane - z, 100.0); osg::Matrixd cameraTrans; cameraTrans.makeTranslate(x, y, z); osgViewer.getCamera()-setViewMatrix(cameraTrans); Is that equivalent to the OpenGL implementation? Or am I missing something? Thank you! Cheers, Chris[/url] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45715#45715 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] setViewMatrixAsLookAt in Qt
Hi, Thanks for your reply Tom, I changed few things in my code, and I'm no longer using osgviewerQt. I tried different approach, much simpler - something similar to: https://gitorious.org/mahjong-night/mahjong-night/blobs/master/mahjong-night/client/tablewidget.cpp Using slots and signals was pretty straight forward in this case. Thank you! Cheers, Chris -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45716#45716 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Strange results from osgviewer
Hi Chris, Intel drivers are well known for causing problems and suspect this may be causing the problems you are seeing. The Intel drivers under Linux do appear to be a little more stable than Windows so if you can dual boot your system it might be worth experimenting with. Also look to see if there are any updated drivers for your laptop. Robert. On 23 February 2012 11:06, Chris Blizniak bliznia...@hotmail.com wrote: Hi, I tried to convert cow.osg and cow.osgt to .osgt, .osg, and .osgb all possible combinations. Using osgviewer, the results are the same. The 3D model is loaded only with few vertices, exactly the same as on the screen-shot above. In terms of the hardware - I'm using a laptop, not too old, and the only problem is the Intel's integrated graphics card. To be honest I had a problem with video streaming in Qt when I used openGL to display video frames, it was incredibly slow. Anyway, I think I will stop here as I need to move on with my work. Textures work fine in few cases, I can load some simple objects, therefore it should be enough. I am not planning to do anything huge at the moment so the current setup should be enough. I have different problem but I will post that as a new post as it is not related to this one. Thank you for your time. Cheers, Chris -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45714#45714 ___ 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] Fishtank VR project
Hi Chris, The osg:Camera methods directly map to the equivalent OpenGL ones so what you are try should work. What may be going wrong is that if you have CameraManipulator attached to your viewer then it'll overwrite the Camera's ViewMatrix on each new frame. If you are using viewer.run() it'll assign a TrackballManipulator for you as fallback, but if you have your own viewer frame loop you'll be able to set the Camera's view matrix on each new frame as required. Robert. On 23 February 2012 11:33, Chris Blizniak bliznia...@hotmail.com wrote: Hi, I'm trying to implement something similar to: http://linuxtoosx.blogspot.com/2010/06/fishtank-vr-project-with-opencv-and_30.html When I'm doing that using OpenGL only, I'm getting satisfactory results. The code is exactly the same as the one suggested on the website, Code: glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(-0.5 + x, 0.5 + x, -0.5 + y, 0.5 + y, nearPlane - z, 100.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(x, y, z); But when I try to achieve the same result in OSG, the output is not exactly the same, currently I'm using the following code: Code: osgViewer.getCamera()-setProjectionMatrixAsFrustum(-0.5 + x, 0.5 + x, -0.5 + y, 0.5 + y, nearPlane - z, 100.0); osg::Matrixd cameraTrans; cameraTrans.makeTranslate(x, y, z); osgViewer.getCamera()-setViewMatrix(cameraTrans); Is that equivalent to the OpenGL implementation? Or am I missing something? Thank you! Cheers, Chris[/url] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45715#45715 ___ 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] Dynamic datavariance clarification
You should only update a stateset, drawable, or the scene graph structure from the update traversal, update callback, or update operation. Are you modifying anything at runtime? Outside of the Optimizer, DataVariance has no effect in SingleThreaded mode. It also has no effect on Nodes (only Drawables and StateSets). So it's more likely that you are trying to modify the scene graph from another thread without proper synchronization. Glenn Waldron / @glennwaldron On Thu, Feb 23, 2012 at 4:06 AM, Eric Pouliquen epouliq...@on-x.com wrote: Thanks for these clarifications Paul. Currently my application still crashes even I've put Dynamic datavariance on every modified node... and this crash appears also in SingleThreaded mode. It always crashes on the frame() viewer's function which I use in a custom thread in Qt. My main problem is that when it crashes, it seems impossible to know which node is the problem because I can't see any thing clearly in my Visual Studio debugger. The stack is only talking about UpdateTraversal. So when you say UpdateTraversal is only for convenience, it means you can update a position or a stateset from anywhere in your code without any crash even in multi threaded modes ? Regards -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45707#45707 ___ 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] Fishtank VR project
Hi, I derived a widget in Qt from QGLWidget, based on the code presented here: https://gitorious.org/mahjong-night/mahjong-night/blobs/master/mahjong-night/client/tablewidget.cpp initializeGL(), resizeGL() and paintGL() are exactly the same, I removed everything else to have just basic functionality where I load a 'cessna' model. That worked fine, then I replaced 'cessna' model with four quads - creating four walls of the room (left, right, top, bottom) and using viewer.getCamera()-setViewMatrixAsLookAt() everything was ok. When I added: Code: osgViewer.getCamera()-setProjectionMatrixAsFrustum(-0.5 + x, 0.5 + x, -0.5 + y, 0.5 + y, nearPlane - z, 100.0); osg::Matrixd cameraTrans; cameraTrans.makeTranslate(x, y, z); in paintGL() just before viewer.frame(), I can zoom in and zoom out and move the viewpoint left-right, top-bottom but the result is not even close to the one I achieved using only openGL. Thank you! Cheers, Chris -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45721#45721 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Dynamic datavariance clarification
Hi Eric, If you are seeing a crash when running single threaded then DataVariance won't be an issue, you'll need to look elsewhere. Unfortunately there is too information about the exact problem you are seeing on your system to be able to guess at what the problem might be. A general note about DataVariance, in the OSG there are internal Nodes of the scene graph - such as Group, Transform, Geode etc, setting DataVariance on these is only a hint to code that might optimize the scene graph about what is safe to replace and change and what isn't, unless you are calling the osgUtil::Optimizer is pretty likely that setting DataVariance on Node in the scene graph will have no effect on the end result - as the update, cull and draw traversals all ignore the Node's DataVariance settings. The only time that DataVariance is used is when the viewer is run multi-threaded with the DrawThreadPerContext or CullThreadPerCameraDrawThreadPerContext threading models, and where it's only the draw traversal that uses the DataVariance, and the since the draw traversal has only references to Drawable and StateSet leaves on the scene graph it's only the DataVariance on these that is checked. This means the nodes and any sate attributes attached to StateSet are ignored. Robert. On 23 February 2012 09:06, Eric Pouliquen epouliq...@on-x.com wrote: Thanks for these clarifications Paul. Currently my application still crashes even I've put Dynamic datavariance on every modified node... and this crash appears also in SingleThreaded mode. It always crashes on the frame() viewer's function which I use in a custom thread in Qt. My main problem is that when it crashes, it seems impossible to know which node is the problem because I can't see any thing clearly in my Visual Studio debugger. The stack is only talking about UpdateTraversal. So when you say UpdateTraversal is only for convenience, it means you can update a position or a stateset from anywhere in your code without any crash even in multi threaded modes ? Regards -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45707#45707 ___ 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] Fwd: Ambient Occlusion Implementation 2 review
Hi Robert, I hope you understand the major idea behind this implementation. May you are able to boost it massivly or you are able to better integrate this algorithm. regards adrian Am 11. Februar 2012 12:49 schrieb Frederic Bouvier fredlis...@free.fr: Hi Robert, Le 10/02/2012 16:45, Robert Osfield a écrit : Hi Adrian, I've not got most of the way through my submissions backlog - can finally see the light at the end of the tunnel :-) So I'm now in much better place to start looking at your Ambient Occlusion work. Do you have any updates to the source since the your code drop on the 21st of December? If you have any papers or webpages that explain the approach I'd welcome pointers to these as well. Adrian posted this link : http://webaddon3d.assoftware.ch/AE/SSAO/GPUPro2_Proposal_Adrian_Egli_CUBIC_SPLINE_BASED_AMBIENT_OCCLUSION.rar (tested today) there is a pdf file in it that describes his algorithm. Regards, -Fred ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Adrian Egli ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Texture update/write/modify in viewer loop
Hi, I'm trying to do motion blur just using OSG rather than osgPPU and I had intended to use the fragment shader from osgPPU which uses two textures holding the current and previous frames and mixes them together to produce the desired effect. All I need to do is store the current frame as the last frame after viewer.frame(). Or so I thought. My initial idea was just to write the current frame's texture image into the last frame's texture image, but this does nothing - the last frame's texture as displayed post-shader never changes. Is it a callback I need? If so what? Any help greatly appreciated. John -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45725#45725 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to prevent resize of viewer window (Windows and Linux)
Hi, I still haven't got to the bottom of this. Use the source? John -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45726#45726 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Counting OpenGL Draw calls in Stats
On 02/23/2012 05:22 AM, Robert Osfield wrote: The OSG doesn't have any stats collection on individual OpenGL draw calls, such low level instrumentation would be rather expensive to implement code wise and expensive w.r.t run-time cost. The best solution for this type of low level instrumentation is to use a wrapper around the OpenGL driver as suggested by others in this thread. Hi, Robert, I was afraid you'd say that :-) Thanks for the reply. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to prevent resize of viewer window (Windows and Linux)
On 02/23/2012 10:20 AM, John Simpson wrote: Hi, I still haven't got to the bottom of this. Use the source? Hi, John, You mentioned this is going to be cross-platform. Is your code not working on any platform? I looked at the relevant code in GraphicsWindowX11.cpp, and it seems like it should work (I haven't had time to test it myself, though). Bottom line is that every desktop platform has a way to mark a window as not resizeable, so this should be possible. If it's not working, it can be made to work. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Bug when using multiple instances of osgViewer::Viewer
Hi, I'm currently working on a QT based project which displays multiple scenes, each in its own widget. I therefore create a osgViewer::Viewer instance for every scene. As soon as I create the second viewer, the widget doesn't respond to mouse/keyboard events for exactly the amount of time elapsed between the creation of the first viewer and the second viewer. I tracked the problem down to osgViewer::Viewer.cpp line 538 (current SVN) where it says: / // initialize the global timer to be relative to the current time. osg::Timer::instance()-setStartTick(); Here the singleton timer is reset, which should only happen once in the application lifetime, not per viewer lifetime. I guarded that call with a global boolean and the problem went away. Would be great if someone with better knowledge of the osg internals could fix that issue properly. Regards Stefan / ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Bug when using multiple instances of osgViewer::Viewer
Hi Stefan, The original intention for osgViewer::Viewer usage would be that one would have one viewer running at the application at a time, and normally with just one viewer for the lifetime of the application. CompositeViewer is the class intended for applications with multiple views and multiple scenes, and it sounds like this would be appropriate for your application rather than Viewer. Is there a reason why you have used Viewer rather than CompositeViewer. As for the initialization of the singleton timer in Viewer::realize(), I don't think it would be appropriate to just initialize this on first call to viewer::realize() in the whole application. If an application wanted to create successive viewers then it's likely that the timer should be reset for each time. I can see instances where you might not want this to happen, so perhaps we'd need a means to switching this reset off, perhaps by passing in a feature mask or bool into viewer::realize() to tell it what it should, and then have a default value that retains the current behaviour to ensure backwards compatibility. Robert. On 23 February 2012 17:33, Stefan Klug klug.ste...@gmx.de wrote: Hi, I'm currently working on a QT based project which displays multiple scenes, each in its own widget. I therefore create a osgViewer::Viewer instance for every scene. As soon as I create the second viewer, the widget doesn't respond to mouse/keyboard events for exactly the amount of time elapsed between the creation of the first viewer and the second viewer. I tracked the problem down to osgViewer::Viewer.cpp line 538 (current SVN) where it says: // initialize the global timer to be relative to the current time. osg::Timer::instance()-setStartTick(); Here the singleton timer is reset, which should only happen once in the application lifetime, not per viewer lifetime. I guarded that call with a global boolean and the problem went away. Would be great if someone with better knowledge of the osg internals could fix that issue properly. Regards Stefan ___ 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] osgexport - new version
Hi, There is a new version of the openscenegraph exporter for blender. https://github.com/cedricpinson/osgexport/tree/master/blender-2.5/build The multi material bug is fixed and we have the skinning animation support back. Thanks to all contributors https://github.com/cedricpinson/osgexport Cedric Cedric Pinson Provide OpenGL, WebGL services +33 659 598 614 - http://cedricpinson.com - http://osgjs.org - http://showwebgl.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Bug when using multiple instances of osgViewer::Viewer
Hi Robert, I can't speak for Stefan in regards to the design choice of multiple Viewers rather than a CompositeViewer, but we made the same choice in our system. The reason is that our application provides functionality via a plugin system, and ideally plugins can be agnostic about what other plugins are doing. It is not uncommon for multiple plugin modules running simultaneously to use the OSG for rendering, and it was much simpler to let each plugin create a Viewer if it so desired - and for us, it works great. Cheers, Tom -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45733#45733 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Bug when using multiple instances of osgViewer::Viewer
Hi Robert, thanks for your quick response. The reason for me, not to use CompositeViewer was my limited knowledge and that it wasn't used in the first qt sample I got at my hands :-) - a bullet proof and simple QOsgWidget would be a real kickstarter. In CompositeViewer at first glance I was missing something analog to Viewer::setSceneData. Now after a bit more digging, the image suddenly became clear and I finally understand why there is only one osgQt::setViewer() and the Heartbeat class is hidden :-) Still I'm not sure if it doesn't make sense to create multiple distinct viewers without any shared state. (Tom posted a reasonable example) In this case I think the Viewer should either use its own timer, or be a Singleton. This would prevent mistakes like the one I did. Thanks a lot for your help. Regards Stefan Am 23.02.2012 um 18:44 schrieb Robert Osfield: Hi Stefan, The original intention for osgViewer::Viewer usage would be that one would have one viewer running at the application at a time, and normally with just one viewer for the lifetime of the application. CompositeViewer is the class intended for applications with multiple views and multiple scenes, and it sounds like this would be appropriate for your application rather than Viewer. Is there a reason why you have used Viewer rather than CompositeViewer. As for the initialization of the singleton timer in Viewer::realize(), I don't think it would be appropriate to just initialize this on first call to viewer::realize() in the whole application. If an application wanted to create successive viewers then it's likely that the timer should be reset for each time. I can see instances where you might not want this to happen, so perhaps we'd need a means to switching this reset off, perhaps by passing in a feature mask or bool into viewer::realize() to tell it what it should, and then have a default value that retains the current behaviour to ensure backwards compatibility. Robert. On 23 February 2012 17:33, Stefan Klug klug.ste...@gmx.de wrote: Hi, I'm currently working on a QT based project which displays multiple scenes, each in its own widget. I therefore create a osgViewer::Viewer instance for every scene. As soon as I create the second viewer, the widget doesn't respond to mouse/keyboard events for exactly the amount of time elapsed between the creation of the first viewer and the second viewer. I tracked the problem down to osgViewer::Viewer.cpp line 538 (current SVN) where it says: // initialize the global timer to be relative to the current time. osg::Timer::instance()-setStartTick(); Here the singleton timer is reset, which should only happen once in the application lifetime, not per viewer lifetime. I guarded that call with a global boolean and the problem went away. Would be great if someone with better knowledge of the osg internals could fix that issue properly. Regards Stefan ___ 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] How to prevent resize of viewer window (Windows and Linux)
Jason I know it's possible if I dig into the windowing system for a specific platform, but I was hoping to do it using an OSG cross-platfom method (see first post). The app's developing and I'm now using a CompositeViewer for which I'm explicitly creating a GraphicsContext so I have access to the supportsResize trait and it still resizes (on both platforms). I'll stop pestering this thread now and do it the long way. John -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45739#45739 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org