Re: [osg-users] Please test SVN of OpenSceneGraph in prep for 2.7.4 dev release
Builds fine on IRIX, but you knew that already from : http://www.cdash.org/CDashPublic/buildSummary.php?buildid=433 -- Mathieu 2008/10/29 Paul Martz [EMAIL PROTECTED]: WinXP, VS8: OSG compiles and runs fine. Tested my current dev project: runs fine with OSG svn head. -Paul ___ 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] World-space bounds of a node
Hi Jean-Sebastien, a correct way for a world coordinate bounding box ist to set up the 8 corner vertices of the local bounding box using _min and _max. Transform the 8 corners and make their min/max-bounding box. regards Ralph Jean-Sébastien Guay schrieb: Hi all, I was wondering, what's the correct way to get the world space bounds of a node? I can do the following: osg::ComputeBoundsVisitor cbbv; node-accept(cbbv); osg::BoundingBox bb = cbbv.getBoundingBox(); I also have the localToWorld matrix of the node. But just transforming the _min and _max members by the matrix doesn't seem to give the right results... (note that I don't care if the resulting bounding box is axis-aligned - it could even be a bounding sphere) So, what is the correct way to get the bounds? Thanks, J-S ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] choppiness on 2nd graphics card with 4 monitors
Hi Joe, This has to be driver/OS issue, and all you'll be doing on the OSG side is characterising this problem, you won't find a magic fix on the OSG side that will fix this. The only thing left that you could try is to implement the swap groups extensions in osgViewer. This is just a long shot though. I do think it's time to go talk to NVidia about the set up, they might be able to give you a heads up on what to expect. Robert. On Tue, Oct 28, 2008 at 8:53 PM, Joe Lyga [EMAIL PROTECTED] wrote: Hi again, I tried fiddling with OSG_SERIALIZE_DRAW_DISPATCH, but it's not having any effect. Anyway, I was able to duplicate the results I've been getting with my program by just running osgviewer with a simple 3d arrow model (with vsync off). (Monitors 1 and 2 are hooked up to the first graphics card, and monitors 3 and 4 are hooked up to the second graphics card.) The first configuration I tried was running osgviewer full screen on all four monitors. The framerate varies between 30 and 40 fps, and notice the inconsistent frame markings and large draw time. see attached image 1 Second, I tried running osgviewer in a window and dragging it across the first two monitors. The framerate jumps way up to over 1000 fps. see attached image 2 After that, I moved the same window over to monitors 3 and 4. The framerate dropped way down to around 45 fps. see attached image 3 Moving that window back to monitors 1 and 2 made it jump back up to over 1000 fps. After dragging the window over to monitors 3 and 4 again, I went into display properties and disabled monitors 1 and 2. The framerate of the window jumped up to over 1000 fps. see attached image 4 This is very strange. It seems like the second graphics card is waiting on the first. Shouldn't they be running asynchronously? ___ 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] Group Info (Off-topic)
Yeah I am in the top 10 ! :) Next step will be the top 5 ! On Tue, Oct 28, 2008 at 9:01 PM, Paul Martz [EMAIL PROTECTED] wrote: Hi Jeremy, Whoa! I'm the #7 poster (since Jul of last year, it looks like)! I've really got to cut back, jeeze... You think you need to cut back? Not only am I second in the last month, but I'm second AND fifth of all time! I'm trying to keep my number of posts equal to the number of cups of coffee I drink. (Rats! As soon as I press 'send', I have to refill... :-) -Paul ___ 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
Re: [osg-users] Viewer vs. Composite Viewer
Hi Ed, CompositeViewer and Viewer share much of their implementation, the only key difference is that Viewer is a View, while CompositeViewer has a list of Views. All the event handling, camera manipulator and scene graph setting is done a the View level so has identical API to access. This all makes porting between the two pretty straight forward - and it's what I intended for osgViewer, that you can easily swap stuff around later on. Personally I'd just get used to using the Viewer class as it's a little bit simpler, but have a look at the osgcompositeviewer and spot the commonality with how you use the View, this will allow to spot how you might migrate between the two if and when you need to later down the line. Robert. On Tue, Oct 28, 2008 at 8:41 PM, Ed [EMAIL PROTECTED] wrote: After reading osgViewer::Viewer vs osgViewer::CompositeViewer, I think I might need to use CompositeViewer at some point in the future of my project, but not at the outset. Should I begin with the CompositeViewer, or make the necessary mods later? How difficult is it to change from Viewer to CompositeViewer later? Ed ___ 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] QT4 ViewerQOSG and Q_OBJECT
Hi Martin, As I said previously, could you post whole files, I can then do an graphical diff to see your exact changes without any possibility for copy and paste errors. Robert. On Tue, Oct 28, 2008 at 11:49 PM, [EMAIL PROTECTED] wrote: ViewerQOSG declaration in QOSGWidget.h separated out from QOSGWidget.cpp To use the QT moc class definitions must each be in their own header. // Parent class derived from QObject must come first. class ViewerQOSG : public QOSGWidget,public osgViewer::Viewer { //Include this if you want to emit signals, but file will have to go through the moc //Q_OBJECT public: ViewerQOSG(QWidget * parent = 0, const char * name = 0, WindowFlags f = 0): QOSGWidget( parent, name, f ) { getCamera()-setViewport(new osg::Viewport(0,0,width(),height())); // This line causes the image to be stretched vertically on Nvidia (but not ATI) on XP! //getCamera()-setProjectionMatrixAsPerspective(30.0f, static_castdouble(width()) static_castdouble(height()), 1.0f, 1.0f); getCamera()-setGraphicsContext(getGraphicsWindow()); setThreadingModel(osgViewer::Viewer::SingleThreaded); connect(_timer, SIGNAL(timeout()), this, SLOT(update())); _timer.start(10); } virtual void paintEvent( QPaintEvent * event ) { frame(); } protected: QTimer _timer; }; -- Martin ___ 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] TrackballManipulator asymptote
Hi Richard, The trackball slows as you move into the origin as the rate of movement in is always a percentage of distance from the center to the eye point. This is just the way it works, it's not some that can be fixed as it's doing exactly what it's meant to do. Now if you want some custom manipulator that kinda behaves like the TrackballManipulator then you'll need to subclass or just write your own from scratch. One hack you could implement is the pushing forward of the center as you get near to it, rather than just keep reducing the distance between the eye and the center. Robert. On Wed, Oct 29, 2008 at 3:54 AM, Richard Baron Penman [EMAIL PROTECTED] wrote: hello, when I use the TrackballManipulator to view my model I find that the camera velocity slows to zero if I try to approach a certain point, which I believe is the origin. Do you know why this occurs and how it can be prevented? Richard ___ 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] Group Info (Off-topic)
Currently being the #9 of all the time ... don't know if it is a good or a bad thing ^^ 2008/10/29 Serge Lages [EMAIL PROTECTED] Yeah I am in the top 10 ! :) Next step will be the top 5 ! On Tue, Oct 28, 2008 at 9:01 PM, Paul Martz [EMAIL PROTECTED]wrote: Hi Jeremy, Whoa! I'm the #7 poster (since Jul of last year, it looks like)! I've really got to cut back, jeeze... You think you need to cut back? Not only am I second in the last month, but I'm second AND fifth of all time! I'm trying to keep my number of posts equal to the number of cups of coffee I drink. (Rats! As soon as I press 'send', I have to refill... :-) -Paul ___ 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
Re: [osg-users] Test Paged database online
HI All, Nice to see that users are able to access the online paged database now. Truth be told the OSG has been able to do this type of streaming for several years, the recent changes to VPB OSG just make things more efficient - the compressed/NPOT database I uploaded is 1/4 of the size of the conventional paged database, so it downloads quicker. The other cabability that it worth trying out is using the osgfilecache utility to download to local file cache tiles down to a specified level with optional extents. osgfilecache --file-cache MyFileCache -l 4 http://www.openscenegraph.org/data/earth_bayarea/earth.ive osgviewer --file-cache MyFileCache http://www.openscenegraph.org/data/earth_bayarea/earth.ive Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Please test SVN of OpenSceneGraph in prep for 2.7.4 dev release
On Wed, Oct 29, 2008 at 7:05 AM, Mathieu MARACHE [EMAIL PROTECTED] wrote: Builds fine on IRIX, but you knew that already from : http://www.cdash.org/CDashPublic/buildSummary.php?buildid=433 Great to see the dashboard starting to be populated. Is there a way of getting the full warnings, as the listing on the web pages are concatenated. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] AutoRotateToScreen in Text3D
Hi, I'm trying to get Text3D autorotated to screen without using PositionAttitudeTransform or AutoTransform. I believe that TextBase has the method setAutoRotateToScreen(boolean), but it don't seems to work. The other way I guess I can do that is setAxisAlignment(osgText::Text3D::SCREEN). This code is already in osgtext3d example, but it doesn't work for me . Has anybody experienced this issue? Thanks in advance. osgversion: OpenSceneGraph -trunk SO: Ubuntu 8.04 kernel 2.6.24-21 GC: NVidia 8800 GTS CPU: intel quadcore I'd tried to change osgtex3d -- Jordi Torres Fabra Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Please test SVN of OpenSceneGraph in prep for 2.7.4 dev release
On Wed, Oct 29, 2008 at 10:04 AM, Robert Osfield [EMAIL PROTECTED] wrote: On Wed, Oct 29, 2008 at 7:05 AM, Mathieu MARACHE [EMAIL PROTECTED] wrote: Builds fine on IRIX, but you knew that already from : http://www.cdash.org/CDashPublic/buildSummary.php?buildid=433 Great to see the dashboard starting to be populated. Is there a way of getting the full warnings, as the listing on the web pages are concatenated. I've just checked the URL again and it does have all the warnings Other pages don't though... need to work out how to browse this pages properly... Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Mouse Click
Hi all ! I m using the keboard in my aplications until now. I m trying to use the mouse but i cant capture the clicks. I m seeing one example but is using producer :( thank you ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Mouse Click
Hi Carlos, You can take a look to osgkeyboardmouse in osg examples. Regards. 2008/10/29 Carlos Sanches [EMAIL PROTECTED] Hi all ! I m using the keboard in my aplications until now. I m trying to use the mouse but i cant capture the clicks. I m seeing one example but is using producer :( thank you ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OpenSceneGraph-2.7.4 dev release tagged.
Hi All, I have just tagged the OpenSceneGraph-2.7.4 developer release. Downloads on the DeveloperReleases page: http://www.openscenegraph.org/projects/osg/wiki/Downloads/DeveloperReleases * OpenSceneGraph-2.7.4, released on 29th October 2008. OpenSceneGraph-2.7.4, changes include: o New gz plugin for reading gzipped files. o Compression/Uncompression support in .ive using zlib. Use ReaderWriter::Options string compress to enable compression on write. o Support for fine control of mipmapping in osgTerrain::Layer, and support of NPOT textures. o osgDB::DatatabasePager has now mechanism for managing PageLOD expiry - using a target maximum number of active/inactive PagedLOD o osgDB::FileCache Introduced as an extensible mechanism for cache files download from http. o New osgrobot example that demonstrates hierarchies of transforms. o New osggameoflife example that demonstates ping pong RTT. o Various bug and build fixes. source package : OpenSceneGraph-2.7.4.zip svn tag: svn co http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-2.7.4 OpenSceneGraph Full ChangeLog since last dev release below. Robert. -- ChangeLog since 2.7.3 2008-10-29 11:51 + [r9077] robert: * From Blasius Czink, changed the CHECK_CXX_SOURCE_RUNS macro slightly to avoid the compile problems due to bugged intrin.h. In such a case the mutex fallback will be used (see attached file). 2008-10-29 11:15 + [r9076] robert: * Warning fixes 2008-10-29 11:09 + [r9075] robert: * Added missing implementations 2008-10-29 10:56 + [r9074] robert: * Updated ChangeLog and AUTHORS.txt for 2.7.4 release 2008-10-29 10:38 + [r9073] robert: * Updated wrappers 2008-10-29 10:25 + [r9072] robert: * From Lukas Diduch, added a multithread compsite viewer path, accessible using: osgviewerQT --MTCompositeViewer --QOSGWidget cow.osg 2008-10-29 10:12 + [r9071] robert: * From James Moliere, fixed display of axis 2008-10-28 17:28 + [r9070] robert: * From Lionel Lagrade, I've replaced readsome by read+gcount. From Robert Osfeld, added throw on uncompress error. 2008-10-27 19:59 + [r9069] robert: * From Chris Denham, changed nested Camera intersection test so that it requires the command line --relative-camera-scene to enable it 2008-10-27 17:42 + [r9068] robert: * Added --help-env docs for OSG_MAX_PAGEDLOD 2008-10-27 17:11 + [r9066-9067] robert: * Merged in comment split code from the old flt plugin so that FLT comments string with returns in them are put into separate description entries. * From Wojciech Lewandowski, I am sending a really minor fix for StatsHandler::reset method. We dynamically add and remove slave cameras in our application. StatsHandler does not automatically adapt to this situation, and we call StatsHandler::reset to force it to update number of cameras and their graphs. Unfortunately, if stats were already drawn, reset would not remove former graph drawables and they would remain frozen below new stats. This update fixes it. 2008-10-27 16:16 + [r9065] robert: * From Chris Denham, default scene that tests the use of in scene graph Camera which has a RELATIVE_RF ReferenceFrame. 2008-10-27 16:06 + [r9064] robert: * From Chris Denham, fixed support of in scene graph osg::Camera's with ReferenceFrame of RELATIVE_RF. 2008-10-27 15:26 + [r9063] robert: * From Katharina Plugge, I found a bug in the OpenFlight-Plugin. When exporting to OpenFlight it could happen that palettes of an external reference like the texture palette are set wrong, because they are overwritten by parent settings (userData), which actually do not refer to palette entries respectively ParentPools (happens for example if a Transform is parent of a ProxyNode). The static cast from userData to ParentPools should therefore be a dynamic cast. --- function FltExportVisitor::writeExternalReference( const osg::ProxyNode proxy ): Line 423 in file expPrimaryRecords.cpp has to be changed from const ParentPools* pp = static_castconst ParentPools*(proxy.getUserData() ); to const ParentPools* pp = dynamic_castconst ParentPools*(proxy.getUserData() ); 2008-10-27 13:09 + [r9062] robert: * Various warning fixes 2008-10-27 11:49 + [r9061] robert: * Updated wrappers 2008-10-27 11:08 + [r9060] robert: * From Mathias Froehlich, This change is a result of a recent thread on osg-users. The
Re: [osg-users] auto-capture example: capturing an image from a PagedLOD Database
Hi Robert, There isn't much to go wrong is this method, so I doubt there is a bug in it. I suspect the read queues are just being emptied really fast so you are missing when they are not empty. Or perhaps you are testing the wrong DatabasePager. I think I've got the correct DatabasePager(?). This is a single view application and I get hold of the DatabasePager in the following way: osgDB::DatabasePager* pager = viewer-getDatabasePager(); Before the first frame is rendered I get the following debug info: viewer-done()=false pager-getFileRequestListSize()=0 pager-getDataToCompileListSize()=0 pager-requiresUpdateSceneGraph()=false pager-isRunning()=false pager-getNumFramesActive()=0 pager-getNumDatabaseThreads()=2 pager-getAcceptNewDatabaseRequests()=true After the first frame and all consecutive frames I get the following states: viewer-done()=false pager-getFileRequestListSize()=0 pager-getDataToCompileListSize()=0 pager-requiresUpdateSceneGraph()=false pager-isRunning()=true pager-getNumFramesActive()=0 pager-getNumDatabaseThreads()=2 pager-getAcceptNewDatabaseRequests()=true Only the state of DatabasePager::isRunning() changes to true and it does not seems to go back to false again. I have accidentally managed to get pager-getDataToCompileListSize() to return 1 once or twice, but nothing I can base a while-loop on. I guess I'll just have to trace my way through the debugger to find out what I'm doing wrong, unless you have any further info to share. Best regards, John Robert Osfield wrote: Hi John, On Tue, Oct 28, 2008 at 4:16 PM, John Vidar Larring [EMAIL PROTECTED] wrote: I was hoping this would work too, but getDatabasePager()-getFileRequestListSize() _always_ returns 0 (zero). So I am hoping that this is either a bug that can be fixed or that there is another method for checking whether the DatabasePager is done / idle (!?) There isn't much to go wrong is this method, so I doubt there is a bug in it. I suspect the read queues are just being emptied really fast so you are missing when they are not empty. Or perhaps you are testing the wrong DatabasePager. You could also check the getDataToCompileListSize() to see if it has anything it in, and there isn't a present a DataToMergeListSize() method which there should probably. The sum of all these would probably be the thing that would test against to see if there isn't pending in the pager. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Best regards, John WeatherOne -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Mouse Click
Ok i did it . thanks if ( osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON==ea.getButton()) { time (start); return true; } On Wed, Oct 29, 2008 at 9:41 AM, Jordi Torres [EMAIL PROTECTED]wrote: Hi Carlos, You can take a look to osgkeyboardmouse in osg examples. Regards. 2008/10/29 Carlos Sanches [EMAIL PROTECTED] Hi all ! I m using the keboard in my aplications until now. I m trying to use the mouse but i cant capture the clicks. I m seeing one example but is using producer :( thank you ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Carlos Sanches Analista de Sistemas e computação gráfica Tel: 55 11 3816 2888 Cel: 55 11 9650 7137 Somar Meteorologia www.somarmeteorologia.com.br ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] auto-capture example: capturing an image from a PagedLOD Database
Hi John, Are you planning to submit this example for inclusion with the OSG example set? If so then I could integrate then I and others could tweak it so it works. Robert. On Wed, Oct 29, 2008 at 12:51 PM, John Vidar Larring [EMAIL PROTECTED] wrote: Hi Robert, There isn't much to go wrong is this method, so I doubt there is a bug in it. I suspect the read queues are just being emptied really fast so you are missing when they are not empty. Or perhaps you are testing the wrong DatabasePager. I think I've got the correct DatabasePager(?). This is a single view application and I get hold of the DatabasePager in the following way: osgDB::DatabasePager* pager = viewer-getDatabasePager(); Before the first frame is rendered I get the following debug info: viewer-done()=false pager-getFileRequestListSize()=0 pager-getDataToCompileListSize()=0 pager-requiresUpdateSceneGraph()=false pager-isRunning()=false pager-getNumFramesActive()=0 pager-getNumDatabaseThreads()=2 pager-getAcceptNewDatabaseRequests()=true After the first frame and all consecutive frames I get the following states: viewer-done()=false pager-getFileRequestListSize()=0 pager-getDataToCompileListSize()=0 pager-requiresUpdateSceneGraph()=false pager-isRunning()=true pager-getNumFramesActive()=0 pager-getNumDatabaseThreads()=2 pager-getAcceptNewDatabaseRequests()=true Only the state of DatabasePager::isRunning() changes to true and it does not seems to go back to false again. I have accidentally managed to get pager-getDataToCompileListSize() to return 1 once or twice, but nothing I can base a while-loop on. I guess I'll just have to trace my way through the debugger to find out what I'm doing wrong, unless you have any further info to share. Best regards, John Robert Osfield wrote: Hi John, On Tue, Oct 28, 2008 at 4:16 PM, John Vidar Larring [EMAIL PROTECTED] wrote: I was hoping this would work too, but getDatabasePager()-getFileRequestListSize() _always_ returns 0 (zero). So I am hoping that this is either a bug that can be fixed or that there is another method for checking whether the DatabasePager is done / idle (!?) There isn't much to go wrong is this method, so I doubt there is a bug in it. I suspect the read queues are just being emptied really fast so you are missing when they are not empty. Or perhaps you are testing the wrong DatabasePager. You could also check the getDataToCompileListSize() to see if it has anything it in, and there isn't a present a DataToMergeListSize() method which there should probably. The sum of all these would probably be the thing that would test against to see if there isn't pending in the pager. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Best regards, John WeatherOne -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ___ 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] World-space bounds of a node
Hi Paul, Hi J-S -- I recently wrote my own visitor to flatten transforms. To do this, I use osg::computeLocalToWorld(osg::NodePath) to get the local-to-world matrix, and transform all vertices by that matrix. Yes, I've done that in the past too, and after fiddling for a while with the order of operations and how to transform vectors properly (as opposed to points/vertices) I got it to work too. This works great for me, and what you are doing sounds like an equivalent operation, so I'm not sure why it's not working for you. Can you provide more details on the failure? Well, say I have this (pseudo code) osg::BoundingBox combinedWorldBB; foreach node in selectedNodes add node's BB (world-space) to combinedWorldBB end The result I get is that when the root transform of my group of nodes is identity, I get a bounding box of: _min = ( -1.4047172 , -0.94869113 , -1.9402435 ) _max = ( 2.7989883 , 0.95002991 , 0.33612174 ) which is a bounding box of approximate size (4, 2, 2.3) centered approximately at (0.6, 0, -0.8). If I translate the root of those nodes by -5 in Z (and they look correctly transformed), I get this bounding box: _min = ( -1.4047172 , -0.94869113 , -11.940244 ) _max = ( 2.7989883 , 0.95002991 , -5.3083067 ) which is a bounding box of approximate size (4, 2, 6.6) centered approximately at (0.6, 0, -8.6). So you can see, the bounding box changes much more than a simple translation by -5 in Z... My code is: void getWorldBounds(osg::Node* node, osg::BoundingBox bb) { GetWorldCoordOfNodeVisitor worldVisitor; node-accept(worldVisitor); osg::Matrix localToWorld = worldVisitor.getMatrix(); osg::ComputeBoundsVisitor cbbv; node-accept(cbbv); osg::BoundingBox localBB = cbbv.getBoundingBox(); for (unsigned int i = 0; i 8; i++) { bb.expandBy(localBB.corner(i) * localToWorld); } } // ... Then in a method: osg::BoundingBox bb; foreach (osg::Node* node, selectedNodes) { getWorldBounds(node, bb); } // Results inspected at this point in the debugger. Any ideas? Thanks in advance, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] 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
[osg-users] Multiple parents, unique states and selective lights
Hi, I have a situation where I have Geodes with multiple parents. This means that the Drawables in the scenegraph might be rendered multiple times with different transforms depending on the node path to the root. The problem is that I need to be able to set a unique set of shader uniforms for the different rendered instancies of the same Drawable. What I want to do is to test the bounding sphere of the instance against that of the lights in the scene and set the uniforms based on this test. We do not use osg::Lights since we do not have to support fixed function pipeline, and the lights are stored in a separate datastructure in world space since light calculations is done in world space in the shaders. An idea that I have is to add a drawcallback to the Drawable. In the callback I use RenderInfo::getState to retrieve the state for that instance. State::getInitialInverseMatrix combined with State::worldViewMatrix would give me the world matrix. The world matrix is used to transform the bounding sphere of the drawable and it can then be used for intersection tests. Im not really sure how to set the uniforms at this stage though. As I understand (from stepping trough the code) it is to late to change/add a stateset. I suppose that it would be possible to inject some OpenGL code, but this make me think that there might be a better solution. Is there a better way of achieving what I want than the idea i outlined above? By the way: What does initial means in State::getInitialInverseMatrix)? /Andreas Lindmark ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] If I want to use wxWidgets with OSG, do I need a particular version of wxWidgets?
If I want to use wxWidgets with OSG, do I need a particular version of wxWidgets? Ed ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Shadows in osgviewerQT?
Hi, I'm trying to embed osg in a Qt4 application. I've had some troubles with FSAA/multisampling but managed to work around it by configuring the QGLWidget for FSAA instead of osg. However, I'm now trying to get shadows to work based on the osgshadow code, and it seems that no matter which shadowing technique I try it brings my machine to a grinding halt - the whole screen starts to flicker wildly, circles and balls reminiscent of Katamari Damacy are drawn into the scene, and when continuous update (via timer) is enabled I have no recourse but to restart my machine. (This is one of the new Intel Macbooks running OS X 10.5) I gather that when embedded in Qt, the GraphicsWindowCarbon code isn't used and osg just uses the existing GL context. Does that mean that I would have to manually setup Qt's GL context and somehow synchronize it with osg's shadow magic? If all that is meant to be supported in the Qt viewer, is there any chance you could add an example for this situation? Thanks in advance, -Julian ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] auto-capture example: capturing an image from a PagedLOD Database
Hi Robert, Are you planning to submit this example for inclusion with the OSG example set? If so then I could integrate then I and others could tweak it so it works. Yes, that was basically the plan, only that I originally wanted to submit a working example;) The reason for putting together this example in the first place was to create an application scenario that could make it interesting for others to solve this particular DatabasePager problem as well. I'll try out a few more hunches before cleaning up and submitting the example, working or not working. Best regards, John -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] If I want to use wxWidgets with OSG, do I need a particular version of wxWidgets?
Hi Ed, I am using 2.8.7, but the latest stable version should work as well. Regards, Maciej 2008/10/29 Ed [EMAIL PROTECTED] If I want to use wxWidgets with OSG, do I need a particular version of wxWidgets? Ed ___ 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] If I want to use wxWidgets with OSG, do I need a particular version of wxWidgets?
Hi Ed, Any latest version of wxWidgets is ok, I think. I have succeeded compiling with 2.8.6, 2.8.7 and 2.8.8 before. Wang Rui 2008/10/29 Ed [EMAIL PROTECTED] If I want to use wxWidgets with OSG, do I need a particular version of wxWidgets? Ed ___ 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] If I want to use wxWidgets with OSG, do I need a particular version of wxWidgets?
I thought the latest version should work, but when I try to build the osgviewerWX examples I get the following errors Maybe I am missing something Scanning dependencies of target example_osgviewerWX [ 98%] Building CXX object examples/osgviewerWX/CMakeFiles/example_osgviewerWX.dir/osgviewerWX.o In file included from /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:18: /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.h:14: error: expected class-name before ?{? token /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp: In member function ?virtual bool wxOsgApp::OnInit()?: /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:49: error: ?WX_GL_DOUBLEBUFFER? was not declared in this scope /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:50: error: ?WX_GL_RGBA? was not declared in this scope /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:51: error: ?WX_GL_DEPTH_SIZE? was not declared in this scope /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:53: error: ?WX_GL_STENCIL_SIZE? was not declared in this scope /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp: At global scope: /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:114: error: ?wxGLCanvas? has not been declared /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:115: error: invalid static_cast from type ?void (OSGCanvas::*)(wxSizeEvent)? to type ?void (wxEvtHandler::*)(wxSizeEvent)? /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:116: error: invalid static_cast from type ?void (OSGCanvas::*)(wxPaintEvent)? to type ?void (wxEvtHandler::*)(wxPaintEvent)? /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:117: error: invalid static_cast from type ?void (OSGCanvas::*)(wxEraseEvent)? to type ?void (wxEvtHandler::*)(wxEraseEvent)? /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:119: error: invalid static_cast from type ?void (OSGCanvas::*)(wxKeyEvent)? to type ?void (wxEvtHandler::*)(wxKeyEvent)? /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:120: error: invalid static_cast from type ?void (OSGCanvas::*)(wxKeyEvent)? to type ?void (wxEvtHandler::*)(wxKeyEvent)? /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:122: error: invalid static_cast from type ?void (OSGCanvas::*)(wxMouseEvent)? to type ?void (wxEvtHandler::*)(wxMouseEvent)? /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:123: error: invalid static_cast from type ?void (OSGCanvas::*)(wxMouseEvent)? to type ?void (wxEvtHandler::*)(wxMouseEvent)? /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:124: error: invalid static_cast from type ?void (OSGCanvas::*)(wxMouseEvent)? to type ?void (wxEvtHandler::*)(wxMouseEvent)? /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:125: error: invalid static_cast from type ?void (OSGCanvas::*)(wxMouseEvent)? to type ?void (wxEvtHandler::*)(wxMouseEvent)? /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:126: error: invalid static_cast from type ?void (OSGCanvas::*)(wxMouseEvent)? to type ?void (wxEvtHandler::*)(wxMouseEvent)? /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:127: error: invalid static_cast from type ?void (OSGCanvas::*)(wxMouseEvent)? to type ?void (wxEvtHandler::*)(wxMouseEvent)? /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:128: error: invalid static_cast from type ?void (OSGCanvas::*)(wxMouseEvent)? to type ?void (wxEvtHandler::*)(wxMouseEvent)? /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:129: error: invalid static_cast from type ?void (OSGCanvas::*)(wxMouseEvent)? to type ?void (wxEvtHandler::*)(wxMouseEvent)? /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp: In constructor ?OSGCanvas::OSGCanvas(wxWindow*, wxWindowID, const wxPoint, const wxSize, long int, const wxString, int*)?: /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp:134: error: class ?OSGCanvas? does not have any field named ?wxGLCanvas? /home/epeddycoart/development/Libraries/OpenSceneGraph/examples/osgviewerWX/osgviewerWX.cpp: In member function ?void OSGCanvas::OnPaint(wxPaintEvent)?:
Re: [osg-users] Multiple parents, unique states and selective lights
Hi Andreas, Andreas Lindmark schrieb: Hi, I have a situation where I have Geodes with multiple parents. This means that the Drawables in the scenegraph might be rendered multiple times with different transforms depending on the node path to the root. The problem is that I need to be able to set a unique set of shader uniforms for the different rendered instancies of the same Drawable. What I want to do is to test the bounding sphere of the instance against that of the lights in the scene and set the uniforms based on this test. We do not use osg::Lights since we do not have to support fixed function pipeline, and the lights are stored in a separate datastructure in world space since light calculations is done in world space in the shaders. An idea that I have is to add a drawcallback to the Drawable. In the callback I use RenderInfo::getState to retrieve the state for that instance. State::getInitialInverseMatrix combined with State::worldViewMatrix would give me the world matrix. The world matrix is used to transform the bounding sphere of the drawable and it can then be used for intersection tests. Im not really sure how to set the uniforms at this stage though. As I understand (from stepping trough the code) it is to late to change/add a stateset. I suppose that it would be possible to inject some OpenGL code, but this make me think that there might be a better solution. Is there a better way of achieving what I want than the idea i outlined above? You could add the position dependend StateSet directly to the Transforms (in osg every osg::Node can have its own StateSet). You could do this in an updateCallback. By the way: What does initial means in State::getInitialInverseMatrix)? /Andreas Lindmark Regards, Peter Hrenka -- Vorstand/Board of Management: Dr. Bernd Finkbeiner, Dr. Florian Geyer, Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech Vorsitzender des Aufsichtsrats/ Chairman of the Supervisory Board: Prof. Dr. Hanns Ruder Sitz/Registered Office: Tuebingen Registergericht/Registration Court: Stuttgart Registernummer/Commercial Register No.: HRB 382196 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgShadow question (ATI related?)
Hi Wojtek, Thanks for your hints! I have made the adjustment to StandardShadowMap and MinimalDrawBoundsShadowMap like for ShadowMap. With the LightSpacePerspectiveShadowMap I then get almost-correct shadows when looking straight down along the Z axis (at a shadow-casting object), with the viewpoint coordinate system aligned to the world coordinate system. The shadows move away from the objects that cast them when I move/aim the viewpoint. When I just use StandardShadowMap (with the ShadowMap adjustment), the shadows are correct. (However, there is a small gap between the (shadow-casting) objects and their shadow, possibly polygon offset-related?) When I just use MinimalShadowMap or MinimalDrawBoundsShadowMap, the shadows are correct, but only when the bounding box (displayed when using setDebugDraw) of the shadow-casting objects is completely within view. When the bounding box is partially outside the viewing frustum, the shadows are correct only from certain viewpoint positions/orientations. If I then move/aim the viewpoint, the shadows move away from the objects that cast them (and eventually disappear in some cases). From just looking at the debug HUD, you could say that the shadows get 'more correct' when the (shadow-casting objects) bounding box is less 'deformed'. Any ideas? I will keep looking into tomorrow, starting at the MinimalShadowMap level as this seems to be the lowest level at which the problem occurs on my system. Cheers, Rick. PS: I also experimented with the MinimalDrawBoundsShadowMap, calling setShadowReceivingCoarseBoundAccuracy with EMPTY_BOX and BOUNDING_SPHERE, giving the following results: EMPTY_BOX: no shadows are visible, debug HUD shows an empty shadow map BOUNDING_SPHERE: shadows visible from certain viewpoint positions/orientations, but not in the correct place. The debug HUD shows shadow map with projected bounding box etc. Hi Again Rick, Small errata: I forgot to add .cpp suffixes to the files I suggest to modify. So fixes should be done in MinimalDrawBoundShadowMap.cpp line 225 and StandardShadowMap.cpp line 753 Let us know if this helps, if it does, I will be smarter next time when this question appears again. Cheers, Wojtek Rick, I don't know how to help you with your particular problem. But I hope these 2 hints could be useful: I suppose it would be fairly simple to make similar adjustment for LisPSM as you did for ShadowMap. Texgen matrix for LispSM is set in MinimalDrawBoundShadowMap line 225. For safety you should also adjust StandardShadowMap line 753. Second code path is used when you select LispSM variant based on MinimalCullBoundsShadowMap or MinimalShadowMap. Maybe when you activate debug HUD ( call DebugShadowMap::setDebugDraw( true ) ) it will be easier to see and fix the problem. Cheers, Wojtek -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Rick Middelkoop Sent: Tuesday, October 28, 2008 7:13 PM To: osg-users@lists.openscenegraph.org Subject: [osg-users] osgShadow question (ATI related?) Hello, I'm trying to add shadows to the application I'm working on, and encountered two issues which seems to be ATI card/driver related. The first issue is, that shadows generated using the ShadowMap technique are in the wrong location, both in the application I'm working on and the 'osgshadow' example. Only the ShadowTexture technique gives correct results. For example, in the 'aircraft above terrain' example scene with the ShadowMap technique (osgshadow --sm -2), there is a shadow on the ground below the aircraft, but it is turning in the opposite direction to the aircraft. A colleague who is using an Nvidia card is seeing correct shadows in the example. After searching the osg mailing list I found a few clues towards solving the problem, one was that ATI had inverted a coordinate of the FBO-texture in their drivers: http://archive.netbsd.se/?ml=openscenegraph-submissionsa=2008-02m=6605417 The solution was to mirror the shadow map along the Y axis in the ShadowMap::cull() function: _texgen-setPlanesFromMatrix( osg::Matrix::scale(1.0, -1.0, 1.0) * _camera-getProjectionMatrix() * osg::Matrix::translate(1.0,1.0,1.0) * osg::Matrix::scale(0.5f,0.5f,0.5f) ); (I am using a Radeon X1800 series card with the Catalyst 8.9 drivers, and the osg2.7.3 developer release. However, the effect also occurs with the osg2.2 stable release.) Now for the second, still unsolved issue: At the moment, I am looking at using the LightSpacePerspectiveShadowMap technique in the application. However, the problem here is that when changing the viewpoint position or orientation, the shadows also move or rotate! It is very difficult to see what is going on from the position or movements of the shadows in this case. However, when I mirror the shadow map (like in the code
[osg-users] Callbacks: operator() call
Hi, I'm having some trouble when using a whole lot of callbacks at the same time... Apparently it has something to do with the order that they're being called. I want to know how is it done. Are the operator()'s executed one by one in a given order or are they executed in a parallel manner? Thanks, Renan M Z Mendes ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] World-space bounds of a node
Hi all, Any ideas? Anyone? J-S (previous message below in case you don't know what I'm talking about) Jean-Sébastien Guay wrote: Hi Paul, Hi J-S -- I recently wrote my own visitor to flatten transforms. To do this, I use osg::computeLocalToWorld(osg::NodePath) to get the local-to-world matrix, and transform all vertices by that matrix. Yes, I've done that in the past too, and after fiddling for a while with the order of operations and how to transform vectors properly (as opposed to points/vertices) I got it to work too. This works great for me, and what you are doing sounds like an equivalent operation, so I'm not sure why it's not working for you. Can you provide more details on the failure? Well, say I have this (pseudo code) osg::BoundingBox combinedWorldBB; foreach node in selectedNodes add node's BB (world-space) to combinedWorldBB end The result I get is that when the root transform of my group of nodes is identity, I get a bounding box of: _min = ( -1.4047172 , -0.94869113 , -1.9402435 ) _max = ( 2.7989883 , 0.95002991 , 0.33612174 ) which is a bounding box of approximate size (4, 2, 2.3) centered approximately at (0.6, 0, -0.8). If I translate the root of those nodes by -5 in Z (and they look correctly transformed), I get this bounding box: _min = ( -1.4047172 , -0.94869113 , -11.940244 ) _max = ( 2.7989883 , 0.95002991 , -5.3083067 ) which is a bounding box of approximate size (4, 2, 6.6) centered approximately at (0.6, 0, -8.6). So you can see, the bounding box changes much more than a simple translation by -5 in Z... My code is: void getWorldBounds(osg::Node* node, osg::BoundingBox bb) { GetWorldCoordOfNodeVisitor worldVisitor; node-accept(worldVisitor); osg::Matrix localToWorld = worldVisitor.getMatrix(); osg::ComputeBoundsVisitor cbbv; node-accept(cbbv); osg::BoundingBox localBB = cbbv.getBoundingBox(); for (unsigned int i = 0; i 8; i++) { bb.expandBy(localBB.corner(i) * localToWorld); } } // ... Then in a method: osg::BoundingBox bb; foreach (osg::Node* node, selectedNodes) { getWorldBounds(node, bb); } // Results inspected at this point in the debugger. Any ideas? Thanks in advance, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] World-space bounds of a node
Jean-Sébastien Guay wrote: Hi all, Any ideas? Anyone? I can only give you a tip: try to render the bbox with the scene to see what's going on... Paul J-S (previous message below in case you don't know what I'm talking about) Jean-Sébastien Guay wrote: Hi Paul, Hi J-S -- I recently wrote my own visitor to flatten transforms. To do this, I use osg::computeLocalToWorld(osg::NodePath) to get the local-to-world matrix, and transform all vertices by that matrix. Yes, I've done that in the past too, and after fiddling for a while with the order of operations and how to transform vectors properly (as opposed to points/vertices) I got it to work too. This works great for me, and what you are doing sounds like an equivalent operation, so I'm not sure why it's not working for you. Can you provide more details on the failure? Well, say I have this (pseudo code) osg::BoundingBox combinedWorldBB; foreach node in selectedNodes add node's BB (world-space) to combinedWorldBB end The result I get is that when the root transform of my group of nodes is identity, I get a bounding box of: _min = ( -1.4047172 , -0.94869113 , -1.9402435 ) _max = ( 2.7989883 , 0.95002991 , 0.33612174 ) which is a bounding box of approximate size (4, 2, 2.3) centered approximately at (0.6, 0, -0.8). If I translate the root of those nodes by -5 in Z (and they look correctly transformed), I get this bounding box: _min = ( -1.4047172 , -0.94869113 , -11.940244 ) _max = ( 2.7989883 , 0.95002991 , -5.3083067 ) which is a bounding box of approximate size (4, 2, 6.6) centered approximately at (0.6, 0, -8.6). So you can see, the bounding box changes much more than a simple translation by -5 in Z... My code is: void getWorldBounds(osg::Node* node, osg::BoundingBox bb) { GetWorldCoordOfNodeVisitor worldVisitor; node-accept(worldVisitor); osg::Matrix localToWorld = worldVisitor.getMatrix(); osg::ComputeBoundsVisitor cbbv; node-accept(cbbv); osg::BoundingBox localBB = cbbv.getBoundingBox(); for (unsigned int i = 0; i 8; i++) { bb.expandBy(localBB.corner(i) * localToWorld); } } // ... Then in a method: osg::BoundingBox bb; foreach (osg::Node* node, selectedNodes) { getWorldBounds(node, bb); } // Results inspected at this point in the debugger. Any ideas? Thanks in advance, J-S ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] World-space bounds of a node
Jean-Sébastien Guay wrote: Hi all, Any ideas? Anyone? J-S (previous message below in case you don't know what I'm talking about) Jean-Sébastien Guay wrote: Hi Paul, Hi J-S -- I recently wrote my own visitor to flatten transforms. To do this, I use osg::computeLocalToWorld(osg::NodePath) to get the local-to-world matrix, and transform all vertices by that matrix. Yes, I've done that in the past too, and after fiddling for a while with the order of operations and how to transform vectors properly (as opposed to points/vertices) I got it to work too. This works great for me, and what you are doing sounds like an equivalent operation, so I'm not sure why it's not working for you. Can you provide more details on the failure? Well, say I have this (pseudo code) osg::BoundingBox combinedWorldBB; foreach node in selectedNodes add node's BB (world-space) to combinedWorldBB end The result I get is that when the root transform of my group of nodes is identity, I get a bounding box of: _min = ( -1.4047172 , -0.94869113 , -1.9402435 ) _max = ( 2.7989883 , 0.95002991 , 0.33612174 ) which is a bounding box of approximate size (4, 2, 2.3) centered approximately at (0.6, 0, -0.8). If I translate the root of those nodes by -5 in Z (and they look correctly transformed), I get this bounding box: _min = ( -1.4047172 , -0.94869113 , -11.940244 ) _max = ( 2.7989883 , 0.95002991 , -5.3083067 ) Interestingly enough min xseems to have been decremented by twice -5... won't help you, but just an observation :) Paul which is a bounding box of approximate size (4, 2, 6.6) centered approximately at (0.6, 0, -8.6). So you can see, the bounding box changes much more than a simple translation by -5 in Z... My code is: void getWorldBounds(osg::Node* node, osg::BoundingBox bb) { GetWorldCoordOfNodeVisitor worldVisitor; node-accept(worldVisitor); osg::Matrix localToWorld = worldVisitor.getMatrix(); osg::ComputeBoundsVisitor cbbv; node-accept(cbbv); osg::BoundingBox localBB = cbbv.getBoundingBox(); for (unsigned int i = 0; i 8; i++) { bb.expandBy(localBB.corner(i) * localToWorld); } } // ... Then in a method: osg::BoundingBox bb; foreach (osg::Node* node, selectedNodes) { getWorldBounds(node, bb); } // Results inspected at this point in the debugger. Any ideas? Thanks in advance, J-S ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] World-space bounds of a node
Hi Paul, _min = ( -1.4047172 , -0.94869113 , -1.9402435 ) _max = ( 2.7989883 , 0.95002991 , 0.33612174 ) ... _min = ( -1.4047172 , -0.94869113 , -11.940244 ) _max = ( 2.7989883 , 0.95002991 , -5.3083067 ) Interestingly enough min xseems to have been decremented by twice -5... won't help you, but just an observation :) Yeah, that would corroborate my results, where the center of the box is translated by ~1.5 times -5... But I can see the results, what I want to know is what the cause is... I'll have to go a bit deeper if no one has any ideas. Thanks for trying, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] 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
[osg-users] mingw build problems
Hi! I encountered some problems while building OSG using mingw. 1) can't build osgwrappers. on 32 bit windows, ld goes up to about 2GB mem usage and then aborts. Cross-compiling on 64 bit linux, it went up to a whopping 5GB after 10 minutes, at which point I had to kill it as I only have 3GB ram and it was swapping like crazy. I might try to abuse one of our servers with 16GB ram later, just to see whether it finishes eventually :) PID USER PR NI VIRT RES SHR S %CPU %MEMTIME+ COMMAND 22624 hcs 20 0 5472m 2.8g 540 D 11 93.8 10:00.29 ld $ /usr/i586-mingw32msvc/bin/ld --version GNU ld (GNU Binutils) 2.18.50.20080109 Native linux builds fine (uses about 800MB) 2) None of the OPENTHREADS_ATOMIC_USE flags work. I assume either gcc or win32 interlocked would be the right choice. As I am using gcc, I went for the GCC builtins first, but I get errors: CMakeFiles/OpenThreads.dir/__/common/Atomic.cpp.obj:Atomic.cpp:(.text+0x3b): undefined reference to `___sync_bool_compare_and_swap_4' CMakeFiles/OpenThreads.dir/__/common/Atomic.cpp.obj:Atomic.cpp:(.text+0xa5): undefined reference to `___sync_sub_and_fetch_4' CMakeFiles/OpenThreads.dir/__/common/Atomic.cpp.obj:Atomic.cpp:(.text+0xc5): undefined reference to `___sync_add_and_fetch_4' CMakeFiles/OpenThreads.dir/__/common/Atomic.cpp.obj:Atomic.cpp:(.text+0x61): undefined reference to `___sync_fetch_and_xor_4' CMakeFiles/OpenThreads.dir/__/common/Atomic.cpp.obj:Atomic.cpp:(.text+0x71): undefined reference to `___sync_fetch_and_or_4' CMakeFiles/OpenThreads.dir/__/common/Atomic.cpp.obj:Atomic.cpp:(.text+0x81): undefined reference to `___sync_fetch_and_and_4' collect2: ld returned 1 exit status make[2]: *** [bin/libOpenThreads.dll] Error 1 The single thing I found using google about this was that gcc seems to think these intrisics are not supported. Next I tried win32 interlocked, but apparently that relies on msvc instrinics: OpenThreads/common/Atomic.cpp:18:20: error: intrin.h: No such file or directory OpenThreads/common/Atomic.cpp: In member function 'unsigned int OpenThreads::Atomic::operator++()': OpenThreads/common/Atomic.cpp:46: error: invalid conversion from 'volatile long int*' to 'long int*' OpenThreads/common/Atomic.cpp:46: error: initializing argument 1 of 'LONG InterlockedIncrement(long int*)' OpenThreads/common/Atomic.cpp: In member function 'unsigned int OpenThreads::Atomic::operator--()': OpenThreads/common/Atomic.cpp:60: error: invalid conversion from 'volatile long int*' to 'long int*' OpenThreads/common/Atomic.cpp:60: error: initializing argument 1 of 'LONG InterlockedDecrement(long int*)' OpenThreads/common/Atomic.cpp: In member function 'unsigned int OpenThreads::Atomic::AND(unsigned int)': OpenThreads/common/Atomic.cpp:74: error: '_InterlockedAnd' was not declared in this scope OpenThreads/common/Atomic.cpp: In member function 'unsigned int OpenThreads::Atomic::OR(unsigned int)': OpenThreads/common/Atomic.cpp:88: error: '_InterlockedOr' was not declared in this scope OpenThreads/common/Atomic.cpp: In member function 'unsigned int OpenThreads::Atomic::XOR(unsigned int)': OpenThreads/common/Atomic.cpp:102: error: '_InterlockedXor' was not declared in this scope OpenThreads/common/Atomic.cpp: In member function 'unsigned int OpenThreads::Atomic::exchange(unsigned int)': OpenThreads/common/Atomic.cpp:117: error: invalid conversion from 'volatile long int*' to 'long int*' OpenThreads/common/Atomic.cpp:117: error: initializing argument 1 of 'LONG InterlockedExchange(long int*, LONG)' OpenThreads/common/Atomic.cpp: In member function 'OpenThreads::Atomic::operator unsigned int() const': OpenThreads/common/Atomic.cpp:132: error: 'MemoryBarrier' was not declared in this scope OpenThreads/common/Atomic.cpp:133: error: invalid static_cast from type 'const volatile long int' to type 'const volatile unsigned int' OpenThreads/common/Atomic.cpp: In member function 'void* OpenThreads::AtomicPtr::get() const': OpenThreads/common/Atomic.cpp:163: error: 'MemoryBarrier' was not declared in this scope make[2]: *** [src/OpenThreads/win32/CMakeFiles/OpenThreads.dir/__/common/Atomic.cpp.obj] Error 1 make[1]: *** [src/OpenThreads/win32/CMakeFiles/OpenThreads.dir/all] Error 2 make: *** [all] Error 2 (msdn says these come from winbase.h, so I removed the intrin.h reference, but still no luck) Note, I get a working OSG with the fall-back implementation, but I assume that is suboptimal in terms of performance. 3) the libtiff I use (version 3.8.2) depends on libjpeg and zlib (just like libpng depends on zlib). Cmake doesn't handle this. How can I pass this information to the build process? -- Thanks, Csaba ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] mingw build problems
Hi Csaba, 2) None of the OPENTHREADS_ATOMIC_USE flags work. I assume either gcc or win32 interlocked would be the right choice. As I am using gcc, I went for the GCC builtins first, but I get errors: Matthias will give you the complete answer, but I think the gcc builtins need a recent gcc (4.x+), whereas I think MinGW is stuck at gcc 3.x... And for the win32 interlocked, you need to be compiling with VC++ (which you can do with makefiles by calling cc.exe, but the CMake generated makefiles for MinGW surely use gcc only, so it won't be an option for you). Sorry, but I don't think you'll be able to use anything other than the mutex fallback on MinGW unless you modify the MinGW CMake files to generate makefiles that use cc.exe - and install Visual Studio... J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] World-space bounds of a node
Jean-Sébastien Guay wrote: Hi Paul, _min = ( -1.4047172 , -0.94869113 , -1.9402435 ) _max = ( 2.7989883 , 0.95002991 , 0.33612174 ) ... _min = ( -1.4047172 , -0.94869113 , -11.940244 ) _max = ( 2.7989883 , 0.95002991 , -5.3083067 ) Interestingly enough min xseems to have been decremented by twice -5... won't help you, but just an observation :) Yeah, that would corroborate my results, where the center of the box is translated by ~1.5 times -5... But I can see the results, what I want to know is what the cause is... I'll have to go a bit deeper if no one has any ideas. Are you sure that the compute bounds visitor doesn't already compute a world space bound? You are applying the local to world transform again to that bbox, which might explain the double Z -5 transform Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Multiple parents, unique states and selective lights
2008/10/29 Peter Hrenka [EMAIL PROTECTED] Hi Andreas, Andreas Lindmark schrieb: Hi, I have a situation where I have Geodes with multiple parents. This means that the Drawables in the scenegraph might be rendered multiple times with different transforms depending on the node path to the root. The problem is that I need to be able to set a unique set of shader uniforms for the different rendered instancies of the same Drawable. What I want to do is to test the bounding sphere of the instance against that of the lights in the scene and set the uniforms based on this test. We do not use osg::Lights since we do not have to support fixed function pipeline, and the lights are stored in a separate datastructure in world space since light calculations is done in world space in the shaders. An idea that I have is to add a drawcallback to the Drawable. In the callback I use RenderInfo::getState to retrieve the state for that instance. State::getInitialInverseMatrix combined with State::worldViewMatrix would give me the world matrix. The world matrix is used to transform the bounding sphere of the drawable and it can then be used for intersection tests. Im not really sure how to set the uniforms at this stage though. As I understand (from stepping trough the code) it is to late to change/add a stateset. I suppose that it would be possible to inject some OpenGL code, but this make me think that there might be a better solution. Is there a better way of achieving what I want than the idea i outlined above? You could add the position dependend StateSet directly to the Transforms (in osg every osg::Node can have its own StateSet). You could do this in an updateCallback. Regards, Peter Hrenka Hi Peter, I thought about doing something along those lines, but the trouble is that the Transforms or nodes above the transforms can also have have multiple parents and become part of several node paths.. Consider the following: A Root with two children (T1 and T2). T1 And T2 both have Group as a child that in its turn have two transforms as children (T3, and T4). T3 and T4 has the Geode as a child. Primitive text graph art: Root / \ T1 T2 \/ group /\ T3 T4 \/ Geode Geode will now render as four objects with four different matricies (T1*T3, T1*T4, T2*T3 and T2*T3) even though Geode only has two parents. Regards, Andreas ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] mingw build problems
On Wed, Oct 29, 2008 at 9:05 PM, Jean-Sébastien Guay [EMAIL PROTECTED] wrote: Hi Csaba, 2) None of the OPENTHREADS_ATOMIC_USE flags work. I assume either gcc or win32 interlocked would be the right choice. As I am using gcc, I went for the GCC builtins first, but I get errors: Matthias will give you the complete answer, but I think the gcc builtins need a recent gcc (4.x+), whereas I think MinGW is stuck at gcc 3.x... Hi J-S, I have a recent gcc: $ i586-mingw32msvc-gcc --version i586-mingw32msvc-gcc (GCC) 4.2.1-sjlj (mingw32-2) And for the win32 interlocked, you need to be compiling with VC++ (which you can do with makefiles by calling cc.exe, but the CMake generated makefiles for MinGW surely use gcc only, so it won't be an option for you). Yeah, that's what I figured too. So I guess I have to get the gcc builtins to work if possible. -- Csaba ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgShadow question (ATI related?)
Hi Rick, I am afraid you are on your own - I will not be able to help much. Shadow mapping issues could be really hard ;-( I would need to grab similar board, roll up the sleeves and start debuging. But I don't have the time nor access to such hardware. [..] When I just use StandardShadowMap (with the ShadowMap adjustment), the shadows are correct. (However, there is a small gap between the (shadow-casting) objects and their shadow, possibly polygon offset-related?) Probably. I don't have another idea. When I just use MinimalShadowMap or MinimalDrawBoundsShadowMap, the shadows are correct, but only when the bounding box (displayed when using setDebugDraw) of the shadow-casting objects is completely within view. When the bounding box is partially outside the viewing frustum, the shadows are correct only from certain viewpoint positions/orientations. If I then move/aim the viewpoint, the shadows move away from the objects that cast them (and eventually disappear in some cases). From just looking at the debug HUD, you could say that the shadows get 'more correct' when the (shadow-casting objects) bounding box is less 'deformed'. Any ideas? It does not sound like easy one. Are you sure that ATI bug only affects texture application ? Maybe render to texture is also flipped somehow. I assume you have modified texgen matrix but not shadow camera projection matrix (the one involved in computation of texgen matrix) ? If shadow camera projection gets modified it could potentially affect rest of the code. Actually, one idea just came to my mind, MinimalDrawBoundsShadowMap does rough depth map prerender to compute visible shadowed scene extents. I suppose reverted vertical texture coordinates may also affect this code. You may look at MinimaDrawBounds line 203 - its the place where matrix for prerenderd image scan is computed - and you may need to make the fixes there. As a alternative approach, you could try LightSpacePerspectiveShadowMapCB and see if the problem is also present ? LightSpacePerspectiveShadowMapCB variant computes shadowed volume by scanning boxes around drawables in render bins and should avoid at least this potential prerenderd image scanning issue. I will keep looking into tomorrow, starting at the MinimalShadowMap level as this seems to be the lowest level at which the problem occurs on my system. Good luck. And let me know if you come up with some constructive conclusion, possible fixes or workarounds. Cheers, Wojtek RE PS: EMPTY_BOX: no shadows are visible, debug HUD shows an empty shadow map BOUNDING_SPHERE: shadows visible from certain viewpoint positions/orientations, but not in the correct place. The debug HUD shows shadow map with projected bounding box etc. Default setting may impact performance but should be safest. I am not 100% sure that other options are completely bug free so I would suggest not experimenting with this if you have other problems. Usage of these options also heavily depends on the light type. Leave it at default if you use spot or omnidirectional light. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] mingw build problems
On Wed, Oct 29, 2008 at 11:15 PM, Csaba Halász [EMAIL PROTECTED] wrote: Yeah, that's what I figured too. So I guess I have to get the gcc builtins to work if possible. Ok, you can strike this from the list. I used -DCMAKE_CXX_FLAGS_RELEASE=-O2 -march=i686 and that just got added as a variable but did not get used. Apparently I have to specify it is a STRING, so -DCMAKE_CXX_FLAGS_RELEASE:STRING=-O2 -march=i686 works fine. For the tiff issue, I have compiled a libtiff without jpeg or zlib support, but that isn't really an acceptable solution. -- Csaba ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] mingw build problems
Have run into another trouble, I had to add OSGSHADOW_EXPORT to each of the embedded protected ViewData struct's in the osgShadow lib, otherwise I get linking errors with the osgshadow example. If it doesn't break other platforms, can they be added in svn? -- Csaba ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org