[osg-users] Geometry kernels?
I'm looking for comments and suggestions for using OSG with a geometry engine like ACIS, Parasolid, or Open Cascade. Can they work well together? Is it a useful combination? The application is CAD-like and involves interactively building up a model from discrete components. I found OSG when looking for HOOPS competitors. Is it fair to compare HOOPS with OSG? Thanks, Cory PGP.sig Description: PGP signature ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Problem with pointlightmanip.exe example?
I've been running the pointlightmanip.exe example and as soon as I rotate even a tiny amount (using either the hand or the wheels), the top right sphere disappears. I've attached a screenshot but I suspect that will get filtered out by the list software. Is this an instance of http://www.vis-sim.com/osg/osg_faq_1.htm#f22 ? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Problem with pointlightmanip.exe example?
Cory Riddell wrote: I've been running the pointlightmanip.exe example and as soon as I rotate even a tiny amount (using either the hand or the wheels), the top right sphere disappears. I've attached a screenshot but I suspect that will get filtered out by the list software. Is this an instance of http://www.vis-sim.com/osg/osg_faq_1.htm#f22 ? I'm seeing similar behavior with the plasmafun.exe sample as well. A section out of the torus is missing (or rather, it's there but flashes constantly). Any idea what this might be? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geometry kernels?
The geometry engine is the software that you use to do things like fuse or intersect solids, sweep 2d shapes along a curve to generate a 3d shape, etc... From these you get faces. lines and points that you pass on to something else (like OpenGL) to render. Open Cascade is free and quite good. The ACIS kernel is what is at the heart of AutoCAD. Parasolid drives Solidworks. I was looking for advice on using one of these geometry toolkits with OSG. I assumed it was a common configuration, but I think I might be wrong about that. Cory Sukender wrote: Hi Cory, What do you mean by "geometry engine"? I guess you'll be able to easily create a kind of exporter that converts your geometry to an OSG/OpenGL one. Perhaps geometries would even be directly read and added to Geodes. I don't know HOOPS, but be aware that OSG is "only" (!) a scene graph (with many features and plugins), but not a CAD/infrastructure/mining/whatever software. Please tell us if you find useful things. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ Le Wed, 07 Jan 2009 16:44:15 +0100, Cory Riddell c...@codeware.com a écrit: I'm looking for comments and suggestions for using OSG with a geometry engine like ACIS, Parasolid, or Open Cascade. Can they work well together? Is it a useful combination? The application is CAD-like and involves interactively building up a model from discrete components. I found OSG when looking for HOOPS competitors. Is it fair to compare HOOPS with OSG? Thanks, Cory ___ 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] Problem with pointlightmanip.exe example?
Ack! You're right of course, it's a Coin3D sample. I'm evaluating too many things at once... Sorry for the noise. Cory Jean-Sébastien Guay wrote: Hello Cory, I'm not sure why no one has answered you yet... I'll give it a shot. I've been running the pointlightmanip.exe example and as soon as I rotate even a tiny amount (using either the hand or the wheels), the top right sphere disappears. I've attached a screenshot but I suspect that will get filtered out by the list software. The screenshot got through, and it does not look like any OpenSceneGraph example I know of. And there is no example called pointlightmanip in OSG. The screenshot's GUI looks like Coin / OpenInventor to me... Or perhaps it's OpenSG? People have confused OpenSceneGraph (commonly called OSG) with OpenSG before, and you can see why. Can you tell us where you got the example? J-S ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Is OSG tied to OpenGL?
The subject line says it all- if other renderers (in my case DirectX) are available on a system, can they be used? A second question- are some of the UI toolkits better supported than others? I'm specifically thinking about comparing the wx stuff with Qt and MFC. -cr ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] VS Intellisense forOSG?
How do you make Visual Studio provide intellisense for OSG based apps? I'm running through the tutorials now and it would be helpful to get parameter info for the OSG API. I still have the OpenSceneGraph.ncb file that was generated when I built OSG and I presume that VS needs this file, but I'm not sure where to put it or how to configure my environment for this. Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VS Intellisense forOSG?
Vincent is right. Intellisense is now working for me. I *did* restart, so perhaps that's what fixed my problems (this is, after all, a windows machine). Sorry for the noise. cory Vincent Bourdier wrote: Hi Cory, I personally not have done all of that. Just putting the osgFile.lib in the linker and osgfile includes, and making my application, I have the intellisense working good. Nothing to do especially. When intellisense do not work, you can assume that an error is in you code syntax... or sometimes it stop working... so just delete the .ncb file and restart VS... it will re-do it. Regards, Vincent. 2009/1/21 Cory Riddell c...@codeware.com How do you make Visual Studio provide intellisense for OSG based apps? I'm running through the tutorials now and it would be helpful to get parameter info for the OSG API. I still have the OpenSceneGraph.ncb file that was generated when I built OSG and I presume that VS needs this file, but I'm not sure where to put it or how to configure my environment for this. Cory ___ 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
[osg-users] how to do a cutting plane?
I've been evaluating a bunch of software and one product has cutting planes. For these, you define a plane and you can intersect it with your model and it clips the model. Follow this link for a better description: http://www.openhsf.org/docs_hsf/Hoops3DGS/prog_guide/02_13_geometry_cutting_planes.html How difficult would this be to set up with OSG? I'm trying to just get a sense if are all the pieces there or would it be a difficult task? Thanks, Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] how to do a cutting plane?
Thank you! That is very close to what I need. I just didn't know where to look. I appreciate the pointer. Cory Jason Daly wrote: Cory Riddell wrote: I've been evaluating a bunch of software and one product has cutting planes. For these, you define a plane and you can intersect it with your model and it clips the model. Follow this link for a better description: http://www.openhsf.org/docs_hsf/Hoops3DGS/prog_guide/02_13_geometry_cutting_planes.html How difficult would this be to set up with OSG? I'm trying to just get a sense if are all the pieces there or would it be a difficult task? Sounds like you're looking for a ClipNode. Look at the osgclip example to see how it works. --J ___ 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] shutting down OSG
Is there a correct way to stop OSG and free all the resources that have been acquired by without stopping the application? I thought that when my osgViewer::Viewer instance went out of scope, everything would be released, but that doesn't seem to be the case. cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] shutting down OSG
After my (MFC) app ends, the output window in Visual Studio fills with a bunch of this: Detected memory leaks! Dumping objects -{164} normal block at 0x02A54248, 128 bytes long. Data: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 {163} normal block at 0x02A541A8, 96 bytes long. Data: c F8 87 63 01 00 00 00 00 01 00 00 00 00 00 00 00 {161} normal block at 0x02A54068, 64 bytes long. Data: OpenThread v1.2p 4F 70 65 6E 54 68 72 65 61 64 20 76 31 2E 32 70 I'm just getting started with OSG. I'm using it to render geometry from Granite (the geometry kernel from the Pro/ENGINEER people, just getting started with this too). Both libraries have their own reference counted pointer types and they function a bit differently so I'm probably just abusing one or the other. Normally I can just pick one of the allocation numbers from the dump (161, 163, and 164 above) and tell the debugger to stop there, but for some reason that isn't working. If I have time later today, I'm going to instrument everything with BoundsChecker and run it again. Cory On Fri, Jan 30, 2009 at 9:08 AM, Robert Osfield robert.osfi...@gmail.comwrote: Hi Cory, The OSG users ref counting, so if all external references to the scene and viewer are removed then all the associated resources should be deleted automatically. If you app keeps any references to this data then it'll stay around until these references are removed. If you've enabled caching in the osgDB::Registry then it can keep around a reference for loaded objects in its cache, so clearing this would be required. Also if you app loads OSG plugins as part of loading your data then one could see this as items you might want to unload. BTW, what makes you think that things aren't being released? Robert. On Fri, Jan 30, 2009 at 2:57 PM, Cory Riddell c...@codeware.com wrote: Is there a correct way to stop OSG and free all the resources that have been acquired by without stopping the application? I thought that when my osgViewer::Viewer instance went out of scope, everything would be released, but that doesn't seem to be the case. cory ___ 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
[osg-users] CPU usage
When I run the osg viewer app and load just about any osg file (like cesna.osg), my CPU usage is a constant 23% - 30%. This is with no interaction, it is basically using an entire CPU core. Fortunatelly I have a 4 core machine, so it hasn't been a problem so far, but I'm wondering what this means for single core machines (which most of our customers have). Is this typical? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] CPU usage
I'm not sure about vysync. I'll look that up and check it. I thought about the possibility of it being a debug build and I don't think that's it. In my bin directory I have osgviewer.exe at 25,600 bytes and osgviewerd.exe at 81,920 bytes. Both executables give me the same CPU pegging behavior (as observed by SysInternals Process Explorer). My command line is osgviewer.exe --window 100 100 200 200 cessna.osg. My video card is an ATI FireGL V7700 and the drivers are up to date. Ah- I just noticed something-- an error message: Windows Error #127: [Screen #0] ChooseMatchingPixelFormat() - wglChoosePixelFormatARB extension not found, trying GDI. Reason: The specified procedure could not be found. I'm running over remote desktop right now, so perhaps that's related. I don't recall seeing this error message before. Cory On Sat, Jan 31, 2009 at 3:54 AM, Robert Osfield robert.osfi...@gmail.comwrote: Hi Cory, It's not normal to have this high level of CPU usage for this model, the expceptions to this would be: You have vysync switched off, so the app is racing as fast it can to dispatch frames You've compiled the OSG with debug build. Robert. On Fri, Jan 30, 2009 at 8:36 PM, Cory Riddell c...@codeware.com wrote: When I run the osg viewer app and load just about any osg file (like cesna.osg), my CPU usage is a constant 23% - 30%. This is with no interaction, it is basically using an entire CPU core. Fortunatelly I have a 4 core machine, so it hasn't been a problem so far, but I'm wondering what this means for single core machines (which most of our customers have). Is this typical? Cory ___ 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] CPU usage
I'm running locally now and am seeing the same behavior. Running with --SingleThreaded makes no difference. Cory On Mon, Feb 2, 2009 at 9:53 AM, Adrian Egli OpenSceneGraph (3D) 3dh...@gmail.com wrote: Hi J-S i am working with NVidia GPU, and i have same behaviour. So there should be another problem than the busy wait. Of course can VSync give some problem in performance or at least we get a smaller FPS displayed. But here we have some strang behavior of our osgViewer (renderer). My there is a bug inside the synchronisation. But what i guess is: When we are running under --SingleThreaded : bool GraphicsWindowWin32::realizeImplementation() wglMakeCurrent SwapBuffers all are called in the same thread. if we are working without singlethreaded option, then the realize get call in the master thread and in the others wgl based method call get called in a second thread. may the operating system (driver) understand, that there must be more than one thread in the world and starts an extra synchronisation which cause the CPU overload. /adrian 2009/2/2 Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com Hi Cory, I'll have to defer to others on the situation under Windows when doing remote desktop. My guess is that it's likely to be a driver issue. Well, using Remote Desktop adds a variable into the mix for sure, so eliminating this and running the app locally would eliminate one possible thing. About one core being pegged, some video drivers implement vsync as a busy wait, which means that the CPU is not really pegged, it just looks like that. If you were to actually run real code on that core, along with OSG, you would see that that code would run at a normal speed because the vsync busy wait would relinquish the CPU while it's waiting for the next frame to start. So my guess is that your ATI drivers are doing this, and what you're seeing is just the idle time between frames being counted as active time by Process Explorer because it's implemented as a busy wait. Of course, I'm speculating here, you'll have to run a real app (not just osgviewer) to see for yourself. Note also that ATI's OpenGL drivers have never been the best... Though they say they're getting better, they have a long way to go. So there might be some of that here. 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 -- Adrian Egli ___ 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] modelling geodes with children?
Are you suggesting that my root would be a group node and under that would be all the leaf nodes? I don't like that idea because it loses the hierarchy: streamer is attached to grip, grip is attached to handlebar. If I delete the grip node, the streamer should go away as well. Your HandNode example is very similar to what I'm talking about. The streamer location is relative to the grip. If the grip is moved, the streamer should maintain is relative position. In my original picture, I think all the group nodes are actually transform nodes. It seems like I really do want a Group node with geometry. I guess my choices are to do something like your HandNode (probably using object composition rather than inheritance) or pair every Geode with a Group node. Cory On Tue, Feb 3, 2009 at 3:46 PM, Paul Martz pma...@skew-matrix.com wrote: Use Group nodes. One child is a Geode for the handlebars, the other children are the attachments. This doesn't seem clumsy to me, this seems clean and straightforward. If you want to derive your own class from Group that has a built-in Geode member variable, this is also an option, and useful in some cases. For example, I have a HandNode that derives from Transform and displays an articulatable hand model. The hand is a scene graph that is owned by the HandNode, but not exposed other than via an interface for articulating the fingers. Because HandNode is a Transform, you can add children, which are then transformed as the hand is transformed (position and orientation in space), useful for adding a text label or debugging/visualization aids. Traversing both the hand subgraph and the actual children is handled by overriding the traverse() method. However, I'd never do something like this for the general-purpose case you describe with the handlebars and attachments; just use off-the-shelf OSG for that and save yourself a code maintenance headache. Paul Martz *Skew Matrix Software LLC* http://www.skew-matrix.com +1 303 859 9466 -- *From:* osg-users-boun...@lists.openscenegraph.org [mailto: osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Cory Riddell *Sent:* Tuesday, February 03, 2009 1:09 PM *To:* OpenSceneGraph Users *Subject:* [osg-users] modelling geodes with children? I'm looking for advice on typical patterns when modeling something that has attachments (which may in turn have other attachments). I first looked for a node type that was a composition of Geode and Group but of course I didn't find anything. An example might help here. Say I want to model bicycle handlebars. Attached to the handlebar are grips, a light, and a bell. Attached to the grips are streamers. So, the handlebars have geometry and has children (grips, light, and bell). The light and bell have geometry, but no children. The grips though, have geometry and a child (the streamers). The streamers have geometry only. How could I model this? I thought about using a group node for any item that has both a geometry and children, but that seems clumsy (see the attached pic). I have a feeling that there is a simple solution that I'm just not seeing here. Cory ___ 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] modelling geodes with children?
On Tue, Feb 3, 2009 at 4:43 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: I think the image you sent is a logical arrangement. A Group (or a Transform) does not itself have any geometry, it just specifies how it's children are arranged (in the case of a Transform). So yes, your groups in your image would actually be Transforms, and you would have one or many Geodes under that, and also more Transforms for the sub-objects. That's a very standard scene graph structure, used all the time, and very general/flexible. A Transform does not itself have any geometry, because its job is just to transform its children (whatever those children may be). I don't know why you think it's clumsy... Perhaps the clumsy comment isn't fair. My first exposure to scene graphs was by reading about HOOPS and they support the idea of a geometry node having pointers to child nodes (they call them segments). You can get a pretty good idea of their model by reading this: http://developer.hoops3d.com/documentation/Hoops3DGS/prog_guide/01_2_database_dbase_structure.htmlhttp://developer.hoops3d.com/documentation/Hoops3DGS/prog_guide/01_2_database_dbase_structure.html In my mind, I'm equating the thing with the thing's geometry. And so if something is attached to the thing, I want the data structure to mimic that. Thanks for the advice. It definitely helps. Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] modelling geodes with children?
I'm looking for advice on typical patterns when modeling something that has attachments (which may in turn have other attachments). I first looked for a node type that was a composition of Geode and Group but of course I didn't find anything. An example might help here. Say I want to model bicycle handlebars. Attached to the handlebar are grips, a light, and a bell. Attached to the grips are streamers. So, the handlebars have geometry and has children (grips, light, and bell). The light and bell have geometry, but no children. The grips though, have geometry and a child (the streamers). The streamers have geometry only. How could I model this? I thought about using a group node for any item that has both a geometry and children, but that seems clumsy (see the attached pic). I have a feeling that there is a simple solution that I'm just not seeing here. Cory attachment: handlebars.png___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] modelling geodes with children?
On Wed, Feb 4, 2009 at 10:48 AM, Paul Martz pma...@skew-matrix.com wrote: If your HandlebarNode will be used in many apps to render handlebars (I don't know, maybe you intend to make a series of bicycle simulators), then yes, maybe it is best to encapsulate it in its own class. But if you are just using it as an example of some general hierarchical structure, then I doubt you want to create a new class for each unique piece of hierarchical geometry. Perhaps I'm not fully understanding your use case. My use case was just a fabricated example (and a poor one at that). I'm working on software for mechanical equipment and I was afraid using an example from the actual domain would have been mired down in domain specific terminology. We don't have a particular arrangement of components that would be repeated, but the equipment in general does have a natural hierarchical order to it (A is connected to B is connected to C etc...). I confessed to Jean-Sebastien that the source of this notion of all-in-one nodes was HOOPS - the first scene graph tool I investigated. I'm starting to come around to the OSG viewpoint though. Not that I dislike HOOPS- it's a fantastic piece of software. It's just a little overkill for what we need. -cr ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph-2.8.0-rc1 tagged, please test
I built everything with Visual Studio 2005 on XP with no build problems. One minor glitch that may be my fault- when I ran the built the INSTALL target, it copied the executables to C:\Program Files\OpenSceneGraph rather than C:\Program Files\OpenSceneGraph-2.8 (I specified this in CMake). Cory On Wed, Feb 4, 2009 at 12:50 PM, Jason Daly jd...@ist.ucf.edu wrote: Robert Osfield wrote: But still we can't rest if we want to make 2.8.0 the best we can... so please download/check out the OpenSceneGraph-2.8 branch or the 2.8.0-rc1 and do compile and runtime checks on as wide range of platforms as you have to hand. I would also greatly value feedback on how you own applications are performing with 2.8, if there are issues please just report them on osg-users and we can together have a bash at resolve them. Builds with zero warnings on Red Hat Enterprise 5.3, even with our tired old CMake 2.4.5 ;-) Only minor glitch with the build is that I have to pass -march=i686 in CXXFLAGS for OpenThreads to configure properly to use GCC_BUILTINS. I think this was covered in another thread a few months back. Even if I don't do this, it works fine running with mutexes. --J ___ 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] OpenSceneGraph-2.8.0-rc1 tagged, please test
Yeah, I started wondering if I built the wrong source tree. I started the whole process over again and should know pretty soon. Even on a 4-core machine, it takes a while to build everything (but at least the build process can mostly run in parallel). Cory On Wed, Feb 4, 2009 at 2:21 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi again Cory, I always use a different CMAKE_INSTALL_PREFIX than the default, and it works well for me, which is why I suggest you re-check the setting... If it's really set to what you say, then there might be some other problem. Just out of curiosity I checked myself and here's what I got: 1-- Build started: Project: INSTALL, Configuration: Debug Win32 -- 1 1Performing Post-Build Event... 1-- Install configuration: Debug 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/doc/OpenSceneGraphReferenceDocs 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/doc/OpenSceneGraphReferenceDocs/osg32-32.png 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/doc/OpenThreadsReferenceDocs 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/doc/OpenThreadsReferenceDocs/osg32-32.png 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/pkgconfig/openscenegraph.pc 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/pkgconfig/openthreads.pc 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/OpenThreadsd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/ot11-OpenThreadsd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/include/OpenThreads/Config 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/include/osg/Config 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgDBd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgDBd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgUtild.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgUtild.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgGAd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgGAd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgTextd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgTextd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgViewerd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgViewerd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/include/osgViewer/GraphicsWindowWin32 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/include/osgViewer/PixelBufferWin32 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgAnimationd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgAnimationd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgFXd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgFXd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgManipulatord.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgManipulatord.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgParticled.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgParticled.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgShadowd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgShadowd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgSimd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgSimd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgTerraind.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgTerraind.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgWidgetd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgWidgetd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgVolumed.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgVolumed.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osgPlugins-2.8.0/osgdb_osganimationd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osgPlugins-2.8.0/osgdb_osgfxd.dll 1-- Installing:
Re: [osg-users] OpenSceneGraph-2.8.0-rc1 tagged, please test
Sorry for the false alarm. I rebuilt everything and and it seems to be working. Cory On Wed, Feb 4, 2009 at 2:45 PM, Cory Riddell c...@codeware.com wrote: Yeah, I started wondering if I built the wrong source tree. I started the whole process over again and should know pretty soon. Even on a 4-core machine, it takes a while to build everything (but at least the build process can mostly run in parallel). Cory On Wed, Feb 4, 2009 at 2:21 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi again Cory, I always use a different CMAKE_INSTALL_PREFIX than the default, and it works well for me, which is why I suggest you re-check the setting... If it's really set to what you say, then there might be some other problem. Just out of curiosity I checked myself and here's what I got: 1-- Build started: Project: INSTALL, Configuration: Debug Win32 -- 1 1Performing Post-Build Event... 1-- Install configuration: Debug 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/doc/OpenSceneGraphReferenceDocs 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/doc/OpenSceneGraphReferenceDocs/osg32-32.png 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/doc/OpenThreadsReferenceDocs 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/doc/OpenThreadsReferenceDocs/osg32-32.png 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/pkgconfig/openscenegraph.pc 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/pkgconfig/openthreads.pc 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/OpenThreadsd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/ot11-OpenThreadsd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/include/OpenThreads/Config 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/include/osg/Config 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgDBd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgDBd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgUtild.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgUtild.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgGAd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgGAd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgTextd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgTextd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgViewerd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgViewerd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/include/osgViewer/GraphicsWindowWin32 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/include/osgViewer/PixelBufferWin32 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgAnimationd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgAnimationd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgFXd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgFXd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgManipulatord.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgManipulatord.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgParticled.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgParticled.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgShadowd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgShadowd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgSimd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgSimd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgTerraind.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgTerraind.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgWidgetd.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgWidgetd.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/lib/osgVolumed.lib 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin/osg55-osgVolumed.dll 1-- Installing: C:/Dev/OpenSceneGraph-SVN/OpenSceneGraph-2.8-branch/bin
[osg-users] innocuous but annoying warning
When I compile my app (against an rc downloaded yesterday), I get a warning in uniform (line 318), geode (lines 93, 124), and lod (line 116) for the unsafe conversion of a size_t to an unsigned int: uniform(318) : warning C4267: 'return' : conversion from 'size_t' to 'unsigned int', possible loss of data Has something changed, or is it likely that I botched something in my conversion from OSG 2.6 - 2.8? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Sketchup rendering
Please post your results. I'm also very curious about how to achieve this affect. Thanks, Cory Serge Lages wrote: Thanks Guillaume, The page you've spotted give nearly the same result as osgFX::Cartoon, what I would like is to have all the edged (when adjacent 2 faces are not coplanar) visible. I'll try to make something mixing this effect with something more custom to try to achieve it. On Thu, Feb 5, 2009 at 8:13 PM, Poirier, Guillaume guillaume.poir...@nrc-cnrc.gc.ca wrote: Hi Serge, You could probably achieve that look with flat shading (maybe some color quantization) combined with edge / silhouettes / creases extraction. Check out something like http://postulate.org/silhouette.php From: osg-users-boun...@lists.openscenegraph.org on behalf of Serge Lages Sent: Thu 2/5/2009 1:29 PM To: OpenSceneGraph Users Subject: [osg-users] Sketchup rendering Hi all, I would like to have some advices on how to render a scene with the same "look and feel" than Sketchup (very bright, black edges... I've attached a screenshot showing it). I looked at the Cartoon effect into osgFX but the result is really not the same. Any ideas on how to achieve it ? -- Serge Lages http://www.tharsis-software.com http://www.tharsis-software.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Serge Lages http://www.tharsis-software.com ___ 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] memory leak false positives on Windows
I (and others) have asked about apparent memory leaks reported in Visual Studio when an OSG app exits. The leak dump looks like this: Detected memory leaks! Dumping objects - {29751} normal block at 0x0293C970, 36 bytes long. Data: , E 2C 0B 45 10 00 00 00 00 01 00 00 00 01 CD CD CD {29738} normal block at 0x0293C740, 500 bytes long. Data: X)A ` @ 58 29 41 10 00 00 00 00 01 00 00 00 60 93 0B 40 {29727} normal block at 0x028DA8A0, 84 bytes long. Data: 1D 0 %i C8 31 44 10 00 00 00 00 01 00 00 00 30 85 25 69 ... I spent my morning tracking down exactly what is going on here and I thought I would post my findings in case it's helpful to others. It took a bit of futzing around, but I finally identified one of the leaking objects as a DatabasePager instance. A DatabasePager may be constructed via a prototype which is static: osg::ref_ptrDatabasePager DatabasePager::prototype() { static osg::ref_ptrDatabasePager s_DatabasePager = new DatabasePager; return s_DatabasePager; } The static instance doesn't go out of scope until the application is being torn down (atexit) and the memory dump happens before that begins. Is anybody interested in discussing how to manage these singleton objects differently so they are explicitly deleted to avoid the (incorrect) memory leak report? I totally understand that every destructor that should be called is eventually called. However, for those of us stuck developing for Windows, it would be useful to change the behavior to avoid the false positives. -cr ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] memory leak false positives on Windows
Can anybody recommend a Windows-based memory tracking tool? I have BoundsChecker but it thinks this is a leak: Foo* p = new Foo; osg::ref_ptrFoo pFoo = p; I wrestled with Purify for a few days but even with Rational's help I could not get it to work with our application. Cory Robert Osfield wrote: Hi Cory, This is a bug in the memory tracking tool you have. Perhaps looking for another more robust tool would be a better use of your time. If you absolutely do want to manually force clean up then you can reset the singletons by setting them to 0. For onces that return a ref_ptr you can do: osgDB::DatabasePager::prototype() = 0; The osgDB::Registry is quite old and misses the above trick of using a ref_ptr reference, so has a rather hacky way to delete the signleton (note, the declaration is static Registry* instance(bool erase = false); osgDB::Registry::instance(true); You'll need to take about destruction order. Robert. On Tue, Feb 10, 2009 at 6:34 PM, Cory Riddell c...@codeware.com wrote: I (and others) have asked about apparent memory leaks reported in Visual Studio when an OSG app exits. The leak dump looks like this: Detected memory leaks! Dumping objects - {29751} normal block at 0x0293C970, 36 bytes long. Data: , E 2C 0B 45 10 00 00 00 00 01 00 00 00 01 CD CD CD {29738} normal block at 0x0293C740, 500 bytes long. Data: X)A ` @ 58 29 41 10 00 00 00 00 01 00 00 00 60 93 0B 40 {29727} normal block at 0x028DA8A0, 84 bytes long. Data: 1D 0 %i C8 31 44 10 00 00 00 00 01 00 00 00 30 85 25 69 ... I spent my morning tracking down exactly what is going on here and I thought I would post my findings in case it's helpful to others. It took a bit of futzing around, but I finally identified one of the leaking objects as a DatabasePager instance. A DatabasePager may be constructed via a prototype which is static: osg::ref_ptrDatabasePager DatabasePager::prototype() { static osg::ref_ptrDatabasePager s_DatabasePager = new DatabasePager; return s_DatabasePager; } The static instance doesn't go out of scope until the application is being torn down (atexit) and the memory dump happens before that begins. Is anybody interested in discussing how to manage these singleton objects differently so they are explicitly deleted to avoid the (incorrect) memory leak report? I totally understand that every destructor that should be called is eventually called. However, for those of us stuck developing for Windows, it would be useful to change the behavior to avoid the false positives. -cr ___ 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
[osg-users] forcing a square aspect ratio
I've been playing with osgviewerMFC and I've noticed that when I open an osg file (like cow.osg), the rendering is stretched to fit the aspect ratio of the containing window. For example, if I resize the app to be wide then open the cow, I get a very long cow. If I make the window short and tall then open the cow, I get a very compressed cow. Resizing the window does resize the cow, but the aspect ratio doesn't change. osgviewerQT doesn't have this problem but I don't see what's different. What controls the aspect ratio of the rendering? BTW, my cow.osg is from 2.6. Has the osg file format changed? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Memory Leak ... Windows
Adrian- For the record, I made my posting because I thought other Windows developers would like to know the source of at least some of the false positives. I wasn't claiming to have found a real leak. Cory Adrian Egli OpenSceneGraph (3D) wrote: Hi Robert, Since i am member of the osg-user mailing list, we get each month a least one guy asking the community about the problem of memory leak in OSG core. The problem is simply to say, that the most of them are working with 3rd party tools like bound checkers and they trust them. Of course the bound checkers and alos others are greate. but not right working with our library. So i would propose a own written C++ memory leak detector. I still posted the memory leak detector two weeks ago, but if we would like to integrate it in the next release it would be possible. Unfortunately it's only working under windows and _MSV_VER 1399 (MSVS C++ 2005). Or we could at least post the code in some way. I don't right know where and how, but it would be possible. what are you thinking about? Do you still check osg against some memory leak detector? /adrian -- Adrian Egli ___ 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] forcing a square aspect ratio
FWIW, I've attached a screen shot of what should be a square. The Drawable code was taken from the quickstart guide and the vertices are: v-push_back(osg::Vec3(-1.f, 0.f, -1.f)); v-push_back(osg::Vec3(1.f, 0.f, -1.f)); v-push_back(osg::Vec3(1.f, 0.f, 1.f)); v-push_back(osg::Vec3(-1.f, 0.f, 1.f)); Any ideas? Cory Riddell wrote: I've been playing with osgviewerMFC and I've noticed that when I open an osg file (like cow.osg), the rendering is "stretched" to fit the aspect ratio of the containing window. For example, if I resize the app to be wide then open the cow, I get a very long cow. If I make the window short and tall then open the cow, I get a very compressed cow. Resizing the window does resize the cow, but the aspect ratio doesn't change. osgviewerQT doesn't have this problem but I don't see what's different. What controls the aspect ratio of the rendering? BTW, my cow.osg is from 2.6. Has the osg file format changed? Cory ___ 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] Memory Leak ... Windows
It sounds questions about memory leak reports on Windows come up often. I'd like to address this in the FAQ. Any objections? Cory Robert Osfield wrote: Hi Adrian, In the early days of the OSG I wrote a few custom new/delete operators and the associated infrastructure for tracking memory, but in the end it was too painful to maintain and really not anything to do with the core OSG's focus. There are far better tools out there for tracking memory than things we can plug together. Might I suggest investigating the the open source memory tracking tools that exists, perhaps we might be able to help make use of them easier, but I wouldn't advocate tacking on the tasks of doing memory tracking ourselves. As for false positives... we that's just a fact of life, you use these tools and they generate useful results and misleading results. Knowing what is useful and what is misleading is the part that takes skill and good judgement. People are often seduced by the idea of silver bullet, the one something that can fix lots of things in one swoop. We as a community will always see traffic that is generated by the false positives, be it warnings from compilers or memory tracking tools, the best we can do is get wise to what patterns of false positive exist and to spot them when they arise to try to save everybodies time. Robert. On Tue, Feb 10, 2009 at 7:44 PM, Adrian Egli OpenSceneGraph (3D) 3dh...@gmail.com wrote: Hi Robert, Since i am member of the osg-user mailing list, we get each month a least one guy asking the community about the problem of memory leak in OSG core. The problem is simply to say, that the most of them are working with 3rd party tools like bound checkers and they trust them. Of course the bound checkers and alos others are greate. but not right working with our library. So i would propose a own written C++ memory leak detector. I still posted the memory leak detector two weeks ago, but if we would like to integrate it in the next release it would be possible. Unfortunately it's only working under windows and _MSV_VER 1399 (MSVS C++ 2005). Or we could at least post the code in some way. I don't right know where and how, but it would be possible. what are you thinking about? Do you still check osg against some memory leak detector? /adrian -- Adrian Egli ___ 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] memory leak false positives on Windows
Jean-Sébastien Guay wrote: Why would perfectly good programming practices be avoided just because they cause false positives in one tool, on one platform? This is pretty much the same discussion as the one concerning warnings I had with Robert last week. The code should be a by-product of the design (with small allowances for language differences, of course). If the design is sound, but some tool prevents you from implementing that design in code, you should change tools, not the other way around... I personally find OSG's design very good, and it's one of the reasons I use it. I don't think anybody has questioned the design of OSG. If anything, I would characterize what has been discussed recently as an extension of the design. The ability to easily halt / unload OSG from a running process might be useful for more than one reason. I also agree with you that making code concessions to accommodate tools is unfortunate, but it happens all the time. Unless you are using Comeau or EDG's C++ compiler, your compiler probably doesn't support the complete C++ standard. If, for example, OSG were to start using the export keyword would you change tools, or discuss altering the code that limits your choice of tools? (ok, it's a weak example but I hope you could understand what I was trying to say...) For me, I think it really comes down to put up or shut up. This is open source that I haven't been asked to pay for and I would never think of rudely telling Robert and the other primary developers how it should be. On the other hand, I'd like to know if code that explicitly unloads OSG would ever be accepted into the repository. I'm getting the sense that it would be if it were sufficiently transparent, simple and inexpensive. In the case of osg::Referenced memory leaks, I've posted with a few useful techniques, and Adrian Egli and others have too. Thank you for this. It's very helpful. Because of this support, I can probably deal with the situation. (btw, has anyone compiled valgrind for Windows?) valgrind is Linux only. -cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] memory leak false positives on Windows
Jean-Claude- Thank you for reposting those links. I followed the instructions from Orhun Birsoy and can now run my app without any false memory leak reports. After all the false positives disappeared, a real memory leak (in my app) was left. Cory Jean-Claude Monnin wrote: Hi Cory, I have been able to remove the false positives from the VisualStudio leak report by doing the procedure desribed in the following post from the archive: http://lists.openscenegraph.org/htdig.cgi/osg-users-openscenegraph.org/2008-May/010839.html http://www.mail-archive.com/osg-us...@openscenegraph.net/msg11248.html Since then, the leak report works fine for me. If your project doesn't use MFC at all, it won't help. But if yes, it might be helpful. Jean-Claude Am 10.02.2009 um 20:02 schrieb Cory Riddell: Can anybody recommend a Windows-based memory tracking tool? I have BoundsChecker but it thinks this is a leak: Foo* p = new Foo; osg::ref_ptrFoo pFoo = p; I wrestled with Purify for a few days but even with Rational's help I could not get it to work with our application. Cory Robert Osfield wrote: Hi Cory, This is a bug in the memory tracking tool you have. Perhaps looking for another more robust tool would be a better use of your time. If you absolutely do want to manually force clean up then you can reset the singletons by setting them to 0. For onces that return a ref_ptr you can do: osgDB::DatabasePager::prototype() = 0; The osgDB::Registry is quite old and misses the above trick of using a ref_ptr reference, so has a rather hacky way to delete the signleton (note, the declaration is static Registry* instance(bool erase = false); osgDB::Registry::instance(true); You'll need to take about destruction order. Robert. On Tue, Feb 10, 2009 at 6:34 PM, Cory Riddell c...@codeware.com wrote: I (and others) have asked about apparent memory leaks reported in Visual Studio when an OSG app exits. The leak dump looks like this: Detected memory leaks! Dumping objects - {29751} normal block at 0x0293C970, 36 bytes long. Data: , E 2C 0B 45 10 00 00 00 00 01 00 00 00 01 CD CD CD {29738} normal block at 0x0293C740, 500 bytes long. Data: X)A ` @ 58 29 41 10 00 00 00 00 01 00 00 00 60 93 0B 40 {29727} normal block at 0x028DA8A0, 84 bytes long. Data: 1D 0 %i C8 31 44 10 00 00 00 00 01 00 00 00 30 85 25 69 ... I spent my morning tracking down exactly what is going on here and I thought I would post my findings in case it's helpful to others. It took a bit of futzing around, but I finally identified one of the leaking objects as a DatabasePager instance. A DatabasePager may be constructed via a prototype which is static: osg::ref_ptrDatabasePager DatabasePager::prototype() { static osg::ref_ptrDatabasePager s_DatabasePager = new DatabasePager; return s_DatabasePager; } The static instance doesn't go out of scope until the application is being torn down (atexit) and the memory dump happens before that begins. Is anybody interested in discussing how to manage these singleton objects differently so they are explicitly deleted to avoid the (incorrect) memory leak report? I totally understand that every destructor that should be called is eventually called. However, for those of us stuck developing for Windows, it would be useful to change the behavior to avoid the false positives. -cr ___ 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 ___ 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] forcing a square aspect ratio
Moji the Great- I added the code you suggest to my code (and to osgviewerMFC) and it doesn't do anything. Is there something you have to do after setting the new aspect ratio to have it take effect? I was playing around and it didn't seem to matter what number I plugged in for the aspect ratio, my view always looked the same. Cory Mojtaba Fathi wrote: Hi I had the same problem, and I found a solution (but can't remember where I found it). It's like this: // Realize the Viewer _viewer-realize(); // correct aspect ratio double fovy,aspectRatio,z1,z2; camera-getProjectionMatrixAsPerspective(fovy,aspectRatio,z1,z2); aspectRatio=double(traits-width)/double(traits-height); camera-setProjectionMatrixAsPerspective(fovy,aspectRatio,z1,z2); Regards Moji the Great --- On Wed, 2/11/09, Cory Riddell c...@codeware.com wrote: From: Cory Riddell c...@codeware.com Subject: Re: [osg-users] forcing a square aspect ratio To: "OpenSceneGraph Users" osg-users@lists.openscenegraph.org Date: Wednesday, February 11, 2009, 12:18 AM FWIW, I've attached a screen shot of what should be a square. The Drawable code was taken from the quickstart guide and the vertices are: v-push_back(osg::Vec3(-1.f, 0.f, -1.f)); v-push_back(osg::Vec3(1.f, 0.f, -1.f)); v-push_back(osg::Vec3(1.f, 0.f, 1.f)); v-push_back(osg::Vec3(-1.f, 0.f, 1.f)); Any ideas? Cory Riddell wrote: I've been playing with osgviewerMFC and I've noticed that when I open an osg file (like cow.osg), the rendering is "stretched" to fit the aspect ratio of the containing window. For example, if I resize the app to be wide then open the cow, I get a very long cow. If I make the window short and tall then open the cow, I get a very compressed cow. Resizing the window does resize the cow, but the aspect ratio doesn't change. osgviewerQT doesn't have this problem but I don't see what's different. What controls the aspect ratio of the rendering? BTW, my cow.osg is from 2.6. Has the osg file format changed? Cory ___ 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] forcing a square aspect ratio
Nevermind, I found the problem. I was setting the projection matrix on the camera I added as a slave. Instead, I did this: // Realize the Viewer _viewer-realize(); // correct aspect ratio double fovy,aspectRatio,z1,z2; _viewer-getCamera()-getProjectionMatrixAsPerspective(fovy,aspectRatio,z1,z2); aspectRatio=double(traits-width)/double(traits-height); _viewer-getCamera()-setProjectionMatrixAsPerspective(fovy,aspectRatio,z1,z2); I'd like to update the osgviewerMFC sample app. How would I go about doing this? Cory Cory Riddell wrote: Moji the Great- I added the code you suggest to my code (and to osgviewerMFC) and it doesn't do anything. Is there something you have to do after setting the new aspect ratio to have it take effect? I was playing around and it didn't seem to matter what number I plugged in for the aspect ratio, my view always looked the same. Cory Mojtaba Fathi wrote: Hi I had the same problem, and I found a solution (but can't remember where I found it). It's like this: // Realize the Viewer _viewer-realize(); // correct aspect ratio double fovy,aspectRatio,z1,z2; camera-getProjectionMatrixAsPerspective(fovy,aspectRatio,z1,z2); aspectRatio=double(traits-width)/double(traits-height); camera-setProjectionMatrixAsPerspective(fovy,aspectRatio,z1,z2); Regards Moji the Great --- On Wed, 2/11/09, Cory Riddell c...@codeware.com wrote: From: Cory Riddell c...@codeware.com Subject: Re: [osg-users] forcing a square aspect ratio To: "OpenSceneGraph Users" osg-users@lists.openscenegraph.org Date: Wednesday, February 11, 2009, 12:18 AM FWIW, I've attached a screen shot of what should be a square. The Drawable code was taken from the quickstart guide and the vertices are: v-push_back(osg::Vec3(-1.f, 0.f, -1.f)); v-push_back(osg::Vec3(1.f, 0.f, -1.f)); v-push_back(osg::Vec3(1.f, 0.f, 1.f)); v-push_back(osg::Vec3(-1.f, 0.f, 1.f)); Any ideas? Cory Riddell wrote: I've been playing with osgviewerMFC and I've noticed that when I open an osg file (like cow.osg), the rendering is "stretched" to fit the aspect ratio of the containing window. For example, if I resize the app to be wide then open the cow, I get a very long cow. If I make the window short and tall then open the cow, I get a very compressed cow. Resizing the window does resize the cow, but the aspect ratio doesn't change. osgviewerQT doesn't have this problem but I don't see what's different. What controls the aspect ratio of the rendering? BTW, my cow.osg is from 2.6. Has the osg file format changed? Cory ___ 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 ___ 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] notify messages and console-less Windows apps
What happens to osg::notify() messages when the application has no console. For example, osgviewerMFC.exe. If you run it with OSG_NOTIFY_LEVEL=DEBUG set, you still don't see any messages. Any idea where they are going? Is there a way to specify a log file rather than stdout / stderr for the notificaitons? cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] notify messages and console-less Windows apps
I wrote: What happens to osg::notify() messages when the application has no console. For example, osgviewerMFC.exe. If you run it with OSG_NOTIFY_LEVEL=DEBUG set, you still don't see any messages. Any idea where they are going? Is there a way to specify a log file rather than stdout / stderr for the notificaitons? Of course, I found the answer 20 minutes after posting the question. A method that worked for me is on this page: http://www.codeproject.com/KB/debug/mfcconsole.aspx Look in the comments for the title Even Easier Way. Worked like a charm. Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] problem with Windows debug binaries?
I downloaded the debug and release binaries from http://www.openscenegraph.org/downloads/stable_releases/OpenSceneGraph-2.8/binaries/Windows/VisualStudio8/. When I try to run any of the exe's, I get a message that says: The application failed to initialize properly (0xc0022). Click on OK to terminate the application. I've seen this before and it has either been a permissions problem or a CRT version mismatch problem. I'm running Visual Studio 2005 which (AFAIK) is generally called version 8, so it shouldn't be a version problem. If I use runas to run osgversion.exe as administrator, I get the same error, so it shouldn't be a privileges problem. So now I really don't know what it could be. Up until today, I've always been running exe's that I compiled myself. This is the first time I've run OSG from a prebuilt binary. Is anybody else having this problem? Any troubleshooting suggestions? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with Windows debug binaries?
Yes, I have SP1. I just noticed that none of the dll's have the execute bit set. My cacls knowledge isn't good enough to know exactly what it is that should be set. It's easy to just grant everyone full control (and it does fix the problem), but I suspect that isn't the correct solution. Cory Sukender wrote: Hi Cory, I built these binaries. Do you have the SP1? If the problem is still ther, I'll may recompile entirely (who knows?)... Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ Le Mon, 16 Feb 2009 17:18:36 +0100, Cory Riddell c...@codeware.com a crit: I downloaded the debug and release binaries from http://www.openscenegraph.org/downloads/stable_releases/OpenSceneGraph-2.8/binaries/Windows/VisualStudio8/. When I try to run any of the exe's, I get a message that says: The application failed to initialize properly (0xc0022). Click on OK to terminate the application. I've seen this before and it has either been a permissions problem or a CRT version mismatch problem. I'm running Visual Studio 2005 which (AFAIK) is generally called version 8, so it shouldn't be a version problem. If I use runas to run osgversion.exe as administrator, I get the same error, so it shouldn't be a privileges problem. So now I really don't know what it could be. Up until today, I've always been running exe's that I compiled myself. This is the first time I've run OSG from a prebuilt binary. Is anybody else having this problem? Any troubleshooting suggestions? Cory ___ 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] problem with Windows debug binaries?
A couple of notes: 1. I don't run as administrator all the time (it still amazes me how many Windows users always operate as an admin) 2. I untarred with cygwin's tar. Perhaps that does something funky with the permissions? Cory Sukender wrote: Hi Cory, I built these binaries. Do you have the SP1? If the problem is still ther, I'll may recompile entirely (who knows?)... Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ Le Mon, 16 Feb 2009 17:18:36 +0100, Cory Riddell c...@codeware.com a crit: I downloaded the debug and release binaries from http://www.openscenegraph.org/downloads/stable_releases/OpenSceneGraph-2.8/binaries/Windows/VisualStudio8/. When I try to run any of the exe's, I get a message that says: The application failed to initialize properly (0xc0022). Click on OK to terminate the application. I've seen this before and it has either been a permissions problem or a CRT version mismatch problem. I'm running Visual Studio 2005 which (AFAIK) is generally called version 8, so it shouldn't be a version problem. If I use runas to run osgversion.exe as administrator, I get the same error, so it shouldn't be a privileges problem. So now I really don't know what it could be. Up until today, I've always been running exe's that I compiled myself. This is the first time I've run OSG from a prebuilt binary. Is anybody else having this problem? Any troubleshooting suggestions? Cory ___ 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] problem with Windows debug binaries?
Jean-Sébastien Guay wrote: Hi Cory, 2. I untarred with cygwin's tar. Perhaps that does something funky with the permissions? Perhaps... Can you try with another tool? For example 7-zip, which is F/OSS. Wow- when I untar with 7-zip I get different results than when I untar with cygwin (the file permissions are different). Cygwin gives me exe files with the execute bit set, but none of the dlls have that bit set. 7-zip just gives everyone full control. After searching through the 7-zip forums, it seems that it doesn't support maintaining ACL's. Just out of curiousity, what tool was used to create the tarballs? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with Windows debug binaries?
I just did a little experiment with 7-Zip and ACL's. I created a file and gave it weird privileges. I tar'd it with cygwin. When I untar with cygwin, the ACL for the file is restored correctly. When I untar with 7-Zip, the ACL has been replaced with one that grants full access to everyone. Likewise, if I tar with 7-Zip, it trashes the ACL for the file (in the archive). It doesn't matter what I use to extract with. The privileges information has been lost. 7-Zip might be a wonderful compression tool, but I don't think much of it's archiving capabilities. I would not recommend it. Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] gradient background
I'd like to be able to create a color gradient background for the osg window rather than the default blue. Is the osghud example a good one to follow for this? That example draws the hud last. For a background, I think I would want to draw it first. Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with Windows debug binaries?
Do end users download and install OSG? What on earth do they do with it? I believe the intent of the binary packages is to provide a shortcut for developers on Windows to get OSG and the dependencies. If that's the case, then it wouldn't make any sense to include the MSVC. The official distribution is the source tarball, no? cory Philip Lowman wrote: . Original Message ... On Tue, 17 Feb 2009 09:31:37 -0500 "Jean-Sbastien Guay" jean-sebastien.g...@cm-labs.com wrote: Hi Philip, Yeah, those ZIP releases of the OSG 2.8.0 prebuilts should really have the following files placed in the "bin" folder so they work out-of-the-box on Windows 2000, Windows XP, or Windows Vista without anyone having to install the MSVC runtime crap. IMHO, installing the "MSVC runtime crap" is preferable to copying the same DLLs in every release zip for every version of OSG (and potentially every other project we work on...) and therefore having potentially tens if not hundreds of copies of the same files on your system. Installing the redist ensures you have one copy (the right one) and it's accessible to all programs. Personally I would trade the whopping 1.6 MB this would take up for the assurance that the binaries will work on all machines. Of course if you want an end-user's first experience running osgviewer to view some model they found online to be a cryptic error message, then by all means leave things the way they are. Unfortunately, not every first time user of OSG is going to have MSVC installed or the runtime libraries installed. Yes I agree this sucks. Unfortunately the SxS runtime libraries do not come with Windows. There is no disadvantage to including the runtime DLLs aside from an extra 4 files and 1.6MB of space used. I think this is really a no brainer. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with Windows debug binaries?
Luigi Calori wrote: If you are a developer and want to test OSG on different hardware platforms, then you need something that run with minimum hassle This might be a dumb question, but if you are really looking for minimal hassle, why not just statically link everything? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] about the debug version of osgdemd.exe
Xuex- I was getting the same error message but in a different location and it turned out to be a permissions issue. Did you build the release and demo versions with the same user account? Do you get the error if you run the debug version as an administrator? Cory Robert Osfield wrote: Hi Xuex, I have never seen a report about problem like this before, so don't really have any prior experience to bare on it. The code in question has been heavily used by all users for many years without problem so I would suspect a build issue of some kind. I will be making another dev release of VPB in the next week or so, and this will match to OSG-2.8.0, and would be a better base for you own testing. Right now I'd recommend using the svn version of VPB and OSG-2.8.0 as there have been lots of improvements to OSG since 2.6.0. Robert. 2009/2/19 wind 509459...@qq.com: Hi all, I got VPB r924 from SVN, and built it with VS2005. The release version worked smoothly. But when ran the osgdemd.exe with osg2.6.0, the error "Application initialization failure" jumped out and could trace to file osgDB/registry: " class RegisterDotOsgWrapperProxy { public: RegisterDotOsgWrapperProxy(osg::Object* proto, const std::string name, const std::string associates, DotOsgWrapper::ReadFunc readFunc, DotOsgWrapper::WriteFunc writeFunc, DotOsgWrapper::ReadWriteMode readWriteMode=DotOsgWrapper::READ_AND_WRITE) { if (Registry::instance()) { _wrapper = new DotOsgWrapper(proto,name,associates,readFunc,writeFunc,readWriteMode); Registry::instance()-addDotOsgWrapper(_wrapper.get());//the error jumps out } }" I don't know how to avoid this error. I must have a debug version to trace some process. Anyone do me a favor? Thanks very much. Xuex. ___ 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] Packaging distribution under Windows
Luigi Calori wrote: I think that cpack support one windows installer (do not rimember which as I really hate installers: the best one is zip: install=unzip uninstall=remove) I agree that including dll is the bet way to go, in that case, I wouls suggest to include alsoMSVC runtime with the app, in order to NOT require any administrator access. I'd like to just say me too to Luigi's recommendation. Don't pollute the system directories and don't abuse the registry (or even use it if you can avoid it). If you can remove most of an application by just deleting its directory, then I think you have a great design. The only exception to this that I think is acceptable is to create a directory for user settings in ~/.MyOsgApp (or the Windows equivalent) and possibly making a file association for the app. Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OFT: Interesting commentary of the future of OpenGL
I wouldn't like Microsoft to dump D3D. I think the software ecosystem is healthier if there is more than one solution. I think it would be hard to deny that the competition from D3D has helped advance OpenGL as well. Another scene graph product (HOOPS) lets you select different rendering plugins. They are quite bullish on D3D: http://www.techsoft3d.com/products/pdfs/hoops_vista.pdf Of course they are a Microsoft partner, but I think it would be a mistake to ignore their opinion just because of that. Cory Paul Martz wrote: Hm. Perhaps this is an appropriate time for me to unveil my discussion forum, in which I have a blog stating my own opinions of OpenGL versus D3D: http://www.skew-matrix.com/bb/viewtopic.php?f=3t=2 Paul Martz Skew Matrix Software LLC http://www.skew-matrix.com +1 303 859 9466 ___ 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] modifying the SG in another thread
I'm looking for some advice having OSG running in one own thread and modifying the scene graph in another. By this, I mean I've called viewer.run() in a separate thread. While it's running, I need to add, remove, and update nodes. From reading the quick start guide (a fantastic resource btw) I understand that the data variance must be set to dynamic and changes can be made in the update traversal. It seems like one way to do this would be to use the update callback. Is there another way that doesn't involve me manually looping and calling viewer.frame()? Assuming the callback is the right way to proceed, I'm curious how others have synchronized access and managed changes that can drastically alter the structure of the scene graph. I'm starting to think that perhaps I should be swapping out the scene data entirely when a change is made. By that I mean preparing an entirely new scene graph that represents the current state of my model then calling viewer.setSceneData(). When is it safe to call this method? Any advice or pointers to relevant demos? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OFT: Interesting commentary of the future of OpenGL
Sukender wrote: There are many cons to such a competition, but I guess we all can agree with this, can't we? IMHO, neither D3D nor OpenGL should die. And finally, about having OSG to support D3D... Well I'm not *that* happy with it because D3D non-portability is an offence to the C++; but I think that it should be done, and it should be done *after* or even *during* the refactoring for an API agnostic code. Sukender- I agree with everything you say. I would like to see support of multiple renderers for the same reason I like cross platform software. I don't understand how anybody can think being OS agnostic is good, but renderer agnosticism is bad (ideologically). I do understand however, that development resources are scarce and the programmers get to work on whatever they want to work on. It would be nice to decouple OSG from the renderer eventually. It's funny- I'm using OSG to replace a renderer agnostic 3d graphics library from 2000-2003 called Joey3D. It's hasn't been around for years but we have a source license and have been able to keep it working so far. Out of the box it supported OpenGL, D3D, Heidi(?), a custom software-only renderer and one or two others that I can't remember. I really don't expect any of our customers to care that we are dropping support for anything other than OpenGL though. Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OFT: Interesting commentary of the future of OpenGL
Everybody is talking like there aren't any high performance cross-API scene graphs nor could one be made. They do exist and they are expensive. I've also seen a bunch of messages dismissing the gamer market to make the argument that OpenGL is big everywhere else and thus D3D doesn't matter. Well, the last statistics I've seen has the gaming industry an order of magnitude larger than everything else; I wouldn't ignore it. I'm not working on a game, but I do recognize that I can write a fast, cheap 3d app because the technology has been pushed so hard by gamers. With more money being spent on D3D hardware, I wouldn't be too quick to write it off. BTW- I know very little of the two API's and I don't particularly want to know any more (I only know what Wikipedia tells me: http://en.wikipedia.org/wiki/Comparison_of_OpenGL_and_Direct3D). OSG is invaluable to me because it takes care of details that I don't want to worry about and lets me work at a higher level. If the layer on top of OpenGL gets too thin and I have to learn a lot about the underlying API, then that layer isn't valuable to someone like me. But I know I'm just one member of a very diverse community. My needs and desires probably aren't the same as yours. This discussion that Gordon triggered has been fantastic though because I'm learning so much about my fellow OSGers. Cory Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC wrote: I agree with what is said here. >From my experience, generalization and high performance end up being mutually exclusive. Eventually you have to surrender to one to obtain the other... -S -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jan Ciger Sent: Wednesday, February 25, 2009 3:04 PM To: OpenSceneGraph Users Subject: Re: [osg-users] OFT: Interesting commentary of the future of OpenGL Hi, Sukender wrote: Hi Robert, Well yes, I forgot about XBox... So yes, the wrapper may be a solution. However, I'd like to insist on the fact that we should "attract" D3D devs by telling them that we're going towards an API agnostic scene graph, and them see with them what we may/should do about D3D support. Honestly, I wouldn't care too much about platforms like XBox - it is here for a year or two more and the next XBox is likely to be very different. However the OSG devs will have invested lot of time into the D3D infrastructure that will be obsolete when the new XBox is out. Then what? Chase the moving target again? What for? To be competing with things like the Source engine or others that do not care about OpenGL and can be tightly optimized for D3D? If you want to develop Windows/XBox games using OSG, be my guest, but we should not try to target every possible rendering API which is there. I prefer a tool that does one thing and does it well to a jack of all trades that does everything but nothing well. I think OSG only stands to lose by fragmentation of the development resources if Direct 3D was to be supported, and for very little gain. Regards, Jan ___ 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] OFT: Interesting commentary of the future of OpenGL
Robert- Robert Osfield wrote: Well the gaming market is very big, BUT the gaming market isn't just Windows/D3D, its much bigger than that. The Wii and Playstation2 have been the big consoles of the last ten years, neither of which have anything to do with D3D. MS would like to associate gaming with exclusivie use of D3D but this is just a marketing ploy. Ah- very good point. For some reason I wasn't thinking of consoles. It's just hardware, it isn't D3D hardware, again we have to be careful not to tricked by the MS marketing. Unfortunately all too often it is very closed hardware and proprietary drivers. If the hardware works significantly better with the D3D API, then I call it a D3D card. How about a bad analogy (sorry, I couldn't think of a car analogy): a Macintosh is just a PC, but the software makes it a Mac. I sounds like the OSG hits quite a good balance for yourself so far - provides enough functionality to do your job without worry about the details such as the thin API abstraction. By contast Paul Martz at the start of thread emphasised that the thinness of the layer above OpenGL that the OSG provides is one of it's main selling points. To be able to satisfy two different types of users needs/desires means that we've been successful. Absolutely. This is the diverse community I talked about. This seems mostly to be a pretty pragmatic bunch of people, so I'm fairly confident that if D3D support doesn't materialize, it is for technical rather than religious reasons. Thanks, Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] modify children in node callback?
In general, is it ok to modify child nodes in a node callback method? That is, children of the node for which the callback was called? I assume it must be. If not, how do you add or remove nodes of a scene graph while running? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] modify children in node callback?
Thanks Brian, that makes sense. Is there a pre (or post) traversal callback that I can hook to make the changes, or must I manually mange the frame loop to make the changes? Cory Brian R Hill wrote: Cory, You can't modify the hierarchy during an active traversal - this will mess up the traversal. You need to cache your updates and perform them between traversals. Brian This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. • -osg-users-boun...@lists.openscenegraph.org wrote: - To: OpenSceneGraph Users osg-users@lists.openscenegraph.org From: Cory Riddell c...@codeware.com Sent by: osg-users-boun...@lists.openscenegraph.org Date: 03/02/2009 02:45PM Subject: [osg-users] modify children in node callback? In general, is it ok to modify child nodes in a node callback method? That is, children of the node for which the callback was called? I assume it must be. If not, how do you add or remove nodes of a scene graph while running? Cory ___ 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
[osg-users] unresolved symbol error with release mode build?
Today I switched my compiler settings over to test performance in release mode. For some reason, I'm getting an unresolved external symbol linker error for OpenThreads::Atomic::operator++(void). As far as I know, I'm not using any of the OpenThreads stuff explicitly, so I assume it is used internally by OSG. Any reason why I would need to like with OpenThreads.lib for a release build but not a debug build? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] is osg::Referenced threadsafe by default?
In my app, I have the viewer running in its own thread. I only change the scene graph in a synchronized update callback (or to be more precise, I'm serializing access to the data that the callback uses). Using the default build settings, are the reference counting methods thread safe? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Simple question: How to set the icon that will be used when a viewer is realized?
I don't know if there is a platform independent way of setting this. What OS are you using? which icon are you talking about exactly? The one in the top right corner? Cory Matt McPheeters wrote: Hi guys, I found of an old way of doing this using Producer. I want the icon of the viewer window to be custom, not the plain white application icon it defaults to. How do you set the icon now in OpenSceneGraph-2.7.4? Sorry if this question gets asked a lot. ___ 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] easy question on Object::setDataVariance()
If my app only modifies the scene graph in an update callback, is it still necessary to set the data variance to DYNAMIC on the nodes that may change? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] public thanks to Paul for the quick start guide
Hi Paul- Just wanted to thank you for the quick start guide. It has been extremely helpful to me. Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] stopping an asynchronous viewer
If I started the viewer with the run() method (in a separate thread), is it sufficient to call viewer-setDone(true) to stop it? Do I have to call viewer-stopThreading() after calling setDone? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] converting mouse coordinates to model coordinates
I was looking through the archives for help converting mouse coordinates to model coordinates and I followed Andreas Goebel's instructions in this thread: http://lists.openscenegraph.org/htdig.cgi/osg-users-openscenegraph.org/2008-January/005994.html I was able to use that method and I now display (x, y, z) coordinates in my status bar as the mouse moves (yay!). There's been a release or two since then. Is this still a decent strategy? Thanks, Cory Riddell ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [Fwd: Mesa and gldirect]
Jan Ciger wrote: I fail to see the benefits of such move - why to run OpenGL on top of Direct3D? Is there *any* usable hardware that has only D3D drivers and does not support OpenGL? Not to mention that you will be chasing moving targets - both D3D and the GPU APIs. There are video cards with good D3D drivers and crappy OpenGL drivers. I can see why it might be nice to have the option of sitting on top of D3D. It's entirely possible that performance could be better going through an optimized D3D driver rather than directly through a crappy OpenGL driver. I don't understand why putting another layer between OSG and the hardware would result in having to chase GPU API's? Are you writing code that goes around OpenGL? Cory Riddell ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] how to draw a half line?
Right now I'm drawing some line segments like this: osg::Geometry* geo = ...; // define some vertices ... // draw lines geo-setVertexArray(vertices); geo-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES, 0, qty)); Is there a way to draw a line that goes off to infinity in one direction? Cory Riddell ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [Fwd: Mesa and gldirect]
J.P. Delport wrote: What always bothers me is the whole multiple window, multiple context thing. Correct me if I'm wrong, but I've always thought DirectX caters more for the single fullscreen 3D window case (games?). Is this not why CAD apps favour OpenGL? If DX can't do multiple windows/contexts nicely the wrapper won't be able to fix this. For specific cases the wrapper might be OK. I don't believe multiple windows/contexts is a problem anymore (was it ever?). I think CAD apps traditionally favored OpenGL simply because of their history. Way back (when SGI was relevant), the only place to get decent graphics performance was on very expensive Unix workstations. These days, the best performing graphics cards are for Windows and they are relatively inexpensive. I think that's why some CAD packages are dropping OpenGL support (Autodesk- I'm looking at you). Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] graph visualization tools?
I am about to write a little Python tool for myself to take an osg file, extract basic node information, and create a .dot file for graphviz. I want very simple tree diagrams like Paul Martz made in the quick start guide (he had green, yellow, and pink ovals for nodes). I'm guessing this is something that might already be floating around out there but I haven't been able to find it. If you know of such a tool, I would appreciate a link to it. Thanks, Cory Riddell ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] graph visualization tools?
*sigh* I found the dot plugin. Sorry for the noise. Cory Cory Riddell wrote: I am about to write a little Python tool for myself to take an osg file, extract basic node information, and create a .dot file for graphviz. I want very simple tree diagrams like Paul Martz made in the quick start guide (he had green, yellow, and pink ovals for nodes). I'm guessing this is something that might already be floating around out there but I haven't been able to find it. If you know of such a tool, I would appreciate a link to it. Thanks, Cory Riddell ___ 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: Mesa and gldirect]
Hi Ulrich- Ulrich Hertlein wrote: On 25/3/09 1:07 AM, Paul Melis wrote: graphics performance was on very expensive Unix workstations. These days, the best performing graphics cards are for Windows and they are relatively inexpensive. I think that's why some CAD packages are dropping OpenGL support (Autodesk- I'm looking at you). Are they dropping OpenGL support for their 3D modeling packages as well (especially Maya)? Or just the autocad stuff? On the other end of the spectrum they (autodesk) have ported Lustre (one of their color grading products) to Linux and somehow I doubt they're using a D3D wrapper... You know, this is what drives me crazy about Autodesk and their support of D3D. They use HOOPS in lots (most?) of their products. In fact, Tech Soft 3D (the maker of HOOPS) was spun out of Autodesk. HOOPS is renderer agnostic and I know that it works as well with OpenGL as D3D (at least on XP, Vista may be different) and is cross platform. I suspect the reasons for not support OpenGL in some of their products has to do with support costs and marketing agreements with Microsoft. Probably mostly the latter... Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] are bounties allowed?
I need a camera manipulator slightly different than the trackball manipulator. I've spent a couple of hours today on this and am now stuck. Somebody with a better grasp of quaternions could probably knock this out in 30 minutes. So... is it acceptable to post requests to the list with a bounty attached (I'm thinking $50 in this case). Any copyright should be assigned to OSG or (if Robert doesn't want it), put in the public domain. Is there a more appropriate forum for a request like this? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to remove the blue background color
Yun's suggestion allows you to replace the blue color with another solid color. If you want an image (I want a gradient), do something similar to osgHUD, except draw first rather than last to put the image behind everything else. cory Lingyun Yu wrote: Hi dat, I think viewer-getCamera()-setClearColor() can make it. Yun 2009/3/25 tien dat tienda...@gmail.com Dear all, I need to remove the blue background color so that I can do augmented display (you can run the cow.osg example to see the blue color). Do any of you know how to do that? Thank you very much, Dat ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Cheers, Yun ___ 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] [build] How to open OSG in a CView MFC ?
Hi Nemo, Nemo Ulysse wrote: I already work on this example but the 3d model is open in full screen and I don’t manage to change that. Are you saying the example program is doing what you want, except you don't want the view to be maximized? If you click on the restore button, do you get the window layout that you are looking for? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Text color not what I'm expecting
1. Fixed the typo in the subject. (now - not) 2. I discovered that if I remove the material setting at the geode level, the material set in my osgText::Text instance takes effect. I'm still confused. Cory Cory Riddell wrote: Can somebody please take a look at the attached osg file. If you open it with osgviewer, you will see the alphabet rendered at the bottom of the screen (might be small) in white. I'm trying to figure out why the text isn't black. I've set a material on my osgText::Text instance but it seems to be ignored. To find the text drawable, search for "ABCDEF". The material looks like: Material { UniqueID Material_106 ColorMode AMBIENT ambientColor 0.2 0.2 0.2 1 diffuseColor FRONT 0 0 0 1 diffuseColor BACK 0.8 0.8 0.8 1 specularColor FRONT 1 1 1 1 specularColor BACK 0 0 0 1 emissionColor 0 0 0 1 shininess FRONT 120 shininess BACK 0 } Thanks. Cory ___ 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] Resolved! Re: Text color not what I'm expecting
I'm not sure if this is correct, but it seems that my text was picking up a material setting from some parent node. It was rendering the text with the diffuse color from the material. I ended up turning GL_LIGHTING off for my osgText::Text node and now the text is being rendered with the color I was expecting. One question, is the GL_LIGHTING bit the correct setting to turn off, or is there a more correct way to turn of material usage for a drawable? Thanks, cory Cory Riddell wrote: 1. Fixed the typo in the subject. (now - not) 2. I discovered that if I remove the material setting at the geode level, the material set in my osgText::Text instance takes effect. I'm still confused. Cory Cory Riddell wrote: Can somebody please take a look at the attached osg file. If you open it with osgviewer, you will see the alphabet rendered at the bottom of the screen (might be small) in white. I'm trying to figure out why the text isn't black. I've set a material on my osgText::Text instance but it seems to be ignored. To find the text drawable, search for "ABCDEF". The material looks like: Material { UniqueID Material_106 ColorMode AMBIENT ambientColor 0.2 0.2 0.2 1 diffuseColor FRONT 0 0 0 1 diffuseColor BACK 0.8 0.8 0.8 1 specularColor FRONT 1 1 1 1 specularColor BACK 0 0 0 1 emissionColor 0 0 0 1 shininess FRONT 120 shininess BACK 0 } Thanks. Cory ___ 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
[osg-users] Text::setFont() installs the Font's StateSet?
My app uses the same font everywhere. So, I have a global method to return a reference to a single Font instance: osg::ref_ptrosgText::Font getArialFont() { static osg::ref_ptrosgText::Font s_font = osgText::readFontFile("fonts/arial.ttf"); return s_font; } When I pass it to Text::setFont(), the Text instance's StateSet gets set to the Font's StateSet. Every Text instance ends up sharing the same StateSet and changes to it end up acting globally. Here's the code from osgText::Text: void Text::setFont(osg::ref_ptrFont font) { if (_font==font) return; osg::StateSet* previousFontStateSet = _font.valid() ? _font-getStateSet() : DefaultFont::instance()-getStateSet(); osg::StateSet* newFontStateSet = font.valid() ? font-getStateSet() : DefaultFont::instance()-getStateSet(); if (getStateSet() == previousFontStateSet) { setStateSet( newFontStateSet ); } _font = font; computeGlyphRepresentation(); } If I later set some text to be depth sorted and other text to not be depth sorted, then whomever makes the setting last, wins. I have two questions. 1) Why would you want the Font's StateSet to become the Text's StateSet? Text and Font are very different concepts. 2) Ideally, StateSet would have COW semantics, but it doesn't and it wouldn't be trivial to add. Would it be reasonable to pass a copy of newFontStateSet to Text::setStateSet()? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] MatrixTransform and DYNAMIC
Ok, stupid question. Does a MatrixTransform that will be modified in an update callback need to be declared DYNAMIC? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Is there any examples about OpenThreads?
J-S' advice is right on. You also need to be careful about sharing data between threads. Multithreaded programming is a minefield of difficult to diagnose problems, most caused by locking order problems or data races. I'm still learning about this stuff too and am starting to get some really good results. My biggest problem is making sure I'm always properly synchronizing access to shared data. On modern multi-core machines, it's especially important to get this right. As I understand it, basically every core has it's own cache. So, if some data is shared between multiple threads, it may be loaded into multiple caches all at once. If one thread makes a change, the value cached by the other core/thread is now stale. Synchronizing flushes the caches, so any pending writes are made to the main store. The next time anybody tries to read that value, it won't be in their cache and the data will be read from the main store. I chose to use the boost threads library (I believe this is going to become part of a future C++ standard library) and use boost::mutex for synchronizing access to data. Cory Shiina Ringo wrote: Hi, J-S Thank you for your fantastic advice! Cheers, Shiina -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=18209#18209 ___ 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] text height question
If I create some text using SCREEN_COORDS and a character size of 20, should I expect text 20 pixels high? Say I have three lines total (two \n characters in my text string), should it take up 60 pixels of vertical screen space? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Is there any examples about OpenThreads?
Ulrich, Ulrich Hertlein wrote: Hi Cory, On 13/10/09 3:47 PM, Cory Riddell wrote: As I understand it, basically every core has it's own cache. So, if some data is shared between multiple threads, it may be loaded into multiple caches all at once. If one thread makes a change, the value cached by the other core/thread is now stale. Synchronizing flushes the caches, so any pending writes are made to the main store. The next time anybody tries to read that value, it won't be in their cache and the data will be read from the main store. Just to clarify: Yes, CPUs usually have their own caches and data can be different in the different caches. However, this isn't what synchronization is solving. This problem (cache coherency) is handled by the hardware. The reason you need to do locking is because two threads (which may or may not run on separate cores) might alter the same data in ways so that the result is no longer sane. You might be right. If you want to rely on that, then you really need to know what hardware you are running on and what the memory model is. I don't believe C++ has a standard memory model. The last time I really dug into this was a couple of years ago. If I remember correctly, the Intel chips of that era promised only a very weak memory model. In practice, they had a much stronger memory model. In fact, the only cpu that I know had a very weak memory model was the Alpha and those haven't been around for a while now. I thought cache coherency depended on cues from the software. For example, acquiring or releasing a mutex forces any pending writes to complete then flushed the caches, marking a value as volatile prevented any caching, etc... Is this wrong? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OT: Re: Is there any examples about OpenThreads?
Hi Ulrich, Ulrich Hertlein wrote: On 16/10/09 6:37 PM, Cory Riddell wrote: Ulrich Hertlein wrote: ... Yes, CPUs usually have their own caches and data can be different in the different caches. However, this isn't what synchronization is solving. This problem (cache coherency) is handled by the hardware. The reason you need to do locking is because two threads (which may or may not run on separate cores) might alter the same data in ways so that the result is no longer sane. ... I thought cache coherency depended on cues from the software. For example, acquiring or releasing a mutex forces any pending writes to complete then flushed the caches, marking a value as volatile prevented any caching, etc... Is this wrong? No, a mutex doesn't affect the cache (other than side effects) - the mutex doesn't know what area of memory (variables) it is locking. It's only there to assure that nooneelse enters the critical section at the same time. You're right, of course. I was confusing cache flushing with simple memory barriers (which, I believe, is what a mutex provides). Marking a variable as 'volatile' means that it's read from memory every time it is accessed (the compiler won't attempt to read it into a register). The idea is that someone else (another thread or hardware) might modify the value. 'volatile' an be used in some cases instead of a lock, for example if one thread writes a bool (to indicate some event) and another thread only reads that value. Yep. It turns out that whenever I write some code using a volatile to avoid synchronizing, I invariably end up replacing it with a mutex protected block because a volatile write is not a memory barrier. Usually, it's some variation of this pseudo code: volatile bool isValid = 0 int i = 0 // in thread 1 acquire mutex i = 42 isValid = true release mutex // in thread 2 if (isValid) use i This doesn't work because setting i and isValid inside the critical section may be reordered. Do I have this right? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] multiple root graphs?
I want to create a graph where some nodes have more than one parent, but every parent node doesn't necessary have a non-backtracking path back to the root node. Does this make sense? How about some bad ascii art: A | B C | / D A has been designated as the root but there is a node C that isn't a child of that root. Is this possible? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] multiple root graphs?
Paul Martz wrote: Cory Riddell wrote: I want to create a graph where some nodes have more than one parent, but every parent node doesn't necessary have a non-backtracking path back to the root node. Does this make sense? How about some bad ascii art: A | B C | / D A has been designated as the root but there is a node C that isn't a child of that root. Is this possible? Unless you've hidden some deeper question within your question, the answer is to simply do this: A-addChild( B ); B-addChild( D ); C-addChild( D ); Well, I haven't actually tried it yet, but Gordon says none of the traversal routines will ever see C. This makes sense to me. Is it wrong? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OpenGL error 'out of memory'
When I render my scene, I'm getting this in the log: Warning: detected OpenGL error 'out of memory' after RenderBin::draw(,) This is on a Windows XP machine with 4GB of RAM. I suspect it isn't complaining about running out of that memory though. Is it video RAM that I have run out of? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenGL error 'out of memory'
Nope. Running an ATI FireGL V7700 card. What are some of the legitimate reasons that OpenGL may be unable to allocate memory? Is it likely to be video memory or some other type of memory? Cory Kim Bale wrote: Hi Cory, Are you using frame buffer objects and an nvidia card? Try running the osgprerender example and see if you get the same error. If you do it's a nvidia driver bug. I've come this a number of times and whilst there are legitimate reasons for getting the error in my case it's always been a driver bug. Kim. 2009/11/10 Cory Riddell c...@codeware.com: When I render my scene, I'm getting this in the log: Warning: detected OpenGL error 'out of memory' after RenderBin::draw(,) This is on a Windows XP machine with 4GB of RAM. I suspect it isn't complaining about running out of that memory though. Is it video RAM that I have run out of? Cory ___ 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
[osg-users] backface culling question - black model?
I have an osg file that is about 50 MB (not huge but not trivial). When I load it, the model is entirely black, as if you are looking at a silhouette of it. If I press the 'b' key nothing happens. If I press it again, suddenly everything looks correct. If I keep hitting 'b', it toggles between the silhouette view and the properly coloured view. Any idea why it would be coming up initially black? Why would pressing the 'b' key twice fix the display? Thanks, Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] backface culling question - black model?
Hi Paul, Paul Martz wrote: Cory Riddell wrote: I've attached an example osg file. Load it with osgviewer and it looks black. Hit 'b' twice and suddenly it looks correct. It has something to do with the transform (to a left-handed system), but I haven't been able to track down the problem. Any suggestions would be very appreciated. Hi Cory -- The problem is that you're transforming with a negative Y scale. If I remove that, the model behaves normally. I missed this last month. Is there a problem having a negative y scale? I do that to get a left-handed system. Is there a better way to accomplish this? If it is a problem having the negative y, shouldn't toggling 'b' always return it to the all-black rendering? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] monitoring OpenGL memory usage
I'm getting the infamous Warning: detected OpenGL error 'out of memory' after RenderBin::draw(,) message. Any advice on handling this? My scene isn't very big (maybe 150,000 vertices) and my machine has 3 GB of RAM. Do you monitor or profile memory usage to dynamically tune your application's display? If I knew when I was getting close to exhausting the OpenGL pool, I could re-tesselate to come up with lower resolution models. Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] representing connected entities in a scene graph
How are you representing connected entities in your scene graph? For example, say you wanted to create a model of a guitar from headstock, fretboard, and body objects. I've been doing this with scene graphs that look like: Transform #1 Headstock geode Transform #2 Fretboard geode Transfrom #3 body geode Here I'm using indentation to specify parent-child relationships. For example, Transform #2 has transform #1 for a parent and the fretboard and tranform #3 nodes for children. This seems somewhat awkward and I'm thinking that I'm not seeing something obvious. Care to clue me in? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] representing connected entities in a scene graph
I'm thinking about this more and I think the scene graph structure is probably solid. I'm really having problems coming up with object representations that facilitate generating the correct transforms and I that's not really an OSG issue and thus, is offtopic. Sorry. On 3/3/2010 3:57 PM, Cory Riddell wrote: How are you representing connected entities in your scene graph? For example, say you wanted to create a model of a guitar from headstock, fretboard, and body objects. I've been doing this with scene graphs that look like: Transform #1 Headstock geode Transform #2 Fretboard geode Transfrom #3 body geode Here I'm using indentation to specify parent-child relationships. For example, Transform #2 has transform #1 for a parent and the fretboard and tranform #3 nodes for children. This seems somewhat awkward and I'm thinking that I'm not seeing something obvious. Care to clue me in? Cory ___ 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] better use smart-pointers or plain pointers in this case?
Christian Sam wrote: i think if i use smart-pointers, i would be able to check if the actual polygons in the scenegraph are still valid (check the ref counter) without the need of a dirty flag. but if the polygons get changed/deleted (e.g. when i want to load a new set of polygon features) the properties i'm pointing to wouldn't be deleted as long as the smart-pointers are referencing them. You say that like it's a bad thing. If you use bare pointers, are you ever going to encounter a situation where you have a pointer to something that's been deleted? Using smart pointers (or any RAII wrapper object) is rarely a bad idea. I would be worried however, about overloading the meaning of the reference counter to also indicate dirtiness. I would be tempted to add an isDirty() method. That way you can use a bool or the reference count and can easily change from one implementation to another. Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] zoom and orthographic projections
I'm calling osg::Camera::setProjectionMatrixAsOrtho() and I'm getting an orthographic projection (this is, if I look directly at the face of a cube in wireframe, all I see is a square). I can rotate and pan, but zoom isn't working (I'm dragging the right mouse button). I want to allow the user to toggle between perspective and orthographic projections. Obviously I need to do more than just set the projection matrix, but I'm not sure where to start looking for clues. I've been searching on setProjectionMatrixAsOrtho. What should I be looking for? Thanks, Cory Riddell ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] zoom and orthographic projections
Hi Robert, Our app is a CAD app and all the views are external views of the model. I don't have any near/far plane issues. At first I thought I could simulate an orthographic view by moving the camera very far away then zooming in, but no. Anyway, I won't post to the list about this anymore. But your explanation (and Paul's explanation) of how orthographic views work was helpful. Thanks. Cory Robert Osfield wrote: Hi Cory, Orthographics views don't function like perspective ones, when you move near to the center, nothing actually changes w.r.t your view. This is normal and what you shoudl expect. If you want to "simulate" a perspective view by moving the left, right, top and bottom values of the projection matrix in then it "kinda" works, but and this is a HUGE BUT, you then hit issues what to do about the near and far plane. Soon you'll be trying your really hard to just and get get a orthographic view and perspective to kinda work the same but you'll never get to where you want to get to, perhaps some day after a few weeks of trying you might just come to realization that it can't be done, orthographic views just should never be used like perspetive one. So... rather than waste much of your life, and much of our time trying to support you give up now. Learn that orthographic views are best kept for external views of models where the whole model can be seen, or map views where no issues with the near/far planes exist. Once you get to this point life will be good once more. Robert. On Thu, Mar 26, 2009 at 2:35 PM, Cory Riddell c...@codeware.com wrote: I'm calling osg::Camera::setProjectionMatrixAsOrtho() and I'm getting an orthographic projection (this is, if I look directly at the face of a cube in wireframe, all I see is a square). I can rotate and pan, but zoom isn't working (I'm dragging the right mouse button). I want to allow the user to toggle between perspective and orthographic projections. Obviously I need to do more than just set the projection matrix, but I'm not sure where to start looking for clues. I've been searching on setProjectionMatrixAsOrtho. What should I be looking for? Thanks, Cory Riddell ___ 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] osganimate
According to this page: http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/Examples you need to have OSG_FILE_PATH set. Then "osganimate --overlay" should work. It does for me. Cory ami guru wrote: Hello forum, I am going through the osg examples and i have an issue with one of the following osganimate What is the expected output of that example? - It should be some kind of animation I used the following commands , but getting no animation except the rendering of the base. osganimate --persp ../../../OpenSceneGraph-Data-2.6.0/glider.osg osganimate --ortho ../../../OpenSceneGraph-Data-2.6.0/glider.osg osganimate --object ../../../OpenSceneGraph-Data-2.6.0/glider.osg I must be missing something. Any hint? Regards Sajjad ___ 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: osganimate
If you just type: osgviewer cessna.osg or osgviewer glider.osg do you see the cessna and the glider? It sounds like the files aren't being loaded for some reason. That would suggest either a permissions issue with the OSG_FILE_PATH directory, or perhaps you don't have all the OSG modules available. Did you also make the LD_LIBRARY_PATH change mentioned on that page (I'm assuming you are running Unix). When I run osganimate, I see the cessna and the glider circling above the checkerboard. Cory ami guru wrote: Thanks Cory, I already have the path set as follows: #OpenSceneGraph related flags OPENSCENEGRAPH_PATH=/usr/local/share/OpenSceneGraph/bin OSG_FILE_PATH=/home/sajjad/downloads/OpenSceneGraph/OpenSceneGraph-Data-2.6.0 OSG_NOTIFY_LEVEL=NOTICE export PATH=$PATH:$ACG_PATH:$H3D_PATH:$H3DUTIL_INCLUDE_DIR:$HAPI_INCLUDE_DIR:$WM4_PATH:$OPENSCENEGRAPH_PATH:$OSG_FILE_PATH:$FTGL_PATH: It just render the checkbox plane , but no animation But not working. -- Forwarded message -- From: Cory Riddell c...@codeware.com Date: 2009/3/26 Subject: Re: [osg-users] osganimate To: OpenSceneGraph Users osg-users@lists.openscenegraph.org According to this page: http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/Examples you need to have OSG_FILE_PATH set. Then "osganimate --overlay" should work. It does for me. Cory ami guru wrote: Hello forum, I am going through the osg examples and i have an issue with one of the following osganimate What is the expected output of that example? - It should be some kind of animation I used the following commands , but getting no animation except the rendering of the base. osganimate --persp ../../../OpenSceneGraph-Data-2.6.0/glider.osg osganimate --ortho ../../../OpenSceneGraph-Data-2.6.0/glider.osg osganimate --object ../../../OpenSceneGraph-Data-2.6.0/glider.osg I must be missing something. Any hint? Regards Sajjad ___ 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] CAD style rotation
I tried compiling this into the released 2.8 code and it complained about _horizontalLock and _verticalLock not being defined. Which source tree were you compiling against? Cory Martin Beckett wrote: I cleaned up the code a little to fit osg naming. Removed the Visual Studio pre-compiled headers so it will build anywhere Added mouse wheel zoom and the ability to select the mod keys (horizontal and vertical rotate only) programmatically. Can you check out the 'usage' function and note any other features I missed. Martin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10659#10659 ___ 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] CAD style rotation
Mojtaba and Martin, I like this manipulator and I think it is worthy of inclusion in OSG. Do you plan on submitting it to the submissions list? Cory Martin Beckett wrote: Should be bool _horizontalLock; bool _verticalLock; at the bottom of the SphericalManipulator definition. Sorry - I changed the name in the .h but the zip had the no-h version. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10676#10676 ___ 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] preDrawCallback?
If I want to draw something in the client area of the window OSG is rendering into (via Windows GDI calls), would I do this in a preDrawCallback? (after setting an appropriate ClearMask in the camera) I want to have a gradient background and I'm thinking that I could do this easily with the GradientFill() function. I realize I could accomplish the same thing using methods from the osgHud example, but I'm thinking that a GDI call would be faster. Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] preDrawCallback?
Thanks Robert and Paul. I just assumed that a direct GDI call would be faster, but when I think about it, that can't be true (assuming a decent OpenGL driver). I did as you suggested and it works very well. Mostly. If I resize the window and make it wide and short, my background gradient maintains it's aspect ratio and blue bars on the sides are soon revealed. Do I need to add code to my event handler to recompute the background scene during resize events? Thanks, Cory Robert Osfield wrote: Hi Cory, OpenGL calls used to fill a background colour will be the faster way to accomplish a gradient background and it'll be a portable solution. Robert. On Sat, May 2, 2009 at 1:24 AM, Cory Riddell c...@codeware.com wrote: If I want to draw something in the client area of the window OSG is rendering into (via Windows GDI calls), would I do this in a preDrawCallback? (after setting an appropriate ClearMask in the camera) I want to have a gradient background and I'm thinking that I could do this easily with the GradientFill() function. I realize I could accomplish the same thing using methods from the osgHud example, but I'm thinking that a GDI call would be faster. Cory ___ 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] preDrawCallback?
I'm confused about the code that does the resize in GraphicsContext.cpp (part is pasted below). In my case, my background camera is a slave camera with an absolute reference frame. So, it isn't going to be caught in the if statement on line 7 and will fall through to the else. In this block, it is going to test the resize policy of the main camera rather than my slave (line 18). In my app, the main camera has a HORIZONTAL resize policy. Is it incorrect to have a slave with an absolute frame that differs from the main camera's? 1: // if aspect ratio adjusted change the project matrix to suit. 2: if (aspectRatioChange != 1.0) 3: { 4: osg::View* view = camera-getView(); 5: osg::View::Slave* slave = view ? view-findSlaveForCamera(camera) : 0; 6: 7: if (slave camera-getReferenceFrame()==osg::Transform::RELATIVE_RF) 8: { 9: switch(view-getCamera()-getProjectionResizePolicy()) 10: { 11: case(osg::Camera::HORIZONTAL): slave-_projectionOffset *= osg::Matrix::scale(1.0/aspectRatioChange,1.0,1.0); break; 12: case(osg::Camera::VERTICAL): slave-_projectionOffset *= osg::Matrix::scale(1.0, aspectRatioChange,1.0); break; 13: default: break; 14: } 15: } 16: else 17: { 18: Camera::ProjectionResizePolicy policy = view ? view-getCamera()-getProjectionResizePolicy() : camera-getProjectionResizePolicy(); 19: switch(policy) 20: { 21: case(osg::Camera::HORIZONTAL): camera-getProjectionMatrix() *= osg::Matrix::scale(1.0/aspectRatioChange,1.0,1.0); break; 22: case(osg::Camera::VERTICAL): camera-getProjectionMatrix() *= osg::Matrix::scale(1.0, aspectRatioChange,1.0); break; 23: default: break; 24: } 25: } 26: } Cory Robert Osfield wrote: On Mon, May 4, 2009 at 3:08 PM, Cory Riddell c...@codeware.com wrote: Thanks Robert and Paul. I just assumed that a direct GDI call would be faster, but when I think about it, that can't be true (assuming a decent OpenGL driver). I did as you suggested and it works very well. Mostly. If I resize the window and make it wide and short, my background gradient maintains it's aspect ratio and blue bars on the sides are soon revealed. Do I need to add code to my event handler to recompute the background scene during resize events? You attach Camera's directly to the GraphicsWindow, and if you do this then the GraphicsWindow will do the resize of the viewport and (optionally) the projection matrix as well. The on screen stats uses a Camera in this fashion so have a look at the implementation in src/osgViewer/StatsHandler.cpp. If the GraphicsWindow doesn't know about your Camera they you'll need to manage the resize yourself. 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] preDrawCallback?
I changed the if statement on line 7 into a nested if and now things are working for me. I changed lines 7-9 to: if (slave) { if (camera-getReferenceFrame()==osg::Transform::RELATIVE_RF) { switch(view-getCamera()-getProjectionResizePolicy()) and now everything is working correctly (AFAIK). I'm going to submit this change to the submissions list. Thanks for your help. Cory Cory Riddell wrote: I'm confused about the code that does the resize in GraphicsContext.cpp (part is pasted below). In my case, my background camera is a slave camera with an absolute reference frame. So, it isn't going to be caught in the if statement on line 7 and will fall through to the else. In this block, it is going to test the resize policy of the main camera rather than my slave (line 18). In my app, the main camera has a HORIZONTAL resize policy. Is it incorrect to have a slave with an absolute frame that differs from the main camera's? 1: // if aspect ratio adjusted change the project matrix to suit. 2: if (aspectRatioChange != 1.0) 3: { 4: osg::View* view = camera-getView(); 5: osg::View::Slave* slave = view ? view-findSlaveForCamera(camera) : 0; 6: 7: if (slave camera-getReferenceFrame()==osg::Transform::RELATIVE_RF) 8: { 9: switch(view-getCamera()-getProjectionResizePolicy()) 10: { 11: case(osg::Camera::HORIZONTAL): slave-_projectionOffset *= osg::Matrix::scale(1.0/aspectRatioChange,1.0,1.0); break; 12: case(osg::Camera::VERTICAL): slave-_projectionOffset *= osg::Matrix::scale(1.0, aspectRatioChange,1.0); break; 13: default: break; 14: } 15: } 16: else 17: { 18: Camera::ProjectionResizePolicy policy = view ? view-getCamera()-getProjectionResizePolicy() : camera-getProjectionResizePolicy(); 19: switch(policy) 20: { 21: case(osg::Camera::HORIZONTAL): camera-getProjectionMatrix() *= osg::Matrix::scale(1.0/aspectRatioChange,1.0,1.0); break; 22: case(osg::Camera::VERTICAL): camera-getProjectionMatrix() *= osg::Matrix::scale(1.0, aspectRatioChange,1.0); break; 23: default: break; 24: } 25: } 26: } Cory Robert Osfield wrote: On Mon, May 4, 2009 at 3:08 PM, Cory Riddell c...@codeware.com wrote: Thanks Robert and Paul. I just assumed that a direct GDI call would be faster, but when I think about it, that can't be true (assuming a decent OpenGL driver). I did as you suggested and it works very well. Mostly. If I resize the window and make it wide and short, my background gradient maintains it's aspect ratio and blue bars on the sides are soon revealed. Do I need to add code to my event handler to recompute the background scene during resize events? You attach Camera's directly to the GraphicsWindow, and if you do this then the GraphicsWindow will do the resize of the viewport and (optionally) the projection matrix as well. The on screen stats uses a Camera in this fashion so have a look at the implementation in src/osgViewer/StatsHandler.cpp. If the GraphicsWindow doesn't know about your Camera they you'll need to manage the resize yourself. 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Support becoming less and less personal
Hi Robert, This thread is more than a little worrisome for me. I'm one of the newbies here (been here 5 or 6 months). I looked at OSG and a few other scene graph packages (one of which is not open source). I settled on OSG because the support I received here was by far the most helpful as I started scaling the learning curve. Your voice is one of a handful that have consistently been there answering my (often inane) questions. I truly appreciate it. Nobody has mentioned the big elephant over there, so I will. Why don't you sever the link between the forum and the mailing list? I understand that some people prefer the forum, but we all lose if forum noise kills your enthusiasm for OSG support. The forum could continue independently and if there are enough people who prefer that format, it will thrive. As for the "old school" comment- I think that is probably how a lot of people feel about mailing lists. I wouldn't consider it an insult though. You could always threaten to move everything to an nntp server :). Cory Riddell Robert Osfield wrote: Hi Art, On Wed, May 6, 2009 at 1:07 PM, Art Tevs arti_t...@yahoo.de wrote: So you think using only one name (first or last name, whatever) is already enough for us? I just do want to have some concrete knowledge of what do you want to have. We need some rules, however, in order to implement filtering systems, I need concrete wishes. Ideally you'd have both, the full name so you know which John or Jose you are talking to, and the personal name used in 1 to 1 conversation. Believe me or not, but this possibility is already there. There is some kind of template message appearing whenever you want to write a post through the forum. So users don't even need to type something extra, it is already there. The template looks like: --- Hi, ... Thank you! --- Maybe you have seen the "..." in the posted messages in the last days ;) So, what should I do more? If a user isn't able to even follow that template, what should we then do??? I have no answer for this. The template is useful for sure and may well be a the route to making things map better between forums and mailing list. J.P's suggest of putting the posters name after the Thank you!/Cheers would be probably be good. Forum users seeing something similar to what mailing list users see would certainly be a good sanity check before posting. I was wondering about the signature itself being customizable/tailored to each user. The fullname is already typically displayed as the From address. 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
[osg-users] osganimationtimeline question
When I try to run osganimationtimeline on my machine, I get an error that says: This example works only with osgAnimation/nathan.osg Does anybody have a copy of this file? I think it should probably be distributed with the example, or the example should be removed from the distribution. I'm running 2.8.1 rc4. Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] moving the camera to predefined locations smoothly
I'd like to add be able to move the camera to a predefined location at the click of a toolbar button (e.g. top, bottom, front, side, etc...). I don't want to change the up direction or the center (at) location, so I think all I need to do is change my eye location. I'm thinking about adding a handler for GUIEventAdapter::FRAME to my event handler callback and move the eye a fraction of the way towards the destination. Successive FRAME events would eventually get the camera in the right place and it should be a smooth move. Is this a reasonable way to accomplish my goal? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org