[osg-users] new Trackball coordinate system
Hi all, has anyone successfully changed the default coordinate system of the new (svn) osg manipulators? I just want the camera to start up in the default OpenGL coordinate frame: y-up, x-right, -z-forward. I've been trying to set a CoordinateFrameCallback on trackball. Firstly, it seems that viewer.setCameraManipulator overwrites my setting. So I attached my callback after I set it on the viewer, but then my callback never gets called. If I call setVerticalAxisFixed(true) on the trackball, my callback gets called, but I get all sorts of flipping going on and it does not seem to affect the home position in any way (when space is pressed). Any help appreciated. jp -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Enable/Disable stereo during runtime
Hi, i want to enable and disable stereo in my application during runtime. Do i have to destroy the old graphic context and create a new one or is there an easier way? Thank you! Cheers, Andreas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30856#30856 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Parallel draw on a multi-core, single GPU architecture
Hi all, we have a performance problem where the draw thread seems to be the bottleneck. The target hw has 8 cores and a single GPU. We already run cull and draw in parallel but parallelizing draw itself would also help. So I tried following setup: 2 windows 2 cameras (each on one window) threading model: CullThreadPerCameraDrawThreadPerContext In this mode, I can see that I have two cull and two draw threads and they are assigned to separate cores. However, the performance is 1/2 of my original setup. Setting OSG_SERIALIZE_DRAW_DISPATCH to ON or OFF does not make any difference. Is there anything else I have to do to get good performance from above setup (e.g. some more env. vars to set)? Or should I try something completely different? thanks, tugkan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Integrating OSG with an existing OpenGL solution.
Hi all, and thanks for your support so far. We are using OpenSceneGraph for creating model views for a muscular-skeletal simulation software package, which has worked really well so far. We have had a number of inquiries if it would be possible to make this modelview available to other external applications. In particular CAD and VR systems. These systems may or may not be using OpenSceneGraph, and we are wondering if it would be possible to offer integration of our OSG context into an OpenGL system in some way. The most basic idea would be to just export our OSG model tree to them, and thus force them to use OpenSceneGraph in their systems, but for a number of CAD systems that would not be feasible. We also thought of having our API being able to accept a handle to an OpenGL context and using it for drawing the OSG content in. This would of course not offer integration of our OSG-based modelview and their existing OpenGL content in the same graphic window, but I don't know if that easily possible in any way at all. We are currently just discussing what would be possible, so if anyone has any ideas as to what can be done to offer this kind of integration, we would appreciate any thoughts about it. Regards, and thanks in advance Jesper D. Thomsen AnyBody Technology A/S ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Enable/Disable stereo during runtime
Hi Andreas, On Tue, Aug 17, 2010 at 4:54 PM, Andreas Roth andreas.r...@fastprotect.net wrote: i want to enable and disable stereo in my application during runtime. Do i have to destroy the old graphic context and create a new one or is there an easier way? It all depends on how you are doing stereo - anaglyphic and interleaved techniques won't need a context, but will need a reset of the rendering backend, while quad buffer will need a new context, and split screen most likely will need a new context but not always. The osgViewer as it's set up right now doesn't know about stereo so doesn't about toggling on/off, so you'll need grapple with the internal details in SceneView if want to reuse the context. Robert, ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Parallel draw on a multi-core, single GPU architecture
Hi Tugkan, It only ever makes sense to parallelize draw dispatch when you have multiple graphics cards and one context per graphics card. Trying to add more threads than OpenGL/graphics card can handle will just stall things and result in lower performance. If your draw dispatch is overloaded then consider optimizing your scene graph. There are many ways of doings, which way that might appropriate will depend entirely on the needs of your scenes and your application. Since I don't know anything about these specifics I can't provide any direction. Robert. On Wed, Aug 18, 2010 at 9:14 AM, Tugkan Calapoglu tug...@vires.com wrote: Hi all, we have a performance problem where the draw thread seems to be the bottleneck. The target hw has 8 cores and a single GPU. We already run cull and draw in parallel but parallelizing draw itself would also help. So I tried following setup: 2 windows 2 cameras (each on one window) threading model: CullThreadPerCameraDrawThreadPerContext In this mode, I can see that I have two cull and two draw threads and they are assigned to separate cores. However, the performance is 1/2 of my original setup. Setting OSG_SERIALIZE_DRAW_DISPATCH to ON or OFF does not make any difference. Is there anything else I have to do to get good performance from above setup (e.g. some more env. vars to set)? Or should I try something completely different? thanks, tugkan ___ 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] Integrating OSG with an existing OpenGL solution.
Hi Jasper, It is possible to integration the OSG with an existing OpenGL context, see the osgviewerSDL and osgviewerGLUT examples use of GraphicsWindowEmbedded to do this. If the 3rd party app is doing it's own OpenGL work then things get more complicated as you'll need to make sure the OpenGL state isn't carried over from the 3rd party code to the OSG and from the OSG to the 3rd party code. The later is a bit awkward to achieve but possible - others are doing it. Have a read through the archives on the topic for discussion how. Robert. On Wed, Aug 18, 2010 at 9:20 AM, Jesper D. Thomsen j...@anybodytech.com wrote: Hi all, and thanks for your support so far. We are using OpenSceneGraph for creating model views for a muscular-skeletal simulation software package, which has worked really well so far. We have had a number of inquiries if it would be possible to make this modelview available to other external applications. In particular CAD and VR systems. These systems may or may not be using OpenSceneGraph, and we are wondering if it would be possible to offer integration of our OSG context into an OpenGL system in some way. The most basic idea would be to just export our OSG model tree to them, and thus force them to use OpenSceneGraph in their systems, but for a number of CAD systems that would not be feasible. We also thought of having our API being able to accept a handle to an OpenGL context and using it for drawing the OSG content in. This would of course not offer integration of our OSG-based modelview and their existing OpenGL content in the same graphic window, but I don’t know if that easily possible in any way at all. We are currently just discussing what would be possible, so if anyone has any ideas as to what can be done to offer this kind of integration, we would appreciate any thoughts about it. Regards, and thanks in advance Jesper D. Thomsen AnyBody Technology A/S ___ 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] Parallel draw on a multi-core, single GPU architecture
Hi Robert, thanks for the answer. Our scene graph is heavily optimized and there doesn't seem to be any serious optimization possibilities. Maybe a few percent improvement from here and there. We observe that, as our databases grow, the performance requirement for draw thread grows faster than cull. In the long run, draw will be a serious limiting factor for us. So I wanted to see if we can take advantage of hardware to solve the problem. tugkan Hi Tugkan, It only ever makes sense to parallelize draw dispatch when you have multiple graphics cards and one context per graphics card. Trying to add more threads than OpenGL/graphics card can handle will just stall things and result in lower performance. If your draw dispatch is overloaded then consider optimizing your scene graph. There are many ways of doings, which way that might appropriate will depend entirely on the needs of your scenes and your application. Since I don't know anything about these specifics I can't provide any direction. Robert. On Wed, Aug 18, 2010 at 9:14 AM, Tugkan Calapoglu tug...@vires.com wrote: Hi all, we have a performance problem where the draw thread seems to be the bottleneck. The target hw has 8 cores and a single GPU. We already run cull and draw in parallel but parallelizing draw itself would also help. So I tried following setup: 2 windows 2 cameras (each on one window) threading model: CullThreadPerCameraDrawThreadPerContext In this mode, I can see that I have two cull and two draw threads and they are assigned to separate cores. However, the performance is 1/2 of my original setup. Setting OSG_SERIALIZE_DRAW_DISPATCH to ON or OFF does not make any difference. Is there anything else I have to do to get good performance from above setup (e.g. some more env. vars to set)? Or should I try something completely different? thanks, tugkan ___ 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 -- Tugkan Calapoglu - VIRES Simulationstechnologie GmbH Oberaustrasse 34 83026 Rosenheim Germany phone+49.8031.463641 fax +49.8031.463645 emailtug...@vires.com internet www.vires.com - Sitz der Gesellschaft: Rosenheim Handelsregister Traunstein HRB 10410 Geschaeftsfuehrer: Marius Dupuis Wunibald Karl - ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Parallel draw on a multi-core, single GPU architecture
Hi Tugkan, On Wed, Aug 18, 2010 at 9:49 AM, Tugkan Calapoglu tug...@vires.com wrote: We observe that, as our databases grow, the performance requirement for draw thread grows faster than cull. In the long run, draw will be a serious limiting factor for us. So I wanted to see if we can take advantage of hardware to solve the problem. Does this not point out that perhaps the scene graph is become less well balanced over time? I'd look closely at what in the draw dispatch is becoming the bottleneck and how to manage this more efficient. Typically the best way to reduce draw dispatch is to batch the geometry and state in more coarsed grained way. One can also use different approaches to achieve the same/similar results. For instance perhaps you can cull more effectively, or perhaps introduce LOD more effectively. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Parallel draw on a multi-core, single GPU architecture
Hi Robert, our databases are for driving simulation and they are usually city streets. We have been employing batching and occlusion culling with very good results so far. Extensive use of LOD's is problematic because 1- They actually reduce performance in most of the cases 2- The switching effect (even the slightest) is found very disturbing by the customers. So with LOD's we are somewhat conservative (but we use them nevertheless) Actually, draw always required more time than cull. If you look OSG examples, draw usually takes more time than cull. Now that draw reaches 16 ms border, this started to hurt us. I think I should retract my sentence from previous email. Draw is not slowing down faster than cull; I did not really make such an observation. My actual observation is that, both cull and draw require more CPU time with larger scenes, but since draw is generally more performance hungry, it becomes bottleneck earlier. tugkan Hi Tugkan, On Wed, Aug 18, 2010 at 9:49 AM, Tugkan Calapoglu tug...@vires.com wrote: We observe that, as our databases grow, the performance requirement for draw thread grows faster than cull. In the long run, draw will be a serious limiting factor for us. So I wanted to see if we can take advantage of hardware to solve the problem. Does this not point out that perhaps the scene graph is become less well balanced over time? I'd look closely at what in the draw dispatch is becoming the bottleneck and how to manage this more efficient. Typically the best way to reduce draw dispatch is to batch the geometry and state in more coarsed grained way. One can also use different approaches to achieve the same/similar results. For instance perhaps you can cull more effectively, or perhaps introduce LOD more effectively. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Tugkan Calapoglu - VIRES Simulationstechnologie GmbH Oberaustrasse 34 83026 Rosenheim Germany phone+49.8031.463641 fax +49.8031.463645 emailtug...@vires.com internet www.vires.com - Sitz der Gesellschaft: Rosenheim Handelsregister Traunstein HRB 10410 Geschaeftsfuehrer: Marius Dupuis Wunibald Karl - ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Enable/Disable stereo during runtime
Thanks Robert! I'm using quad buffer stereo and to enable or disable i have to create a new graphic context. At the moment i trying to recreate a graphic context using the following ops: - remove my osgViewer::View instance from my osgViewer::CompositeViewer instance - remove all osgGA event handlers (e.g. HelpHandler) from my view - set the camera manipulator to NULL on my view - set the graphics context for the camera in my view to NULL - calling close on my current graphic context instance - set up osg::GraphicsContext::Traits with changed params - calling osg::GraphicsContext::createGraphicsContext - set the new graphics context for the camera in my view - recreate all event handlers - reset camera manipulator - add my view to my viewer instance After i've recreate the graphic context the render screen remains blank. Any idea what else i have to do to get it working with the new graphic context? Regards, Andreas [/list] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30873#30873 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Parallel draw on a multi-core, single GPU architecture
Hi Tugkan, On Wed, Aug 18, 2010 at 10:39 AM, Tugkan Calapoglu tug...@vires.com wrote: Actually, draw always required more time than cull. If you look OSG examples, draw usually takes more time than cull. Now that draw reaches 16 ms border, this started to hurt us. It is typical for cull to be shorted than draw dispatch, which ever traversal is breaking frame will be the one you need to address. Thinking that you can thread draw dispatch to make it faster is not going to help though as it will do more harm than good as it's the actually just dispatching data to the OpenGL fifo, filling it from two threads will just cause lots of issues in OpenGL driver that has to manage two contexts and card as well as CPU cache coherency. I must add that draw dispatch is a little complex to profile though as it depends upon the being able to fill the OpenGL fifo, and if the fifo fills up it'll block the draw dispatch. This effect can lead to the draw dispatch looking like it's breaking frame but it's actually the OpenGL driver/graphics card that is the bottleneck. My actual observation is that, both cull and draw require more CPU time with larger scenes, but since draw is generally more performance hungry, it becomes bottleneck earlier. This is something one would expect, ideally you'd have LOD'ing to keep the large scenes well balanced - for instance it's possible to LOD the whole earth and use paging and still get 60Hz, so while you might have Terrabytes of data the app only has what it memory what it needs with the complexity kept relatively even throughout the database. High fidelity town database will of course push things more than usual terrain paging app, but the same principles can apply, although one might need to get more creative with the LOD generation and management. For yourselves LOD'ing may not be an appropriate solution, or even required. I believe the key question you need to ask is why draw dispatch is getting so expensive. Is it the OpenGL fifo blocking? Is it that you have too much separate state? Too many transforms? Too many separate drawables? Solutions will vary depending upon what is the bottleneck so it's important to work to pinpoint it. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Visualizing 3D-Points including standard deviation
Hi, I need to visualize points in 3D, whose positions are Gauss distributed. The expected values and the standard deviations for each x, y and z coordinate are given. So, how can I do that with OSG? I could draw a sphere (using osg::SphereDrawable) with a fixed radius at the center and another transparent sphere around it for visualizing the standard deviation. But that doesn't look nice... What I'm looking for is some kind of 3D-radial gradient. The transparency should increase along the gradient accourding to the Gaussian distribution function. Note, that the standard deviation can be different for each dimension. I'm a newbie in OSG and not an OpenGL expert. Some example code would be really helpful. Thank you Sincerely, Felix -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30872#30872 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to use osgvolume in an SDL application?
Hi, Thank you Robert for replying so quick! I appreciate it. Cheers, Boubacar from Mali, West Africa -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30876#30876 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Proximity Queries between objects
Hi, I tried the following code: Code: //BoundingSphere using computeBound() osg::BoundingSphere bh1Sphere = backhoe1Group-computeBound(); osg::BoundingSphere bh1PATSphere = backhoe1PAT-computeBound(); //BoundingSpere using computeBound(): osg::BoundingSphere bh2Sphere = backhoe2Group-computeBound(); osg::BoundingSphere bh2PATSphere = backhoe2PAT-computeBound(); .. float x1, x2, y1, y2, distance; if(bh1Sphere.intersects(bh2Sphere)) { std::cout The backhoes are colliding !! std::endl; x1 = bh1Sphere.center().x(); x2 = bh2Sphere.center().x(); y1 = bh1Sphere.center().y(); y2 = bh2Sphere.center().y(); distance = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)); std::cout distance = distance; std::cout std::endl; } else { x1 = bh1Sphere.center().x(); x2 = bh2Sphere.center().x(); y1 = bh1Sphere.center().y(); y2 = bh2Sphere.center().y(); distance = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)); std::cout distance = distance; std::cout std::endl; } However, both the spheres (1 and 2) have the same centre coordinates. When I try the same thing using spheres that are bounds for the top-most PATNodes, I again get the same result (i.e. centre coordinates are the same). I find this confusing as both the nodes have different positions. Is this a sensible approach to take though ? Cheers, Sanat -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30880#30880 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Proximity Queries between objects
Hi Sanat -- I posted to osgBullet-users with a possible fix for your osgBullet crash, but didn't see a reply from you. Did my suggestion resolve the issue you were encountering? -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Setting alpha to a group node
Hi, I'm still fairly new to OSG and finding my way around. I have a little problem that I need done very quickly, so hope someone can help. I'm trying to apply alpha to a group node so it affects all geometry under it while preserving their other material properties. I've loaded a .lwo model, that comes with its own materials. It has several different materials applied to its various parts. I need to control the transparency of the whole model at once. I can make a new osg::Material, set the alpha and apply it to the top node, that works, but then I lose all the materials the model came with, and gives me default greys. How can I just modify the alpha of the whole thing and leave the rest alone? I've tried 'getting' the material and setting the alpha to that, but it crashes on the setAlpha call. (Although I'm probably handling something wrong there, since there are several materials involved, not just one). Do I need to recurse thru the model's scene graph, get each material, and set alpha individually? If thats the case, ok, but could someone show me some quick code to do that? Like I said, I've been crashing on setting alpha in the material I 'get', and also I've never recursed thru an imported model before, (which I will eventually need to do anyway). Any help is appreciated Thank you! Cheers, Phil -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30882#30882 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Open Scene Graph Training
Greetings! I found out through the Khronos web site that there is going to be an Open Scene Graph Corse offered in Seattle on Oct 5th-7th by Bob Kuehne. Did anyone else knew about this? ... D Glenn D Glenn (a.k.a David Glenn) - Join the Navy and See the World ... from your Desk! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30883#30883 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Open Scene Graph Training
hi david, thanks for the re-post - i *did* know about this. ;) i thought i posted a few weeks back. if it didn't make it through everyone's filters, then here it is again! two weeks remain for discounted pricing, and it'll be a good course. we've given this course for a number of years, and it's fast-paced, in-depth, and eye-opening (that means we're providing coffee). full pricing begins on 09/02/10. -- Tech Soup announces open registration for its next OpenSceneGraph (OSG) course, October 5-7, 2010, in South Lake Union, Seattle, Washington. This class will teach students everything to be proficient in OSG in a 3-day intensive course. This course covers everything developers need to know to take maximum advantage of OpenSceneGraph from intermediate through advanced. We'll also take a tour through VirtualPlanetBuilder so you can build geospecific, tiled, paged datasets. This three-day course teaches the fundamentals of OpenSceneGraph. Developers attending the course learn the mechanisms behind effective development from scenegraph creation and manipulation through debugging optimizing. Through instruction and labs, students build scenes and interact with real code from day one. The course is fast-paced, requires creativity and problem solving, and leaves users with a thorough immersion in OpenSceneGraph. Instruction is hands-on with numerous labs where students directly turn concepts into practical knowledge. full details, hotel, and travel info: http://techsoupcorp.com/news/osg-080210-pr.html -- there are still seats available, hope you can join us! bob On Aug 18, 2010, at 12:08 PM, David Glenn wrote: Greetings! I found out through the Khronos web site that there is going to be an Open Scene Graph Corse offered in Seattle on Oct 5th-7th by Bob Kuehne. Did anyone else knew about this? ... D Glenn D Glenn (a.k.a David Glenn) - Join the Navy and See the World ... from your Desk! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30883#30883 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org bob kuehne ceo - blue newt software www.blue-newt.com734/834-2696 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Setting alpha to a group node
Have you considered setting BlendColor at the parent Group node and using one of the blend function parameters that use constant color? -Paul Phil Fugue wrote: Hi, I'm still fairly new to OSG and finding my way around. I have a little problem that I need done very quickly, so hope someone can help. I'm trying to apply alpha to a group node so it affects all geometry under it while preserving their other material properties. I've loaded a .lwo model, that comes with its own materials. It has several different materials applied to its various parts. I need to control the transparency of the whole model at once. I can make a new osg::Material, set the alpha and apply it to the top node, that works, but then I lose all the materials the model came with, and gives me default greys. How can I just modify the alpha of the whole thing and leave the rest alone? I've tried 'getting' the material and setting the alpha to that, but it crashes on the setAlpha call. (Although I'm probably handling something wrong there, since there are several materials involved, not just one). Do I need to recurse thru the model's scene graph, get each material, and set alpha individually? If thats the case, ok, but could someone show me some quick code to do that? Like I said, I've been crashing on setting alpha in the material I 'get', and also I've never recursed thru an imported model before, (which I will eventually need to do anyway). Any help is appreciated Thank you! Cheers, Phil -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30882#30882 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- -Paul Martz Skew Matrix Software http://www.skew-matrix.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Open Scene Graph Training
It was posted here two weeks ago. Search the archives for the thread osg course: oct 5-7, seattle, wa. -Paul David Glenn wrote: Greetings! I found out through the Khronos web site that there is going to be an Open Scene Graph Corse offered in Seattle on Oct 5th-7th by Bob Kuehne. Did anyone else knew about this? ... D Glenn D Glenn (a.k.a David Glenn) - Join the Navy and See the World ... from your Desk! ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgPlugins] osgAnimation update and procedural animation
Hi, I am using osg in Python using the osgSWIG wrrappers. I have recently updated to the latest osg (2.9.9) and updated osgSWIG appropriately. Anyway I have now hit all the changes in osgAnimation and am trying to make my code work again. Firstly I should say that a lot of bugs seems to have been fixed so I got to remove a load of work-arounds. Good work! However I am now having difficulty with my bone updates. My old code (inside a BoneUpdate object derived off NodeCallback) looked like this: Code: def update( self, bone ): try: if bone.needToComputeBindMatrix(): bone.computeBindMatrix() if self._index != -1: val = self._stateVector[self._index] x = osg.Vec3(1,0,0) y = osg.Vec3(0,1,0) z = osg.Vec3(0,0,1) q = osg.Quat(-val[1],y,-val[0],x,val[2],z) bone.setRotation(q) bone.dirtyBound() parent = bone.getBoneParent() if parent != None: bone.setMatrixInSkeletonSpace(bone.getMatrixInBoneSpace() * parent.getMatrixInSkeletonSpace()) else: bone.setMatrixInSkeletonSpace(bone.getMatrixInBoneSpace()) except: print Error updating Bone, sys.exc_info() and I have managed to get as far as this: Code: def update( self, bone ): try: if self._index != -1: val = self._stateVector[self._index] x = osg.Vec3(1,0,0) y = osg.Vec3(0,1,0) z = osg.Vec3(0,0,1) q = osg.Quat(-val[1],y,-val[0],x,val[2],z) m = bone.getMatrix() m.setRotate(q) bone.setMatrix(m) parent = bone.getBoneParent() if parent != None: bone.setMatrixInSkeletonSpace(bone.getMatrix() * parent.getMatrixInSkeletonSpace()) else: bone.setMatrixInSkeletonSpace(bone.getMatrix()) except: print Error updating Bone, sys.exc_info() But the rotations are all messed up. It looks like something I was doing was baking a rotation either in to the bone space transformation or in to the inverse skinning transformation, and I was wondering if it is obvious to anyone what I need to change. On a related note, would it be possible to rename the package in the Blender exporter from osg to something else (like osgExp). This would avoid clashes with osgSWIG. Thanks! Joe[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30888#30888 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Setting alpha to a group node
Paul Martz wrote: Have you considered setting BlendColor at the parent Group node and using one of the blend function parameters that use constant color? -Paul Thanks for your response. No I havent considered this. I dont understand how it will accomplish what I'm looking for. Can you elaborate? I'm looking for alpha, there's lots of geometry in front of eaach other. Blending with a constant color wont simulate transparency, if I'm understanding you correctly. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30889#30889 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Setting alpha to a group node
Phil Fugue wrote: Paul Martz wrote: Have you considered setting BlendColor at the parent Group node and using one of the blend function parameters that use constant color? -Paul Thanks for your response. No I havent considered this. I dont understand how it will accomplish what I'm looking for. Can you elaborate? I'm looking for alpha, there's lots of geometry in front of eaach other. Blending with a constant color wont simulate transparency, if I'm understanding you correctly. You should learn OpenGL, I suggest the red book (the programming guide). The (IMO more useful) blue book is available online: http://www.opengl.org/sdk/docs/man/ ...and some browsers even display the formulas correctly. :-( GL_CONSTANT_ALPHA,GL_ONE_MINUS_CONSTANT_ALPHA are the blending coefficients you'd typically use for this, they will reference the alpha from your (one) BlendColor, but the rgb components will come from your (multiple) primitives. -- -Paul Martz Skew Matrix Software http://www.skew-matrix.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OpengGLES build failed
Hi Robert, I'm trying to build OSG with the android ndk (android-ndk-r4-crystax). I have made some changes in the code to allow the build, but I think recent changes in Texture.cpp have broken the build against GLES/GLES2. /Users/rgaitan/Projects/OSG/osg-trunk/src/osg/Texture.cpp: In member function 'void osg::Texture::applyTexImage2D_load(osg::State, GLenum, const osg::Image*, GLsizei, GLsizei, GLsizei) const': /Users/rgaitan/Projects/OSG/osg-trunk/src/osg/Texture.cpp:1600: error: 'GL_RED' was not declared in this scope. I'm not sure how to achieve the change, maybe adding and #ifdef and checking if GLES/GLES2 is active? The other changes I have are only to allow ndk gcc compiler build correctly so they are minor changes, but the change on Texture.cpp affects functionality and I'm not sure which is the better way to achieve it. Once I have things working I will post on osg-submission the changes ;) Greets, Rafa. -- Rafael Gaitán Linares Instituto de Automática e Informática Industrial http://www.ai2.upv.es http://gvsig3d.blogspot.com Ciudad Politécnica de la Innovación Universidad Politécnica de Valencia ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::Array
Hi, Okay... I get indices like that: _indices = temp-asGroup()-getChild(0)-asGroup()-getChild(i)-asGeode()-getDrawable(0)-asGeometry()-getPrimitiveSet(0); //temporary; data existence is checked; i know it's bad and then indices[i] = (int*)(*_indices).getDataPointer(); //copy to 2-dimensional array by mesh index It compiles, renders. But it does render weird bunch of polygons. So my question is: Is there mistake with indices copying, or should i review my rener code?(i did some major fixes to render models, loaded with new importer, but maybe i missed something). Thank you! Cheers, Igor -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30892#30892 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [forum] Building a scene graph for several thousand objects
Hi all, First of all, thanks to the folks who built this library. I'm building a 3D game engine based on osg::CompositeViewer featuring rather larger worlds built using cubes. I've attached an image of what I'm trying to create. I was using ShapeDrawable for the blocks until I read I would get faster rendering by building the geometry myself using vertex arrays. I've implemented something like an octree to create a balanced tree upon level load. The nodes of the tree are Group objects and the leaves are Geode objects with multiple Geometry objects attached (the faces of each block.) Empty cells are culled. The minimum cell size for the octree division is 2x2x2 (so a leaf node can contain up to 8 blocks). The octree doesn't seem to have given me much of a performance boost in the culling department. I am guessing this is because the leaves of the tree contain so many geometry objects? I've had a read of the forum and google and have come to the conclusion I should do something like the following to improve performance: 1. Group up my geometry objects to perform batch rendering - i.e. render more than a single face of a single block in one go. How can I do this? Do I need to create a single geometry object containing vertex arrays etc of a whole chunk of block faces? 2. Re-use a single geometry object for block faces. Apparently there is code in osgParticle::PrecipitationEffect which does this - although I haven't checked it out yet. 3. Instanced rendering I'm not sure quite what this is about, but is what osg::Impostor does? I just had a look at osgimpostor.exe for the first time while writing this, and it seems pretty close to what I want to achieve. Anyway I've kinda answered some of my own questions in writing this, but I would be thankful for some clarification on the finer points. I'll be digging into osgimpostor now anyway. :D Cheers, David W -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30514#30514 Attachments: http://forum.openscenegraph.org//files/deditor_156.png ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Open Scene Graph Training
Paul Martz wrote: It was posted here two weeks ago. Search the archives for the thread osg course: oct 5-7, seattle, wa. -Paul ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum Well, Silly me! :-* I used the word Training in my search! I worked for the Navy so long that now I know I must the world Training tattooed on my Brain some ware! Well, Now we have the words Open Scene Graph Training covered on this board, I'll see you in October, Bob! Laters, Paul! D Glenn (a.k.a David Glenn) - Join the Navy and See the World ... from your Desk! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30894#30894 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Setting alpha to a group node
Paul, That did the trick. Thanks for the help. I've programmed some OpenGl in the past, but yes, my knowledge/experience with it is patchy. I own the Programming Guide, but was not aware of the online book, so thanks for the link. I've worked with blend functions before, but never heard of blendcolor or the constant color. Now I see those are part of an extension (imaging subset) Thanks again. Phil -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30895#30895 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Displaying OSG data in MFC window
Hi everyone, I am new to both MFC and OSG. I am displaying the 3D point cloud in OSG. I want to display this osg data in the window provided by the MFC. Is there any way to do it? Please reply... ... Thank you! Cheers, Snehal -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30896#30896 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpengGLES build failed
Rafa Gaitan wrote: Hi Robert, I'm trying to build OSG with the android ndk (android-ndk-r4-crystax). I have made some changes in the code to allow the build, but I think recent changes in Texture.cpp have broken the build against GLES/GLES2. /Users/rgaitan/Projects/OSG/osg-trunk/src/osg/Texture.cpp: In member function 'void osg::Texture::applyTexImage2D_load(osg::State, GLenum, const osg::Image*, GLsizei, GLsizei, GLsizei) const': /Users/rgaitan/Projects/OSG/osg-trunk/src/osg/Texture.cpp:1600: error: 'GL_RED' was not declared in this scope. I'm not sure how to achieve the change, maybe adding and #ifdef and checking if GLES/GLES2 is active? The other changes I have are only to allow ndk gcc compiler build correctly so they are minor changes, but the change on Texture.cpp affects functionality and I'm not sure which is the better way to achieve it. Once I have things working I will post on osg-submission the changes ;) Hi, Rafa, Great to hear someone is working on Android! Just curious, how are you handling osgViewer? I tried to get an Android NDK build going with the crystax version as well, but I ran into a brick wall as soon as I got past osgUtil. I didn't have time to try and work through it, so I had to give up. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::Array
Igor Lebedev wrote: Hi, Okay... I get indices like that: _indices = temp-asGroup()-getChild(0)-asGroup()-getChild(i)-asGeode()-getDrawable(0)-asGeometry()-getPrimitiveSet(0); //temporary; data existence is checked; i know it's bad and then indices[i] = (int*)(*_indices).getDataPointer(); //copy to 2-dimensional array by mesh index Just to make sure you understand everything, some primitive sets include an index list, and others don't. You'll need to be sure you're accessing one of the DrawElements primitive sets to be able to get an index list. If you're sure your PrimitiveSet is a DrawElements, try this instead: indices[i] = (*_indices)[i]; or indices[i] = _indices-at(i); The first version is a direct access (and might be slightly quicker), and the second will do range checking and will throw an exception if you try to access something outside the bounds of the list. The DrawElements class itself is a descendant of std::vector, so you can just access it using the standard vector methods. You don't need to go all the way down to the data pointer. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpengGLES build failed
Hi Jason, Hi, Rafa, Great to hear someone is working on Android! Just curious, how are you handling osgViewer? I tried to get an Android NDK build going with the crystax version as well, but I ran into a brick wall as soon as I got past osgUtil. I didn't have time to try and work through it, so I had to give up. My first approach is trying to get all built, I've made some changes into CMake for osgViewer, to not build if the system is not supported. I know is not the best approach, but I thing that using GraphicsWindowsEmbedded and using android sdk/ndk to create the graphics context is a first and quick way to test if things work on Android. Tthis approach works in Java with gvSIG 3D and osgVirtualPlanets, so I hope will also work on Android! :). Rafa. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Rafael Gaitán Linares Instituto de Automática e Informática Industrial http://www.ai2.upv.es http://gvsig3d.blogspot.com Ciudad Politécnica de la Innovación Universidad Politécnica de Valencia ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Building a scene graph for several thousandobjects
Hi, David, David Wilson wrote: Hi all, First of all, thanks to the folks who built this library. I'm building a 3D game engine based on osg::CompositeViewer featuring rather larger worlds built using cubes. I've attached an image of what I'm trying to create. I was using ShapeDrawable for the blocks until I read I would get faster rendering by building the geometry myself using vertex arrays. I've implemented something like an octree to create a balanced tree upon level load. The nodes of the tree are Group objects and the leaves are Geode objects with multiple Geometry objects attached (the faces of each block.) Empty cells are culled. The minimum cell size for the octree division is 2x2x2 (so a leaf node can contain up to 8 blocks). The octree doesn't seem to have given me much of a performance boost in the culling department. I am guessing this is because the leaves of the tree contain so many geometry objects? Possibly. An octree design generally works well with a scene graph architecture, so the idea itself is a good one. I've had a read of the forum and google and have come to the conclusion I should do something like the following to improve performance: 1. Group up my geometry objects to perform batch rendering - i.e. render more than a single face of a single block in one go. How can I do this? Do I need to create a single geometry object containing vertex arrays etc of a whole chunk of block faces? Yeah, that's a start. You definitely don't want to have one Geometry per face. Ideally, you want to do as much as you can in one primitive set (each primitive set is a draw call, and you want to cut down on draw calls as much as possible). Obviously, you'll have to balance this goal with your octree design as well. 2. Re-use a single geometry object for block faces. Apparently there is code in osgParticle::PrecipitationEffect which does this - although I haven't checked it out yet. 3. Instanced rendering I'm not sure quite what this is about, but is what osg::Impostor does? I just had a look at osgimpostor.exe for the first time while writing this, and it seems pretty close to what I want to achieve. osg::Impostor is an older technique for representing relatively complex objects with a single billboard face. I don't think this will help you. Instanced rendering is different. It lets you draw multiple instances of the same object very efficiently by using a single copy of the vertex data and a vertex shader to do the positioning for each instance of the object (often, an additional vertex attribute is used to hold the position of each instance). Look at the osgdrawinstanced example for details. Hope this helps. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpengGLES build failed
Rafa Gaitan wrote: My first approach is trying to get all built, I've made some changes into CMake for osgViewer, to not build if the system is not supported. I know is not the best approach, but I thing that using GraphicsWindowsEmbedded and using android sdk/ndk to create the graphics context is a first and quick way to test if things work on Android. Tthis approach works in Java with gvSIG 3D and osgVirtualPlanets, so I hope will also work on Android! :). Yeah, that makes sense. Looking forward to it! --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::Array
Jason Daly wrote: Just to make sure you understand everything, some primitive sets include an index list, and others don't. You'll need to be sure you're accessing one of the DrawElements primitive sets to be able to get an index list. If you're sure your PrimitiveSet is a DrawElements, try this instead: indices[i] = (*_indices)[i]; or indices[i] = _indices-at(i); The first version is a direct access (and might be slightly quicker), and the second will do range checking and will throw an exception if you try to access something outside the bounds of the list. The DrawElements class itself is a descendant of std::vector, so you can just access it using the standard vector methods. You don't need to go all the way down to the data pointer. _indices is osg::PrimitiveSet, so it throws an error: error C2676: binary '[' : 'osg::PrimitiveSet' does not define this operator or a conversion to a type acceptable to the predefined operator So i've got the wrong primitive set?(i've checked final indices first 20 values. and they are: Code: Ind = 2066 Ind = 2064 Ind = 0 Ind = 2065 Ind = 2060 Ind = 2064 Ind = 2066 Ind = 166 Ind = 2065 Ind = 2066 Ind = 2065 Ind = 2064 Ind = 2066 Ind = 0 Ind = 2068 Ind = 2066 Ind = 2067 Ind = 166 Ind = 2067 Ind = 2068 pretty strange...) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30902#30902 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Dragger Updated Matrix
Hi, I'm having a scene with many osg::Nodes and i'm using the osgmanipulator selection and dragger to select an object and then the dragger to drag the object in the scene. I'm using the linesegmentintersector to check for the intersections and then to move the objects around the scene. I would like to know if there is a way to if I can check the selection of a particular node by the user and also how can I get the updated/transformed matrix of the node after is dragged and released. Thanks and hope to hear from you soon. Thank you! Cheers, Raj -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30903#30903 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::Array
Igor Lebedev wrote: _indices is osg::PrimitiveSet, so it throws an error: error C2676: binary '[' : 'osg::PrimitiveSet' does not define this operator or a conversion to a type acceptable to the predefined operator So i've got the wrong primitive set? Not necessarily. What you have is the base class PrimitiveSet. You'll need to cast it to one of its descendants (DrawElementsUShort, for example). If you don't know what kind of primitive set it is, the PrimitiveSet base class has a getType() method that will tell you the type (it returns an enumerated type osg::PrimitiveSet::Type). --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Proximity Queries between objects
Hello Sanat, However, both the spheres (1 and 2) have the same centre coordinates. When I try the same thing using spheres that are bounds for the top-most PATNodes, I again get the same result (i.e. centre coordinates are the same). I find this confusing as both the nodes have different positions. Is this a sensible approach to take though ? getBound() returns the local bounding sphere. You need to transform it by the matrices (transforms) from the root to each of your models respectively, then you'll get the world-space bounding sphere for each model. Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Displaying OSG data in MFC window
Hello Snehal, I am new to both MFC and OSG. I am displaying the 3D point cloud in OSG. I want to display this osg data in the window provided by the MFC. Is there any way to do it? Please reply... You can look in the OSG sources, there is an example called osgViewerMFC. In general, if you want to learn OSG, the examples are a good place to start, and their names even sometimes tell you what the example covers. :-) J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::Array
Hi, Ok. I did it like that. The same thing. Weird index values and bunch of polygons. So i should search in render function? Thank you! Cheers, Igor -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30909#30909 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] NITIN R (rangari.niti...@gmail.com) has sent you a private message
Title: Private Message from NITIN NITIN R has sent you a private message Click to read messagePlease read it or NITIN will think you ignored this :( This message has been forwarded at the request of rangari.niti...@gmail.com. To block all emails from FanIQ, please click here. FanIQ is located at 604 mission St, Suite 600, San Fran cisco, CA 94105, USA. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Displaying OSG data in MFC window
Thanks.. But I am able to find this example. The link i found is not working. Can you plz post the link here? Sorry for bothering again... Thank you! Cheers, snehal -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30913#30913 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org