[osg-users] OSG world coordinates to 2D screen coordinates
Hi, I'm using OSG as part of a VR software package and I'm trying to implement picking with a 6DOF tracking system. I'm having trouble finding a way to convert the position of my tracking object (right now just a sphere) from its world coordinates to screen coordinates so I can use the xy coordinates to pick with. I'm porting my environment over from a normal monitor setup (where I can use a mouse for picking and already have all the code written) to a 3 sided cave setup where a mouse does not work. Im thinking of a hacky way to do it that I think would work if I knew how osg normalized mouse coordinates with osg::GUIEventAdapter::getXnormalized(), but I cannot for the life of me find the code for that function. If anyone knows of a method to convert world coordinates back to screen coordinates without having to totally reimplement my picking system, that would be great. If anyone can point me to the code for getXnormalized or the method used (I've found some - but they don't lead to the exact same result), that would be great as well. Thanks! Luke -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30194#30194 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] so libraries - linux 64 bit
Hi, While compiling and installing OSG source version OpenSceneGraph-2.8.3 on Linux Ubuntu 10.04 - 64 bit with kernel 2.6.32-23-generic I noticed the shared object libraries were not visible to some downstream compile/execute environments like SimGear/FlightGear. I did the install with the suggested command sudo make install_ld_conf When I checked with ldconfig -v the /usr/local/lib64 files (the osg .so files) were not listed. There is a file called /etc/ld.so.conf.d/openscenegraph.conf which contains the line /usr/locallib64 If this is changed to /usr/local/lib64 and the ldconfig run again the osg...so files are now listed and the downstream compiles all work. ... I am not sure what forum this comment belongs in but I thought it might be of some help to somebody. Cheers, skip -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30203#30203 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] To freeze an AnimationPath to a desired time
Good morning, I didn't find the solution yet... Impossible to go to a static desired point of the animation. If you have an idea... Thanks a lot. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30207#30207 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] so libraries - linux 64 bit
Hi Skip, The OSG libraries have a SO version that is bumped when binary compatibility (ABI) is bumped with a previous version. This prevents 3rd party application that was built against one ABI from linking from to another OSG lib with a different ABI which is good thing as it prevents crashes/linking problems. In your case I'd guess that FlightGear is linked against a previous version of the OSG with an older SO version number. Robert. On Thu, Jul 22, 2010 at 10:59 PM, skip hodgson skip...@ozemail.com.au wrote: Hi, While compiling and installing OSG source version OpenSceneGraph-2.8.3 on Linux Ubuntu 10.04 - 64 bit with kernel 2.6.32-23-generic I noticed the shared object libraries were not visible to some downstream compile/execute environments like SimGear/FlightGear. I did the install with the suggested command sudo make install_ld_conf When I checked with ldconfig -v the /usr/local/lib64 files (the osg .so files) were not listed. There is a file called /etc/ld.so.conf.d/openscenegraph.conf which contains the line /usr/locallib64 If this is changed to /usr/local/lib64 and the ldconfig run again the osg...so files are now listed and the downstream compiles all work. ... I am not sure what forum this comment belongs in but I thought it might be of some help to somebody. Cheers, skip -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30203#30203 ___ 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] To freeze an AnimationPath to a desired time
Hi Mathieu, The OSG's FrameStamp that is used to synchronize animations/simulation code has a SimulationTime field that you can set to control the time used. By default the osgViewer::Viewer/CompositeViewer will set the SimulationTime automatically for based on time since the application started, but you can override this easily by calling Viewer::frame(double simulationTime). Robert. On Fri, Jul 23, 2010 at 10:13 AM, Mathieu Scorpionis mathieu@gmail.com wrote: Good morning, I didn't find the solution yet... Impossible to go to a static desired point of the animation. If you have an idea... Thanks a lot. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30207#30207 ___ 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] so libraries - linux 64 bit
Hi Robert, I don't think this is an issue of version numbers. NO version of osg so files was on the LD path because of the foul up in the ld.so.conf.d file that sets up the loader cache. I suspect it is put there by the make install_ld_conf command because if I run it again it trashes the loader config file the same as before and I have to fix it manually again. Anyway it's fixed now. ... Thank you for your comments and interest! Cheers, skip -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30210#30210 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG world coordinates to 2D screen coordinates
Hi Luke, [...] osg::GUIEventAdapter::getXnormalized(), but I cannot for the life of me find the code for that function. It's directly in the header (include/osgGA/GUIEventAdapter): inline float getXnormalized() const { return 2.0f*(getX()-getXmin())/(getXmax()-getXmin())-1.0f; } If anyone knows of a method to convert world coordinates back to screen coordinates without having to totally reimplement my picking system, that would be great. If anyone can point me to the code for getXnormalized or the method used (I've found some - but they don't lead to the exact same result), that would be great as well. Search the archives, I answered the opposite of this question not long ago (how to convert a screen position to a world space position), which should be easy to reverse to find out what you want to. I'll even make it real easy for you: http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/59941/focus=59966 But you'll have to do the work of taking those calculations and reversing them to get from world space to screen space. Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] ANN: OSGUIsh updated (GUI-like events for OSG nodes)
Hi Leandro, I've updated my old OSGUIsh library, so that it works with newer versions of OSG. This small library allows to register functions that get called when GUI-like events (mouse click, mouse move, key down...) happen on a specific OSG node. Interesting project! One question: how do you pronounce the name? :-) It seems like a mix of an acronym and a word, but I'm wondering if you'd say oh-ess-gooey-ish or oh-ess-gee-you-ish or what? Hehehe... Anyways, I understand the point that it's GUI-ish (kinda like a GUI toolkit) events for OSG but I was just wondering. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] ANN: OSGUIsh updated (GUI-like events for OSG nodes)
On Fri, Jul 23, 2010 at 9:51 AM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi Leandro, I've updated my old OSGUIsh library, so that it works with newer versions of OSG. This small library allows to register functions that get called when GUI-like events (mouse click, mouse move, key down...) happen on a specific OSG node. Interesting project! One question: how do you pronounce the name? :-) It seems like a mix of an acronym and a word, but I'm wondering if you'd say oh-ess-gooey-ish or oh-ess-gee-you-ish or what? I pronounce oss-goo-ish, but the name is bad that I can't ask people to pronounce it in any specific way :-P LMB ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to set new PAT position for every traversal run ?
Hi Tom, Yes, I should have probbaly tried outputting values to the console a little earlier. It appears there is a bug in VS 2005 while setting a watch on variables in member functions in classes. So I have managed to narrow down my problem to the following lines of code: xPos and yPos are legitimate value. However backhoeContactPoint.x and .y show 0 as output. I also noted that the Intersection backhoeIntersection has its member matrixd showing: error unable to access inavlid memory location. But this method was working for me when I was updating position through keyboard input. Code: //PROBLEM STARTS FROM HERE AS CONSOLE OUTPUT SHOWS VALUE 0: osgUtil::LineSegmentIntersector* backhoeLocationSegment = new osgUtil::LineSegmentIntersector( osg::Vec3d(xPos, yPos, 9), osg::Vec3d(xPos, yPos, -9)); osgUtil::IntersectionVisitor findBackhoeElevationVisitor; findBackhoeElevationVisitor.setIntersector(backhoeLocationSegment); surface-accept(findBackhoeElevationVisitor); osgUtil::LineSegmentIntersector::Intersection backhoeIntersection = backhoeLocationSegment-getFirstIntersection(); osg::Vec3d backhoeContactPoint = backhoeIntersection.getWorldIntersectPoint(); Console::WriteLine(backhoeContactPoint.x: {0}, backhoeContactPoint.x()); Console::WriteLine(backhoeContactPoint.y: {0}, backhoeContactPoint.y()); return backhoeContactPoint; What can I infer from this ? Thanks, Sanat -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30214#30214 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to set new PAT position for every traversal run ?
Do you know if you actually have found an intersection? Try adding the statement if(backhoeLocationSegment-containsIntersections()). If you don't have a valid intersection, how are you supposed to get coordinates out of it? Cheers, Tom -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30215#30215 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to set new PAT position for every traversal run ?
Hi Tom, Thanks for catching that ! You're right that there are no interesctions. But my surface is not a NULL and my x, y coordinates are also valid numbers as I check with console output statements. I found the reason for this behavior. I was using a stream of coordinates data and these ccordinates are not always over the terrain surface I was using. And in those cases that the coordinates were off my surface, I just gave a default value if 0 to elev and in cases where the coordinates lie over my surface, the intersector finds intersections and places the model correctly over my terrain surface. Thanks for the tips... Regards, Sanat. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30216#30216 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG on IPhone
Hi, I am very delighted to see that the porting is making progress, and I would like to contribute. Here are my experiences so far: I did the following to get the code: Code: git clone http://github.com/stmh/osg.git cd osg git branch -a git checkout remotes/origin/iphone Now my remarks / questions (so far): 1. Is this the right way to get the (current) code? 2. The XCode Project is referencing files from osgIntrospection which are all missing? 3. Can it be built for the Simulator? Trying to build for Simulator 4.0 I get compile errors apparently because struct stat64 is unknown. There is some logic whether to #define stat64 stat but it seems to fail? (using 10.4) Code: osg.git/osg/IPhone_Project/../src/osgDB/FileUtils.cpp: In function 'bool osgDB::makeDirectory(const std::string)': osg.git/osg/IPhone_Project/../src/osgDB/FileUtils.cpp:139: error: aggregate 'stat64 stbuf' has incomplete type and cannot be defined 4. Project tries to build freetype Plugin. Code: osg.git/osg/IPhone_Project/../src/osgPlugins/freetype/FreeTypeFont.h:19:0 Ft2build.h: No such file or directory in /Users/fke/osg.git/osg/IPhone_Project/../src/osgPlugins/freetype/FreeTypeFont.h The file IPhone_Project/3rdParty/lib/libFreeType_iphone_universal.a is there and 3rdparty/include/freetype2 also, but there seems to be a problem with wrong case? The file in the repository is: ft2build.h (but include-Statement says: Ft2build.h). Now some more general questions: A. Is there a publically available issue tracker for OSG and/or OSG on iOS ? B. Should we open a List (in terms of forum structure) specifically for iOS support? C. How is the process for submitting code changes to the iOS branch? Cheers, Florian -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30217#30217 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgSim HeightAboveTerrain performance...
All, I was wanting some feedback for those who have used osgSim in querying VPB database info such has HAT, LOS, etc., during runtime. I'm seeing some performance issues when using osgSim::HeightAboveTerrain::computeHeightAboveTerrain(.) to get the HAT value for a particular location in the database. At times, we need multiple HAT values per frame which seems to bog the performance down. I would surmise that LOS calculations are probably worse since multiple intersections are computed. My question is, is how efficient is the osgSim HAT function? Is the process of retrieving HAT a slow one? If so, is there a way to improve performance if one or more HAT requests are issued on a per frame basis? Thanks in advance, -Shayne smime.p7s Description: S/MIME cryptographic signature ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] My Lines Disapering but Ploygons don't
Hi David, First off, let me say that I'm a complete rookie when it comes to OSG but I was experiencing ( as far as I can tell by your post ) the same exact thing quite some time ago. I resolved my problem with some help from people on this list so the least I can do is provide you with that same info and hope that it helps you. I looked at the osgdepthpartion example and found a class in that example called DepthPartitionNode. I used that class in my project and placed it at the root of my scene just like the example code shows. After that I could zoom into my models and terrain without the effects of the near clipping plane that you describe. All I can say is give it shot and see if it works! :) Someone else will need to explain how it works though! By the way, I'm one of your neighbors up the road here at Edwards AFB! Good luck! Greg -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30219#30219 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] 3D software for OSG objects and general licensingquestion
Peter, I'm not a modeler per se, but using either 3D Studio Max (3ds file format) or the Multigen-Paradigm (flt file format) tools would work well. OSG will allow you to import these popular file formats into OSG for rendering. -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Peter Sonnek Sent: Friday, July 23, 2010 12:30 PM To: osg-users@lists.openscenegraph.org Subject: [osg-users] 3D software for OSG objects and general licensingquestion Hello OSG and user community, I am new to OSG and would like to ask for advice on additional 3D software for creating OSG objects and licensing issues. I was asked to look into the possibility to create a 3D first person walk through of a large research facility by my colleges at University. I have made my self a little familiar with OSG through some of the examples posted and believe it may be a viable tool to achieve this goal. For this I will have to create several realistic looking buildings and scientific apparatus and I would like to do so using a 3rd party 3D studio (to avoid having to do it all with programing it from GL primitives). I have not worked with these studios before but the OSG website mentions several which are compatible with OSG. Could anyone make a suggestion on which will be useful for my purposes so I can make an informed purchase? Also, when finished, the software will be offered for public download as part of the outreach program for this facility. The facility is non-profit and government funded and the release will be free of charge through its collaboration. From what I have read the OSG license supports this without royalty fees or restrictions, but I wanted to ask in case I have misinterpreted this. This is my first post to this mailing list and I want to apologize if it is not in conformation with posting standards or rules. Thank you for your help and suggestions. I am looking forward to productive work with the OSG software. bye Peter -- Open WebMail Project (http://openwebmail.org) Debian Project (http://www.debian.org) ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org smime.p7s Description: S/MIME cryptographic signature ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Multiple viewports in osgViewer
Hi, I am trying to figure out how I can get two viewports in one window to show 2 different osg scenes, videos in particular. I tried the CompositeViewer, but it gives me two separate windows. I would like one window splitted in the middle, the right side showing one video and the left side showing the other video. So, my question is, can I either make the CompositeViewer show the 2 scenes in one and the same window or can I set the Viewer to have two viewports? Or do you have any other idea how to do this? Thank you very much for any hints! Stefanie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30220#30220 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Multiple viewports in osgViewer
On Fri, 2010-07-23 at 20:03 +0200, Stefanie Hoepner wrote: Hi, I am trying to figure out how I can get two viewports in one window to show 2 different osg scenes, videos in particular. I tried the CompositeViewer, but it gives me two separate windows. I would like one window splitted in the middle, the right side showing one video and the left side showing the other video. So, my question is, can I either make the CompositeViewer show the 2 scenes in one and the same window or can I set the Viewer to have two viewports? Or do you have any other idea how to do this? Thank you very much for any hints! Here's an example I have in osgCairo showing how to do what you want: http://code.google.com/p/osgcairo/source/browse/trunk/examples/osgcairoviewer/osgcairoviewer.cpp At the bottom, in main(). You can see how I create two osgViewer::View objects, set their viewports, and then add them to the CompositeViewer. Stefanie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30220#30220 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Follow us on Twitter! http://twitter.com/emperorlinux EmperorLinux, Inc. http://www.emperorlinux.com 1-888-651-6686 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG world coordinates to 2D screen coordinates
Thanks a lot Jean, that was exactly what I needed. I actually read this first thing this morning but was so excited to get started on it I forgot to reply and thank you. Luke -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30225#30225 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Multiple viewports in osgViewer
That works! Thank you! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30226#30226 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] event traversal: camera manipulator executed before or after eventCallback?
Hi, due to my orientation problem with my viewmatrix, I try do understand the frame cycle to write a overview page in the wiki. the framecylce consists of 4 parts: Code: advance(); eventTraversal(); updateTraversal(); drawTraversal(); My question: - The camera manipulators handle(); function is called by the the eventTraversal, right? - is the manipulators handle() function called before or after the execution of the callback function? - I would like to use the callback to catch some external camera data, then calculate the camera position/attitude immediately and send thsi resulting camera modelview to other hosts to apply this camerasetting to their cameras. - is it possible only be the viewmatrix or do I have to transfer other data? I tried to get this information directly from the osg sources, but my knowledge is currently insufficient to unterstand the code at this aspect.. (yes, I'm one of these guys commenting code not to loose the overview, so I'm struggling at pure code..) Thank you a lot! Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30227#30227 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] segfault on writeObject - 64 bit
Hi, Having compiled osg vers 2.8.3 from the svn sources and subsequently compiled, linked and installed SimGear and FlightGear on a 64 bit Ubuntu Linux system the application runs fine for most options but I am puzzled about this one segfault at runtime. Start up Flight Gear /usr/local/bin/fgfs When it starts click on Debug|Dump Scene Graph It writes a large file to disk (always within a few bytes of 749938) and then segfaults. This is always the same. The gdb backtrace is as follows: --START OF GDB OUTPUT Program received signal SIGSEGV, Segmentation fault. 0x755b7c41 in OpenThreads::Atomic::operator unsigned int() const () from /usr/local/lib64/libosgParticle.so.65 (gdb) bt #0 0x755b7c41 in OpenThreads::Atomic::operator unsigned int() const () from /usr/local/lib64/libosgParticle.so.65 #1 0x755b7c62 in osg::Referenced::referenceCount() const () from /usr/local/lib64/libosgParticle.so.65 #2 0x74642e8c in osgDB::Registry::writeObject(osg::Object const, osgDB::Output) () from /usr/local/lib64/libosgDB.so.65 #3 0x7462e2d5 in osgDB::Output::writeObject(osg::Object const) () from /usr/local/lib64/libosgDB.so.65 #4 0x009af9ce in simgear::EffectGeode_writeLocalData (obj=..., fw=...) at EffectGeode.cxx:100 #5 0x74643891 in osgDB::Registry::writeObject(osg::Object const, osgDB::Output) () from /usr/local/lib64/libosgDB.so.65 #6 0x7462e2d5 in osgDB::Output::writeObject(osg::Object const) () from /usr/local/lib64/libosgDB.so.65 #7 0x7fffd93f62cc in Group_writeLocalData(osg::Object const, osgDB::Output) () from /raid/local/lib64/osgPlugins-2.8.3/osgdb_osg.so #8 0x74643891 in osgDB::Registry::writeObject(osg::Object const, osgDB::Output) () from /usr/local/lib64/libosgDB.so.65 #9 0x7462e2d5 in osgDB::Output::writeObject(osg::Object const) () from /usr/local/lib64/libosgDB.so.65 #10 0x7fffd93f62cc in Group_writeLocalData(osg::Object const, osgDB::Output) () from /raid/local/lib64/osgPlugins-2.8.3/osgdb_osg.so #11 0x74643891 in osgDB::Registry::writeObject(osg::Object const, osgDB::Output) () from /usr/local/lib64/libosgDB.so.65 #12 0x7462e2d5 in osgDB::Output::writeObject(osg::Object const) () from /usr/local/lib64/libosgDB.so.65 #13 0x7fffd93f62cc in Group_writeLocalData(osg::Object const, osgDB::Output) () from /raid/local/lib64/osgPlugins-2.8.3/osgdb_osg.so #14 0x74643891 in osgDB::Registry::writeObject(osg::Object const, osgDB::Output) () from /usr/local/lib64/libosgDB.so.65 #15 0x7462e2d5 in osgDB::Output::writeObject(osg::Object const) () from /usr/local/lib64/libosgDB.so.65 #16 0x7fffd93f62cc in Group_writeLocalData(osg::Object const, osgDB::Output) () from /raid/local/lib64/osgPlugins-2.8.3/osgdb_osg.so #17 0x74643891 in osgDB::Registry::writeObject(osg::Object const, osgDB::Output) () from /usr/local/lib64/libosgDB.so.65 #18 0x7462e2d5 in osgDB::Output::writeObject(osg::Object const) () from /usr/local/lib64/libosgDB.so.65 #19 0x7fffd93f62cc in Group_writeLocalData(osg::Object const, osgDB::Output) () from /raid/local/lib64/osgPlugins-2.8.3/osgdb_osg.so #20 0x74643891 in osgDB::Registry::writeObject(osg::Object const, osgDB::Output) () from /usr/local/lib64/libosgDB.so.65 #21 0x7462e2d5 in osgDB::Output::writeObject(osg::Object const) () from /usr/local/lib64/libosgDB.so.65 #22 0x7fffd93f62cc in Group_writeLocalData(osg::Object const, osgDB::Output) () from /raid/local/lib64/osgPlugins-2.8.3/osgdb_osg.so #23 0x74643891 in osgDB::Registry::writeObject(osg::Object const, osgDB::Output) () from /usr/local/lib64/libosgDB.so.65 #24 0x7462e2d5 in osgDB::Output::writeObject(osg::Object const) () from /usr/local/lib64/libosgDB.so.65 #25 0x7fffd93f62cc in Group_writeLocalData(osg::Object const, osgDB::Output) () from /raid/local/lib64/osgPlugins-2.8.3/osgdb_osg.so #26 0x74643891 in osgDB::Registry::writeObject(osg::Object const, osgDB::Output) () from /usr/local/lib64/libosgDB.so.65 #27 0x7462e2d5 in osgDB::Output::writeObject(osg::Object const) () from /usr/local/lib64/libosgDB.so.65 #28 0x7fffd93f62cc in Group_writeLocalData(osg::Object const, osgDB::Output) () from /raid/local/lib64/osgPlugins-2.8.3/osgdb_osg.so #29 0x74643891 in osgDB::Registry::writeObject(osg::Object const, osgDB::Output) () from /usr/local/lib64/libosgDB.so.65 #30 0x7462e2d5 in osgDB::Output::writeObject(osg::Object const) () from /usr/local/lib64/libosgDB.so.65 #31 0x7fffd93f62cc in Group_writeLocalData(osg::Object const, osgDB::Output) () from /raid/local/lib64/osgPlugins-2.8.3/osgdb_osg.so #32 0x74643891 in osgDB::Registry::writeObject(osg::Object const, osgDB::Output) () from /usr/local/lib64/libosgDB.so.65 #33 0x7462e2d5 in osgDB::Output::writeObject(osg::Object const) () from /usr/local/lib64/libosgDB.so.65 #34
[osg-users] 2D RenderBin vs depth test
Hi, I am using Render to Texture of OSG to render a video in my QT application. I am trying to overlay a few different drawables (mainly text and lines that might change vertices on the fly) on top of the video when user turns them on. The verices might change but it is not a real animation. So basically I would like to show or hide the 2D drawables. I have a ortho 2D camera fixed at the video scene, so everything is 2D. I appreciate if you give me some insight in the concept of Geode vs Drawable. Which method seems more natural and is faster. 1- Having one Geode with multiple drawables that have slightly different depth, so I can hide something just by lowering the z-order 2- Having multiple Geodes and use the mask to hide or show them, which requires assigning bin numbers to overlay them on top of the video. If the number of Geodes increase, does it lower the performance? does it make sense to make one Geode per each text for example, or per each LINE_LOOP if I have hundreds of them? What do you think is the optimum number of draables per Geodes? ... Thank you! Cheers, dashesy -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30229#30229 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] event traversal: camera manipulator executed before or after eventCallback?
Hi Torben, the framecylce consists of 4 parts: Code: advance(); eventTraversal(); updateTraversal(); drawTraversal(); What you called drawTraversal is actually called renderingTraversals(), and consists of two phases: the cull phase, where OSG traverses the scene gathering things it needs to draw into a render graph, and the draw phase, where it dispatches the draw commands (OpenGL calls) required to render what is in the render graph. But you got the high-level idea. My question: - The camera manipulators handle(); function is called by the the eventTraversal, right? - is the manipulators handle() function called before or after the execution of the callback function? - I would like to use the callback to catch some external camera data, then calculate the camera position/attitude immediately and send thsi resulting camera modelview to other hosts to apply this camerasetting to their cameras. - is it possible only be the viewmatrix or do I have to transfer other data? From your questions, I think one important fact is missing for you to understand what's going on: the camera manipulator gets events during the update traversal, but the view gets the view matrix from it during the cull traversal. Essentially, all the camera manipulator does during the event phase is get events and figure out what it should do with them. The actual calculation of the view matrix (which is what the camera needs to be able to position itself in the world) is calculated in the cull traversal, where the view will do: if (cameraManipulator.valid()) { osg::Matrix viewMatrix = cameraManipulator-getInverseMatrix(); camera-setViewMatrix(viewMatrix); } // Use the camera's view matrix as the start of the model view matrix. osg::Matrix modelViewMatrix = camera-getViewMatrix(); // Start accumulating transforms down from the camera to form the // model view matrix at each node. // ... (this is from memory, but you could place a breakpoint in TrackballManipulator::getInverseMatrix() and go up in the stack trace when your breakpoint is hit to see the whole code. The point is, if you have a camera manipulator, it will overwrite whatever you set as your camera's view matrix in a callback. If you want to set the camera's view matrix yourself, just don't use a camera manipulator. As you can see from the code I wrote from memory above, if the view's cameraManipulator is NULL nothing will touch the values you set in your camera's view matrix. Just so you know, calling viewer.run() adds a camera manipulator (TrackballManipulator) by default. If you do while (!viewer.done) viewer.frame(); instead, there won't be a camera manipulator added (you can add the one you want, a custom one, or none at all). I tried to get this information directly from the osg sources, but my knowledge is currently insufficient to unterstand the code at this aspect.. (yes, I'm one of these guys commenting code not to loose the overview, so I'm struggling at pure code..) The code is not the only tool you have to try and understand things... As I said above, one good way is to set breakpoints and walk through the code that way. 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