Re: [osg-users] osgText issue
Hi Nick, I have some plans to work on osgWidget in the near future, once the funding gets going :) Excellent, I just wanted to make sure people like you and me who have the need and the will to improve it will continue to do so and not just develop things in isolation. :-) Thanks, 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] [osgPlugins] Can't export OSG to 3DS in 2.9.6 and can't build osgIntrospection Lib
Hi Agos, Ooops.. I didn't know there was the habit of making everybody compiling developer versions... but after all, aren't all of them for developers? Razz Yes but not all developers need to use developer releases... Some use stable releases exclusively. 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] Transparent node cast shadow with ShadowMap?
Hi Paul, Shouldn't it be possible to discard pixels whose alpha falls below an app-specified threshold during creation of the depth map? That's not what Dominic wanted. He wanted the node to shadow other objects but not itself. 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] 360 degree screen captures
Hi Darin, Does there exist the capability utilizing the osg libraries to create the JPG/PNG without running the viewer, i.e. without displaying the viewer window. Is there an alternative to creating an image from the screen (and then writing it to the file), or is running the viewer a necessity to accomplish the rotation and image creation? To render without displaying anything on the screen, you need to create an offscreen (pbuffer) graphics context. Search the examples, you should find a few that do this. 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] Dragger no longer sees click
Hi Neil, Could you try leaving the osgManipulator code alone and toggling the display mode of the polygons using a osg::PolygonMode state attribute attached to a StateSet above the manipulator subgraph. Have a look at the osgscribe example to see osg::PolygonMode in action. Another solution might be to create two sets of geometry. One would be polygons as before, but made invisible using setDrawableToAlwaysCull (or something like that) and that would be what the intersection tests against, and the other would be your lines and would be visible. Look at the source for the existing draggers, there are examples of setting up invisible geometry to get some specific behavior (for example in the TrackballDragger there's an invisible sphere in the center which allows rotation around all axes, in addition to a visible circle for each axis. I've done something similar in the past in order to get a larger click zone for draggers - users found it hard to pick some of the draggers (again the TrackballDragger comes to mind) so I would subclass the dragger creating larger invisible geometry for easier picking. 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] Debug versus release libraries.
Hello Nico, Is this setup possible at all? Is there something special I have to setup? Please read the archives, this has been discussed a lot in the past. On Visual Studio, you cannot mix debug and release (when the C++ runtime is concerned). All C++ libraries and the executable itself need to use the same runtime. This is not true for C libraries, you can link debug or release C libraries into a debug or release C/C++ application without problems. That's what we often do for dependencies, even within OSG itself (the 3rdparty packages include debug and release libs for most, but not all, dependent C libraries, but you could link to the release version for all builds if you wanted). But for C++ libraries they have to match the application. There are a few reasons for this, the most apparent is that iterators have a different size in memory in the debug and release C++ runtimes. So if you don't match debug to debug and release to release, it will be moving pointers by the wrong amount of bytes when incrementing iterators, which will result in crashes (or at the very least garbage). 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] Dummy node Creation
Hi Manish, By dummy node I mean some node which is not visible however its child is visible. Actually I'm facing problem similar to osgmanipulator , in which I don't want to display selection in trackball mode [refer osgmanipulator] ,however i want to display selection in pick mode . This i want this osgManipulator::Selection* selection to visble one mode while invisble in another mode. and I also need to save my scene in both mode. I need some better solution to solve my problem . Just set the node mask to 0 on the Dragger (or its parent subgraph) when you want to hide it, and to 0x when you want to see it. Or use an osg::Switch node above it, or ... There are many ways. 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] Siggraph 2010 OSG BOF best day/time for OSG community
Hi John, Thanks for volunteering to organize the BOF this year. We'll probably be applying for one of the presentation slots as in the previous years, if you decide to follow the same model. Mike Weiblen mentioned that Wednesday morning slots are coveted. I believe that last year the slot registration process began in Jan [early Feb?]. So, this is the time for the community to think about the day/time for the BOF. Chime in. I think the reason why the Wednesday morning slots are coveted (i.e. that's the day the OpenGL BOF and some others are generally held, thus that's when most people potentially interested in OSG are there) is also a reason why we should try our best to get one of those Wednesday morning slots. For my part, I'm generally there most of the week, but I guess if we can't get a Wednesday slot then +/- 1 day would be better than Monday or Friday. I guess what I'm saying is make it easy for as many people as possible to be there. 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] MinGW and OpenSceneGraph
Hi Laurence, I investigated your issues a bit more. Here is what I found: (1) osgPlugin: jpeg Problem: boolean is not defined This comes from the fact that the version of the jpeg headers included in MinGW defines JPEG_boolean (and JPEG_FALSE/JPEG_TRUE) instead of boolean (and FALSE/TRUE). I think this is a good idea as it avoids possible name clashes, but in this case it causes problems. What I find weird is that I looked at both the headers in the Win32 VC8 dependencies package (which is fairly old) and the headers on an up-to-date Ubuntu install, and both define straight boolean (not JPEG_boolean as the MinGW header defines). In both cases, the jmorecfg.h header states: Copyright (C) 1991-1997, Thomas G. Lane. The MinGW header states: Copyright (C) 1991-1997, Thomas G. Lane. Modified 1997-2009 by Guido Vollbeding. So it would seem the MinGW header is more recent, or just that it includes changes that were not integrated into the baseline? That seems a bit weird to me, that the MinGW header would be more recent than what's on an up-to-date Ubuntu install... Anyways, I'll see if I can code up a solution that will allow us to compile in both cases. (2) osgPlugin: freetype Problem: It can't find the freetype header files Actually, you could fix this without any code changes: 1. open an msys prompt 2. cd /mingw/include 3. ln -s freetype2 freetype That way the include files will be found. (3) osgPlugin: curl As I said, the required libraries are added at src/osgPlugins/curl/CMakeLists.txt inside an IF(WIN32) which works for VC++ builds. Seems the Msys build doesn't go into that IF, so I'll look into adding the proper check (probably || MINGW or something like that. That should take care of it. Stay tuned... 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] Conversion from 'GLsizeiptrARB' to 'const GLvoid *' of greater size
Hi Robert, Disabling the warning would not be idea as it could hide some genuine problems. Perhaps just disable it for the files that are causing problems? So would you accept a change that pushes the warning disable state at the start of include/osg/State, disables that warning for the file, and pops the warning disable state at the end of the file? (or perhaps only in those functions would be less prone to hiding other problems) You've refused such changes in the past, but perhaps for this case it's the only way to go... 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] MinGW and OpenSceneGraph
Hi Laurence, Thanks for your tutorial, it's always useful to document things so new users can get up and running as fast as possible. Thanks also for your explanations for changes to make. Perhaps some can be made to the baseline so MinGW users won't have to manually patch things... About this one: (3) osgPlugin: curl Including libcurl (include / lib) doesn't seem to be enough to build this project and will result in linking errors. It probably needs to link against libws2_32.a and libwinmm.a . I know how to link using a Makefile, but I got no clue on how to fix it in the CMake files... libws2_32 was added already for the WIN32 case, if it's not being linked in it's probably because it's not included in the MINGW case... Search for that name in the CMakeLists.txt file in the src/osgPlugins/curl directory, and you should see where it's added. Then search other plugins for a MinGW specific path and that will tell you what to test for to know you're on MinGW, and in that case add the library to be linked against. That should take care of that case. Once you've made the changes please submit the modified file to osg-submissions so others will benefit :-) Thanks, 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] [osgPlugins] Can't export OSG to 3DS in 2.9.6 and can't build osgIntrospection Lib
Hello Agostinho, I don’t know why, but CMake just doesn’t create the project file for the “osgIntrospection” library. So that lib is never created, and my program won’t even compile without it. If you need osgIntrospection, then you need to activate the CMake option called BUILD_OSG_WRAPPERS. Then CMake will generate the appropriate project which will be part of the OpenSceneGraph.sln solution and you'll be able to build it. If you don't activate that option, CMake will not generate the project. This is also the case for examples (BUILD_OSG_EXAMPLES) and so on. This is done because not everyone wants to build all the projects (libraries, applications, examples, introspection support, plugins, packaging, documentation, etc.). 2. Then I used the “OSGCONV” utility, to try to convert my OSG file to 3ds, but it crashes in windows (both XP and 7)! :-( 3DS write support is still fairly recent, but is being actively developed still. Sukender (who wrote it) may be able to help, but your best bet is to run osgconv (built in debug configuration) in Visual Studio with the same command line arguments and get a stack trace for where it crashes. With the call stack you may be able to see why it crashes, and if you post it here it will give us a better idea of what happens. Just saying that it crashes doesn't really help. Also providing an example file that makes it crash can really help Sukender debug it with you. 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] Conversion from 'GLsizeiptrARB' to 'const GLvoid *' of greater size
Hi Robert, I'm surprised that you are seeing this warning as for a 32bit build the void* should be 32bits and GLsizeiptr should be 32bit. When under a 64bit build the GLsizeiptr should be 64bit. Even if GLsizeiptr was 32bit and void* was 64bit one should still be able to cast it safely, the compiler should promote it OK. Only if we were going from 64bit to 32bit would problems likely occur, but even then in this context it's pretty unlikely that you'd be using VBO's bigger than 4GB. Yeah, seems weird to me too. Is anyone else seeing this? As for fixing the warning, your could try static_cast rather than a C cast. Using static_cast gives this: c:\dev\openscenegraph-svn\openscenegraph\include\osg\state(568) : error C2440: 'static_cast' : cannot convert from 'GLsizeiptrARB' to 'const GLvoid *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast Then trying reinterpret_cast (since we know the C-style cast gives the greater size warning already) gives this: c:\dev\openscenegraph-svn\openscenegraph\include\osg\state(568) : warning C4312: 'reinterpret_cast' : conversion from 'GLsizeiptrARB' to 'const GLvoid *' of greater size ARGH! Same result as the original C-style cast. And just to be completely sure the warning is totally bogus, as a little test I tried to print out sizeof(const GLvoid*) and sizeof(GLsizeiptrARB) which gives this: const GLvoid*: 4 GLsizeiptrARB: 4 Double ARGH! I'm totally out of ideas... Unless you want to disable this warning (4312)... 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] cannot load PNG image
Hi Tufan, Yes C:\Users\Tufan\Desktop\New Folder\OpenSceneGraph-2.8.2\bin is in my path. I don't get any error messages I can load bmp image but cannot png. I don't know why. The difference is that the BMP plugin does not need any additional DLLs (other than the plugin itself of course) but the PNG plugin does (something like libpng13.dll). So I suspect you don't have this DLL. This DLL is part of the 3rdParty dependencies, so you either have it already (if you compiled OSG from source) or you need to download the appropriate 3rdParty dependencies for your version of Visual Studio. See this page: http://www.openscenegraph.org/projects/osg/wiki/Downloads/Dependencies You could then copy all the DLLs from your 3rdparty\bin folder to your OpenSceneGraph-2.8.2\bin folder so it will be found when osgDB loads the PNG plugin. 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] cannot load PNG image
Hi Tufan, I have tried all of your comments add the path of plugins bin but not worked also I have previously downloaded 3rdparty dependencies coppied libpng13.dll into my osg bin but still not working. Do you have any more comments I am really stucked Try setting OSG_NOTIFY_LEVEL=DEBUG before running, it will print lots of info to the console and might help pinpoint the problem. Also try DependencyWalker (google it) if that doesn't help. 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] osgDB::XmlParser question
Hi Robert, Your reading of the code is correct... the code will fail every time, something I didn't catch as I haven't directly used this convenience function in the p3d plugin or elsewhere. Re-ordering the code so the input.readAllDataIntoBuffer() is done before the if (!input) looks it would be appropriate. I've made this change and checked it in, could you test it? Seems appropriate yes, as long as readAllDataIntoBuffer() handles the case where the file was not opened correctly (which it does). This seems to work fine. And what about my other question: Once I do this in my code (awaiting a good fix to readXmlFile() ), I get errors end tag is not matched correctly for items like: item someattribute=somevalue / This is valid XML syntax, but is it not supported by the XmlParser? I could add support for it, but it seems weird that it's not supported... I'm looking into this, will probably post a change soon, but it really seems weird to me that this kind of tag is not supported... It's basic XML syntax. 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] osgDB::XmlParser question
Hi Robert, Oo, too much speed reading on my behalf... I missed this part of your email. Hehe, no problem, I had hidden it in plain sight at the end of the message :-) As for the syntax, I hadn't coded for this as I wasn't familiar with it. I guess that what you get when you get a non XML expert implementing a XML parser :-) I'm busy tackling the submissions so if you can tackle this it'd be great. No problem, I didn't mean to assume you would do it :-) Here are the changes. Essentially: 1. When reading, a tag can end with either or /. If it ends with /, then we don't read any children. 2. When writing, if a node has no children then it is written as blah ... /. With these changes, I can read a relatively complex XML file saved from an application (which is what I want to read from the start), then re-write it to another file and the application loads that new file correctly. Note that the read code assumes that / can only occur if it's part of the / (except if it's part of a value in a property). I think that's OK. But it highlights the main problem of writing OSG's own parser... We're not XML experts and the parser is surely not standards-compliant (which was also the cause for this very submission). Using the parser from some 3rd party would have been better in this regard, but I can appreciate the will to keep the number of dependencies down. It's a fine line to walk. I just wanted to highlight the fact that I hope my assumption is OK, but I'm not sure. Last thing, concerning the writing code, before my change the cases for GROUP and NODE were identical. But on read, we set the type to GROUP if the node has any children, so does the NODE case need to write its children at all? If the type is NODE it shouldn't have any children. Or is it written that way in case user code added children to a NODE without changing the type to GROUP? And in that case, do we really need a distinction between NODE and GROUP? Perhaps they should be treated exactly the same with regard to writing the file? Thanks, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ #include osgDB/XmlParser #include osgDB/FileUtils #include osg/Notify using namespace osgDB; XmlNode* osgDB::readXmlFile(const std::string filename,const Options* options) { std::string foundFile = osgDB::findDataFile(filename, options); if (!foundFile.empty()) { XmlNode::Input input; input.open(foundFile); input.readAllDataIntoBuffer(); if (!input) { osg::notify(osg::NOTICE)Could not open XML file: filenamestd::endl; return 0; } osg::ref_ptrXmlNode root = new XmlNode; root-read(input); return root.release(); } else { osg::notify(osg::NOTICE)Could not find XML file: filenamestd::endl; return 0; } } std::string osgDB::trimEnclosingSpaces(const std::string str) { if (str.empty()) return str; std::string::size_type start = str.find_first_not_of(' '); if (start==std::string::npos) return std::string(); std::string::size_type end = str.find_last_not_of(' '); if (end==std::string::npos) return std::string(); return std::string(str, start, (end-start)+1); } XmlNode* osgDB::readXmlStream(std::istream fin) { XmlNode::Input input; input.attach(fin); input.readAllDataIntoBuffer(); if (!input) { osg::notify(osg::NOTICE)Could not attach to XML stream.std::endl; return 0; } osg::ref_ptrXmlNode root = new XmlNode; root-read(input); return root.release(); } XmlNode::Input::Input(): _currentPos(0) { setUpControlMappings(); } XmlNode::Input::Input(const Input): _currentPos(0) { setUpControlMappings(); } XmlNode::Input::~Input() { } void XmlNode::Input::setUpControlMappings() { addControlToCharacter(amp;,''); addControlToCharacter(lt;,''); addControlToCharacter(gt;,''); addControlToCharacter(quot;,''); addControlToCharacter(apos;,'\''); } void XmlNode::Input::addControlToCharacter(const std::string control, int c) { _controlToCharacterMap[control] = c;
[osg-users] Conversion from 'GLsizeiptrARB' to 'const GLvoid *' of greater size
Hi Robert, I've been getting this warning 7 times per compiled file for a little while: warning C4312: 'type cast' : conversion from 'GLsizeiptrARB' to 'const GLvoid *' of greater size It happens on lines like this: setVertexPointer(array-getDataSize(),array-getDataType(),0,(const GLvoid *)(vbo-getOffset(array-getBufferIndex(; The actual lines are in include/osg/state lines 578, 669, 759, 854, 921, 998 and 1163. Now, from what I can see, GLvoid is gotten from gl.h (in the Platform SDK) and evaluates to void. GLsizeiptrARB is gotten from the include/osg/BufferObject header, and evaluates to int. First of all, it's trying to convert int to const void*, am I reading that correctly? vbo-getOffset() returns GLsizeiptrARB and it's trying to cast it to const GLvoid*. Is that OK? Is there a quick way to remove this warning? I imagine in other cases, it could be a sign of 64-bit porting problems, but I'm on a 32 bit platform, so I don't see why the compiler is warning me of this. For that matter, aren't both int and void* 32 bits on 32 bit platforms? (my knowledge in this is limited, and I guess they can't be or this warning wouldn't occur...) It would be nice to be able to remove this warning. Thanks, 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
[osg-users] osgDB::XmlParser question
Hi Robert, I need to read an XML file and thought of using osgDB::XmlParser to do it. Calling this: osgDB::readXmlFile(filename); results in Could not open XML file: somefilename.xml. But the file is there and some simple code using an ifstream to read the file (using the same filename variable) works. So I started looking into the code. One thing strikes me as weird in osgDB::readXmlFile() : // ... XmlNode::Input input; input.open(foundFile); if (!input) { // error Could not open XML file: ... } input.readAllDataIntoBuffer(); // ... XmlNode::Input::Input() initializes _currentPos to 0. Then input.open(foundFile) calls ifstream::open(foundFile.c_str()) so up to there, all's well. But then XmlNode::Input::operator bool() is this: operator bool () const { return _currentPos_buffer.size(); } Now, nothing has touched _buffer yet (readAllDataIntoBuffer() below the error is what fills it) so its size is 0, and _currentPos was set to 0 in the ctor, so this check ( _currentPos_buffer.size(); ) will obviously return false. I don't think that's what is intended... is it? I don't see how this code could work at all, won't it error out every time? I searched for readXmlFile in the OSG sources and didn't get any results, is this used at all? A change that makes it work would be, for example: operator bool () const { return (_fin.good() _currentPos == 0) || _currentPos_buffer.size(); } What's funny is that the XmlParser code is used in the present3D application (and I assume the p3d plugin too) but it doesn't use readXmlFile at all and just bypasses the check: osgDB::XmlNode::Input input; input.open(fileName); input.readAllDataIntoBuffer(); Is this intended? Why would OSG not use its own helper function? -- Once I do this in my code (awaiting a good fix to readXmlFile() ), I get errors end tag is not matched correctly for items like: item someattribute=somevalue / This is valid XML syntax, but is it not supported by the XmlParser? I could add support for it, but it seems weird that it's not supported... Thanks, 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] Simple water effects
Hi Dominic, I can't find the real worldz examples on the net, do you have the source? If that was part of the GLSL (orange) book, then check here: http://mew.cx/glsl/ Mike Weiblen (which is a member of this list) archived the 3DLabs GLSL stuff when it wasn't available from the 3DLabs site anymore... In particular I think you want this file: http://mew.cx/glsl/GLSL_Book_2nd_Ed_Examples.zip The source you're looking for will probably be in there somewhere. 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] Simple water effects
Hi Kim, I have the code for all of this as a prototype, but I don't have the time to tidy it up and update library at the moment. If you are interested in making these modifications I would be more than happy to give you the code and walk you through it, otherwise it'll have to wait until I get some time to do it myself. If no one gets to it anytime soon, I would be glad to do this work for you. Another option might be to create a branch in osgOcean's SVN (clearly marked as work in progress) and commit the code you have there, and from there I can checkout that branch and work on it to improve it. We can then merge that branch back into the trunk once we're happy with it. A few options for you. Honestly I prefer the branch as it gives us lots of freedom, but it's up to you. 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] curl Plugun + OSG
Hi Danny, src lib include directory. As far as I understand, I need to add CURL_INCLUDE_DIR refers to libcurl\lib directory and CURL_LIBRAY refers to root of libcurl source directory? Seems to me CURL_INCLUDE_DIR should point to libcurl\include, and CURL_LIBRAY should be the filename of the curl library, something like libcurl\lib\curllib.lib (CURL_INCLUDE_DIR needs a directory, but CURL_LIBRAY needs a file). 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] Transforming nodes
Hi Gordon, To me that seems a rather bad default to have for scaling on a DOF, I would have assumed the default would be 1,1,1 not 0,0,0 That's bitten me a few times too. Specifically when I create DOFs programmatically instead of reading an FLT file. Is there a reason why its 0,0,0, and not 1,1,1 and should we change it I think we could change it. Just need to beat the inertia of making such a simple change and sending the whole modified file... U... Ok! Did it! Uh, there are lots more uninitialized variables there... What should _minScale, _maxScale, _minHPR, _maxHPR, _minTranslate, _maxTranslate be set to? Fine, _currentTranslate and _currentHPR can be left at (0,0,0), but are there better defaults for the min and max? Does the OpenFlight spec give some appropriate defaults? And now that _currentScale is set to (1,1,1), does it bother that it's not between _minScale and _maxScale - which are both still at the default-constructed value of (0,0,0)? I knew I shouldn't have opened the file to do the modification... :-) J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ #include osgSim/DOFTransform using namespace osgSim; using namespace osg; static const unsigned int TRANSLATION_X_LIMIT_BIT = 0x8000u 0; static const unsigned int TRANSLATION_Y_LIMIT_BIT = 0x8000u 1; static const unsigned int TRANSLATION_Z_LIMIT_BIT = 0x8000u 2; static const unsigned int ROTATION_PITCH_LIMIT_BIT = 0x8000u 3; static const unsigned int ROTATION_ROLL_LIMIT_BIT = 0x8000u 4; static const unsigned int ROTATION_YAW_LIMIT_BIT = 0x8000u 5; static const unsigned int SCALE_X_LIMIT_BIT= 0x8000u 6; static const unsigned int SCALE_Y_LIMIT_BIT= 0x8000u 7; static const unsigned int SCALE_Z_LIMIT_BIT= 0x8000u 8; DOFTransform::DOFTransform(): _previousTraversalNumber(-1), _previousTime(0.0), _limitationFlags(0), _animationOn(false), _increasingFlags(0x), _multOrder(PRH), _currentScale(1.0f,1.0f,1.0f) { } DOFTransform::DOFTransform(const DOFTransform dof, const osg::CopyOp copyop): osg::Transform(dof, copyop), _previousTraversalNumber(dof._previousTraversalNumber), _previousTime(dof._previousTime), _minHPR(dof._minHPR), _maxHPR(dof._maxHPR), _currentHPR(dof._currentHPR), _incrementHPR(dof._incrementHPR), _minTranslate(dof._minTranslate), _maxTranslate(dof._maxTranslate), _currentTranslate(dof._currentTranslate), _incrementTranslate(dof._incrementTranslate), _minScale(dof._minScale), _maxScale(dof._maxScale), _currentScale(dof._currentScale), _incrementScale(dof._incrementScale), _Put(dof._Put), _inversePut(dof._inversePut), _limitationFlags(dof._limitationFlags), _animationOn(dof._animationOn), _increasingFlags(dof._increasingFlags), _multOrder(dof._multOrder) { if (_animationOn) setNumChildrenRequiringUpdateTraversal(getNumChildrenRequiringUpdateTraversal()+1); } void DOFTransform::traverse(osg::NodeVisitor nv) { if (nv.getVisitorType()==osg::NodeVisitor::UPDATE_VISITOR) { // ensure that we do not operate on this node more than // once during this traversal. This is an issue since node // can be shared between multiple parents. if ((nv.getTraversalNumber()!=_previousTraversalNumber) nv.getFrameStamp()) { double newTime = nv.getFrameStamp()-getSimulationTime(); animate((float)(newTime-_previousTime)); _previousTraversalNumber = nv.getTraversalNumber(); _previousTime = newTime; } } Transform::traverse(nv); } bool DOFTransform::computeLocalToWorldMatrix(osg::Matrix matrix,osg::NodeVisitor*) const { //put the PUT matrix first: osg::Matrix l2w(getPutMatrix()); //now the current matrix: osg::Matrix current; current.makeTranslate(getCurrentTranslate()); //now create the local rotation: if(_multOrder == PRH) { current.preMult(osg::Matrix::rotate(getCurrentHPR()[1], 1.0, 0.0, 0.0));//pitch current.preMult(osg::Matrix::rotate(getCurrentHPR()[2], 0.0, 1.0,
Re: [osg-users] Transforming nodes
Hi Gordon, In Creator/OpenFlight, the defaults for all the DOF min's and max's are all 0's and the step values are all 0's and of course the scale current is set to 1,1,1 OK then the values that are now set should be correct (since the default ctor for Vec3 sets it to (0,0,0) ). 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] Question regarding Culling issue in the SceneView
Hi Colin, I tried adding an update callback to the top level camera and that did work. I checked the code and it does call accept: 346: _camera-accept(*_updateVisitor.get()); So it should work correctly (as of 2.8.2) Sorry, I was mistaken in saying that the cameras did not get the update visitor. They do as you point out. I did some checking, and what I was talking about is in src/osgviewer/Viewer.cpp void Viewer::updateTraversal() { // ... _scene-updateSceneGraph(*_updateVisitor); //... _scene is the scene graph that's passed to the view when you call setSceneData(). A bit lower, you can see where the update visitor is passed to the cameras too, but it does not traverse to its children. That means that anything that's a child of the cameras but not in the scene data will not be traversed in the update traversal. That's what I was talking about. I really wonder why the camera can't just let the update visitor traverse its children, instead of traversing the _scene separately as above. The _scene's nodes are under the camera anyways, or else they would not be visible... 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] Question regarding Culling issue in the SceneView
Hi Robert, What these updateTraversal() methods do is switch of the traversal of the camera's subgraph when the camera subgraphs are traversed, so the children won't be traversed. This is done so that the scene graphs aren't traversed multiple times per frame, but... I believe in your case were the Camera has the subgraph attached that isn't attached as a View's scene, won't get called. Yes, that's exactly what I'm saying. So you're saying that as opposed to the cull traversal, which will of course traverse the camera's subgraph once per view each frame, the update traversal needs to traverse all nodes only once. If I have the same scene graph attached to multiple cameras, just traversing the cameras' subgraphs would result in the scene being traversed multiple times. Makes sense. To make sure subgraphs of Camera's that aren't part of the any View's scene graph get traversed we'll need to make the camera update callback calling code in *::updateTraversal() a little more intelligent. Perhaps a set of scene graphs that have been traversed on each frame, or perhaps even just checking to see if a Camera has a View associated with it would be enough to determine if the subgraph should be traversed or not. Well in my case, the camera can have a view. It can be the view's main camera. i.e. a node can be added as a direct child of the view's main camera and its update callback will not be called. I'd have to look into the code in Viewer/CompositeViewer::updateTraversal() to see if I can spot a solution. The set of subgraphs that have been traversed seems like it would work, but it's perhaps too time-consuming to check? 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] Python users
Hello Massimo, running the latest notes from the wiki main page all works fine. now i'm exploring the example code. Good to know you're getting better success now. have you never tried to add a python osgviewer inside a PyQt4 (or wx-python) gui ? No, sorry. If you try it let me know, I would be very interested to know if it works well. Also if you could contribute a small example of that in action I would gladly add it to the osgBoostPython examples. 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] osgOcean synced thru multiple machines
Hi Nick, I just got osgOcean compiled and running and it looks great !!! It does, doesn't it! Thanks to Kim Bale for all his hard work! One question. Is there a way to sync the waves on multiple machines ? Not in osgOcean itself, no. You'd have to come up with your own way. I guess you could add a setFrameNumber() method to FFTOceanSurface that would tell the object to set itself to a given frame number in its animation, and then add a boolean flag that would allow you to control the animation through setFrameNumber() instead of FFTOceanSurface controlling it itself in its traverse() method. If you do code up something please post it, we can integrate it into the mainline code. 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] Python users
Hi Massimo, Sorry, my first reply went to you directly... I don't know why, sometimes reply replies straight to the sender, even though the mailing list should be changing the headers so that replies go back to the mailing list... i'm running osgboostpython http://code.google.com/p/osgboostpython/ on mac osx 10.6 (osg svn, 64-bit) boost+python support from source (1.41) Please note that I've never tried to build it on Mac OS X, so your input will be valuable (as below). now i'm tring to runs some examles, but i have problems using the code from the main page : In [12]: s.setTextureAttributeAndModes(0, t, osg.StateAttribute.Values.ON) Traceback (most recent call last): File ipython console, line 1, in module AttributeError: type object 'Values' has no attribute 'ON' any clue on what's wrong? Yes, the enums were changed to const members to fit better with the C++ style but I didn't change the code on the front page :-( Try to use osg.StateAttribute.ON instead (without the .Values)... See http://code.google.com/p/osgboostpython/source/browse/trunk/osgBoostPython/lib/osg/__init__.py I've updated the front page now. Sorry about that. ... tring to build osgboostpython http://code.google.com/p/osgboostpython/ , seems that it don't recognize the .dylb files so i had to simlink *.dylb to *.so. You could possibly change the jam files so that it uses .dylib files instead, but I have no clue how to do that. Perhaps the bjam / jam / boost.build documentation can help you. Thanks, 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] Question regarding Culling issue in the SceneView
Hi Robert, As Paul suggests CullVisitor::apply(osg::Camera) handles in scene graph camera's, so will not handle the viewer level scene graph correctly so _camera-accept(*cullVisitor) won't behave correctly. Perhaps you could try replacing the for loop with _camera-traverse(*cullVisitor) as this will call the cull callback and avoid the CullVisitor::applyOsg::Camera) method. If this works fine let me know as I can make this change to SceneView.cpp. I had a similar question about update callbacks. Reading the code (can't recall where, but I suspect it's in SceneView.cpp as well) the update visitor is being passed to the Scene objects, and not to the cameras. The effect of this is that update callbacks on cameras are not called, and more importantly, update callbacks on nodes that are children of the camera but not part of the view's SceneData will not be called either. We frequently add nodes directly under a camera (instead of under a scene root that's the scene data of a given view) so that the nodes are only visible to that camera. But with the present behavior, update callbacks on those nodes are never called. If, instead of passing the update visitor to the scene data's root, we passed it to the camera's children, then we're sure all visible nodes would be visited, even those in the scene data... Thanks, 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] Python users
Hi Rizzen, What is the best OSG python library/wrapper to use? I see there are various versions: pyOSG, PyOSG and osgPython. Some project showed no activity since 2003. Some projects showed activity in the news yet files are a lot older. PyOSG does not seem to have a SVN on SourceForge, just old tarballs. I am planning to use Boost:python in my project too. If you're planning on using boost.python you might be interested in trying the wrapper project I've started, which wraps some of OSG but not all using boost.python. It's located here: http://code.google.com/p/osgboostpython/ I started it just for fun, and wrapped most of the basics to make a working OSG application (matrices, vectors, geometry, textures, some event handlers and callbacks, viewer, etc.). Martin Mueller also contributed some wrappers at one point. It's still not close to being complete, but might be sufficient for your needs, and you could help improve it too. Let me know if you want more info or if you decide to use it and you need help getting started. 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] Clarification with regard to Dragger
Hello Neil, When I click, sometimes the dragger is selected, sometimes not. If you want clicks to always select the dragger, then you can just use node masks. Use a given bit to indicate the dragger, then set the dragger to this node mask, and remove that bit from your other objects' node masks. Then when picking, use that bit as your intersection visitor's traversal mask. 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] Trouble porting to vs2008, heap corruption
Hi Chris, Usually the linker will yell and scream at you if you try to do this, so it usually doesn't happen accidentally and without the programmer knowing. I'm curious when you've seen the linker scream about mixing debug and release DLLs... I've seen plenty of users do it by mistake and the linker never said a thing, except when mixing the dynamic and static C runtimes. When mixing debug and release (both using the dynamic runtime, for example) the linker says nothing. That's why it's so easy to do, but nevertheless it will lead to bad behavior, crashes, etc. 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] Please test svn/trunk in prep for 2.9.6 dev release
Hi Nick, - osgstereoimage (the image showed on the first frame and dissapeared) I assume you have two or more monitors? This is the multi-screen fullscreen bug that others have reported lately on the list when running on Windows. For some reason, recent versions of OSG when running fullscreen on multiple screens will display one or two frames, then everything goes black. Try this: set OSG_SCREEN=0 osgstereoimage or this: set OSG_WINDOW=50 50 1024 768 osgstereoimage You'll see it then works fine. Running osgviewer cow.osg on both screens doesn't reproduce the issue, so that should at least point to something in the osgstereoimage example (or something used in that example and perhaps others). We should really investigate this issue. See http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/52706 And also related: http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/52386 I see these same issues on Windows Vista 32 bit at work, and on Windows 7 64 bit at home, both with nVidia cards. I'll see if I can put aside some time to check this out. Others are welcome to do the same of course. 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] Please test svn/trunk in prep for 2.9.6 dev release
Hi Nick, set OSG_SCREEN=0 osgstereoimage This actually helped. Works now. And yes, I am on dual screen machine So that confirms that it's probably a widespread issue. As I said, I'll try to make some time to get to the bottom of it. Thanks for testing, 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] OpenSceneGraph-2.9.6 developer release tagged
Hi Robert, Excellent work to all who contributed, but especially to you since most of the grunt work on the big features (ports, texture pools) was done by you. I hope you're taking a bit of time to relax now before diving into something else... One quick question, given the amount of new features and the major step ahead that the ports to GLES and GL3 represent, will the next stable version be 3.0 or are you still aiming to make it 2.10? Personally I'd say these developments are at least as important as the osgViewer stuff that were in OSG 2.0 (as opposed to 1.4)... 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] Trouble porting to vs2008, heap corruption
Hi Chris, I'll try to check, but since it's something I carefully avoid now, it may be a while. Well as Roger said, it's generally something like conflicting default libraries. But when someone who doesn't really know they shouldn't do that runs their project and it seems to work until it crashes while incrementing an iterator or something like that, they generally don't suspect that warning to be related to the problem. Plus some just ignore warnings altogether... As if the compiler was just being too fussy in telling you these things... :-) To be clear, I agree the linker says something, but I don't think it's near vocal enough to be useful to newbies / newcomers to Windows (on Linux you can mix debug and release however you want, no problem). I liked the idea about intentionally messing with the code so that it wouldn't link if you messed it up, but it seems infeasible that you could prevent every combination of mismatch. I agree, it would be nice. I don't see it as a problem that we can't catch every single type of mismatch... If we can at least catch some it's better than it is now. Just like the osgPlugins-version scheme was added to make it harder to mix plugins from different versions of OSG, but you can always put all the plugins in the same directory as the executable and then you're essentially defeating the scheme that's trying to protect you. 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] Develop a scalable binary file format for native OSG scenes?
Hi Robert, I believe .osg would be the most appropriate extension, the header could declare which version of the format it is - whether it's binary, new ascii or old ascii. We could possible have a .osgb for binary. Stupid question, but if .osg is used for both binary and ascii how would we specify which one we want in this line of code: osgDB::writeNodeFile(*scene, saved_scene.osg); ? Would we need to add an option? I don't see how this line of code in user apps could work with this new plugin that would use the same extension for both binary and ascii, unless ascii is the default or something... 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] Keep track of screen coordinates of an object
Hello Martin, I tried what you explained and got it to work. Excellent, good to know I was of some help. 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] basic traversal problem
Hi Nick, Thanks again for the support My pleasure. 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] Keep track of screen coordinates of an object
Hello Martin, However, I still would like to be able to take a screen shot in the way I explained. I have recently implemented something similar, where if the screen-space bounding box of an object was smaller than 5 pixels in X or Y, an icon was displayed at the position of the object instead of the object (for a kind of map view). It's pretty easy - you take the world-space bounding box of the object, project all 8 corners of it to screen space (multiply with the view-projection-window matrix, search for that in the archives and you should get some code to calculate it), add those 8 projected points to another bounding box (which will be axis-aligned in screen space) and in my case, I could then just calculate if max.x() - min.x() 5 or max.y() - min.y() 5. In your case, that bounding box will give you the X and Y bounds of your screen shot. That's a high-level description, if you really need code I can give you some but I think it would be a good exercise for you to work it out. 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] Shadows on Windows XP
Hi Mauricio, I resolved my problem, i compiled OSG from SVN, and now on windows works very well :D Great, some weird problem with the binaries then? In another topic, i was watching your page and your professional life and saw that you studied Computer Graphics, and i want to ask you ,what school abroad do you recomend me? because also , i want to do a masters in Computer Graphics, i studied my Bachelor in computer science in Mexico Well, here in Montreal we have a few good universities with some researchers who are quite well-known in the Computer Graphics community, like Pierre Poulin at Université de Montréal for example (if you know French :-) ). Otherwise, UBC (University of British Columbia) at the other end of Canada is well-known too, as is the University of Waterloo in Ontario. In the US there are many well-known universities in Computer Graphics, but I don't know the list off the top of my head. Look into the literature (Siggraph papers, IEEE Computer Graphics and Visualization, EuroGraphics proceedings) and you should get a good idea what the well-known universities are. But I would say it doesn't depend that much on the university rather than on your interest in the subject and the amount of guidance you can get from your teachers. Going to talk to some teachers (for example when the university hosts and open house day, or by e-mail) is always a good idea. 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] How does a osg::Drawable::UpdateCallback Work ?
Hi Peter, I'm trying to set up an Update Callback in osg::Geometry to dynamically change the color of a vertex. I get no error, but my code is not evaluated ( cout in Callback is not printing ). I attached my Callback to osg::Geometry ( a simple Quad ) and setDataVariance( osg::Object::DYNAMIC ) ; If you look at the docs for osg::Drawable::UpdateCallback, its callable method doesn't have the same signature as an osg::NodeCallback (which is what you seem to have used) http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00193.html virtual void update (osg::NodeVisitor *, osg::Drawable *) So it's normal that your operator()(...) isn't being called. :-) 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] How does a osg::Drawable::UpdateCallback Work ?
Hello Peter, Yes that was one problem, thx, but the expected is still not happening. At least the cout is printing now after I changed the method to update(). Any Ideas why its still not working ? Well, if the code is now being executed, you should be able to debug it by running it in a debugger... A guess would be to disable display lists, or call dirtyDisplayList() if you're updating the geometry only seldom. If you're using VBOs, maybe you need to dirty the VBOs somehow. 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] osgShadow - Application crash
Hi Manish, I have integrated Chipset and no additional 3d graphics card installed . Yes, I gathered as much from the error messages that you posted. Is Software rendering is possible ? For shadows, you really need Framebuffer Objects to get any acceptable performance. I have seen some integrated chipsets that will make OSG fall back from Framebuffer Objects to pbuffers (as yours does) and then work with pbuffer but more slowly. In your case, it seems that your driver doesn't even support pbuffers. You might try upgrading your integrated chipset's driver, perhaps that will make it support pbuffers, but I doubt the performance will be acceptable. So you'll probably have to disable shadows when running on that chipset. Note that it's the application's responsibility to detect the hardware or use config files or some other mechanism to disable features that aren't supported / are too slow on the current hardware. 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] Setting fading property to node
Hi Akilan, statSet-setMode(GL_LIGHTING, osg::stateAttribute::OFF); [...] osg::ref_ptrosg::Material material=new osg::Material; material-setAlpha(osg::Material::face::FRONT_AND_BACK,0.5); statSet-setAttribute(material.get()); As Paul mentioned in a previous message in this thread, you need lighting ENABLED to be able to use materials. Otherwise the material has no effect. Note that setAlpha might not do what you want - it sets the alpha of ambient, diffuse, specular and emission colors. I think you'd probably just want to set the alpha of the diffuse color, something like osg::Vec4 diffuse = material-getDiffuse(osg::Material::FRONT_AND_BACK); diffuse.a() = 0.5; material-setDiffuse(osg::Material::FRONT_AND_BACK, diffuse); 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] ScreenCaptureHandler and HUD cameras
Hi Robert, The ScreenCaptureHandler should just attach callbaks to the salves+master cameras that rendering to a graphics context, and aren't a RTT Camera. Camera's in the scene graph are nested within viewer cameras so won't need callbacks as well. I thought as much. OK, so I'll submit a fix to that. Thanks, 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] Picking bug?
Hi Fred, Simon, I turned all floats into doubles, 0.0f's into 0.0's, all osg::Vec3's into osg::Vec3d's... I still get the same behavior. Simon, why don't you submit your code changes (perhaps with a CMake switch to change the internal data type used between float and double at compile time, kind of like OSG_USE_FLOAT_BOUNDINGBOX / OSG_USE_FLOAT_BOUNDINGSPHERE... I'm sure if this is a common problem people will be glad to have it in the main OSG code base, only a CMake switch away... And then it will be easy to compare performance between the two and perhaps make the double version default if there is little/no performance difference... 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] Picking bug?
Hi Robert, This topic has arisen previously on osg-submissions, and my recommendation then was that support for double maths through the intersection code shouldn't be a compile option, but an runtime option, this way the ABI wouldn't change and you could enable it when you needed it. I still believe this is the correct route. Hm, so are you suggesting osgUtil::LineSegmentIntersectord and associated *d classes, like we have osg::Vec3f and osg::Vec3d? Or add double versions of the methods in these classes? Basically, use the same classes but duplicate some methods in them or duplicate the classes altogether? 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] osgShadow - Application crash
Hello Manish, After termination of the program , I got following message in the command window :- PixelBufferWin32::closeImplementation, wglReleasePbufferDCARB error: Invalid dev ice context (DC) handle. PixelBufferWin32::closeImplementation, wglDestroyPbufferARB error: Error code 32 21684230 How can I solve this problem ? Seems to me that your video card / drivers don't support Framebuffer Objects, and when osgShadow requests an FBO render-to-texture camera, OSG falls back to using pbuffers, and the messages above would suggest that your card doesn't support those either. What hardware are you running this on? We're using osgShadow on a wide range of video cards, from nVidia 7xxx line to the most recent GTX 2xx line. However we know that on most laptop integrated chipsets, we disable shadows (by trying to detect if the OpenGL driver supports Framebuffer Objects, as well as Fragment and Vertex shaders) because they will either run too slow or crash as they do for you. There is currently no such detection in osgShadow itself, it's up to the application developer to implement it. So the osgShadow example will try to run the same on any system, even if the system doesn't support the basic things it needs to do its work. This seems to be the case for you, but I'd need more information to know for sure. 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] osg::StateAttribute::PROTECTED usage for not effected from it's parental shaders.
Hi Ümit, I have a shader and try implement to the ParentNode but I don't want to effect ChildNode with this shader. I want render ParentNode with Shader and render ChildNode with FixedFunction without any effect from it's parent's shader. I have tried to use osg::StateAttribute::PROTECTED but which osg::Attribute should I set to PROTECTED? I mean ChildNode-getOrCreateStateSet()-setAttributeAndModes( , osg::StateAttribute::PROTECTED | osg::StateAttribute::OFF); What should I assign to Or Does this way wrong or not? This is an FAQ... ChildNode-getOrCreateStateSet()-setAttributeAndModes( new osg::Program, osg::StateAttribute::ON); Empty osg::Program without any shaders attached means fixed pipeline. You don't even need Protected, unless you're using Override on the parent node. 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] Shadows on Windows XP
Hello Mauricio, please help me!!, i need that it works on windows i hope someone tests my code on windows and tell me if works or tell me if i have to change my code Here are screenshots on my machine (Windows Vista 32bit) running OSG SVN trunk (updated last night) compiled with VC++ 2005 (8.0). Everything seems fine to me. Perhaps it's a bug that was fixed between 2.8.2 and the trunk. Try to compile OSG from SVN yourself and see if that fixes it. If it does, then the next test would be to try to compile 2.8.2 yourself, see if the problem comes back. If not, then there might be some problem with the binaries you downloaded... Though I can't imagine what. Hope this helps. -- __ 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] Shadows on Windows XP
Hi Mauricio, Thank Jean No problem, be sure to come back and tell us if you find a fix to your problem... 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
[osg-users] ScreenCaptureHandler and HUD cameras
Hi Robert, I was using osgViewer::ScreenCaptureHandler today and noticed that it will add the capture callback to scenegraph cameras too (i.e. HUD cameras that are in the scene graph). I think this is a mistake. I think it should only add the callback to viewer cameras (either main or slave), i.e. cameras that have a non-null view pointer. What do you think? If you think there might be a valid use case for adding the callback to in-scenegraph cameras, perhaps we can add a parameter to the addCallbackToViewer so the app can decide whether it wants this or not. I can make the change (whatever you decide) but I just wanted to know your opinion. Thanks in advance, 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] Shadows on Windows XP
Hi Mauricio, On linux everything works very well, but on Windows XP the shadows move with mr.makeRotate(latitud, osg::Y_AXIS); but don't move with mt.makeTranslate(x, 0.0, 0.0); Are you sure your light source is not just a directional light? Directional lights change lighting (and shadows) when their direction changes (i.e. rotation) but not when their position changes. It's probably not even related to platform. We've been using shadows in OSG for a while now, on Windows XP, Windows Vista, Windows 7 and Linux, and have not had this kind of problems. 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] How to compile osgOcean
Hello Dominic, How do I have to use CMake for that, I'm sorry for this stupid question. It's not stupid. What platform are you using? On Windows, you run the CMake GUI. At the top you will have a field Where is the source code ?, point that to the base osgOcean directory (the one that contains src/, include/, resources/, etc.). Then in Where to build the binaries?, I suggest you point it to a build/ subdirectory under that same osgOcean directory (which you will create). Then click Configure, fill in any paths that are missing (FFTSS and OSG include and library paths probably), set CMAKE_INSTALL_PREFIX to for example your osgOcean base directory, click Configure again and then (if there is no error) Generate. Then you can open the generated osgOcean.sln file (which will be in build/) in Visual Studio and build it, and then run the oceanExample. On Linux, do this: cd the osgOcean base directory mkdir build cd build ccmake .. Then press C for configure, fill in any paths that are missing (FFTSS and OSG include and library paths probably), set CMAKE_INSTALL_PREFIX to for example your osgOcean base directory, press C again and then (if there is no error) G for generate. Then you can run make from the build directory and it will compile osgOcean. You can run make install, that will copy the binaries into osgOcean/bin and osgOcean/lib. Then to run the oceanExample you'd have to add osgOcean/lib to your LD_LIBRARY_PATH (as well as your osg lib directory). (I've also put this info on the osgOcean wiki on the Usage Instructions page: http://code.google.com/p/osgocean/wiki/Usage_Instructions ) 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] Crash in nVidia driver : particles + dynamically adding/removing views
Hi J.P., After press 3 I get the attached pic. Looks like the cow is being sucked into the matrix. I can still manipulate this view though, the particles seem stationary. I get the same thing as your screenshot here. On both Windows (Vista 32 bit) and Linux (Ubuntu 64 bit), OSG SVN trunk. I also get Warning: detected OpenGL error 'invalid value' at after RenderBin::draw(..) which is not quite the same as you. But I think it should be related to the same thing... I think I just turned up OSG's OpenGL error checking frequency. Thanks for testing, I think there's still something lurking (some per-context resource that isn't cleared up correctly). 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] video in osg
Hi Nick, what kind of video is supported in osg? I am seeing directshow plugin, quicktime . What works on Linux? p.s. I am windows guy, but want to move to Linux shortly The ffmpeg plugin works on both Windows and Linux, and should support whatever your build of ffmpeg supports. Even streaming video (live from webcam for example). Other options: The xine plugin (Linux only) is deprecated, and the quicktime plugin works for Windows and OSX. 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] Windows 7 Aero Color Scheme issue
Hi Mark, 1. When starting from the debugger, the image will appear for a moment, then vanish with --screen 0 but not with --screen 1. With --screen 1 the image shows up and stays up, with --screen 0 I have to use Alt tab to find the window to get it to redisplay. 2. When starting from the debugger, with --screen 0, Win7 will pop up a message that says the color scheme has been changed because this application is NOT compatible with Aero. When running with --screen 1, this doesn't happen, no error message appears. 3. When I don't use the --screen option, it uses both screens just fine, and there is no warning message. I reported this behavior a while ago (probably about 2 years ago - check the archives) on Windows Vista. No one (including me) ever had the inclination to try and find the source of the problem... I've always assumed it was some weird Vista quirk. Now we can call it a weird Vista/7 quirk :-) It's not really that problematic, just a little irritating. I always start up fullscreen OSG applications on screen 1 anyways. But if it irritates you enough, you could want to scratch the itch and investigate further... Sorry I can't be more helpful, 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] Simple Loading Tutorial
Hello Sam, When I run the code to load a simple object (that you supplied above) with a direct path, I get no errors but osgviewer seems to load nothing, just the default blue background with no model. Ive tried different .osg and .obj files but no luck. If you're on Windows, make sure you specify the full path with slashes (/) instead of backslashes, or escape the backslashes by doubling them (\\). In a string, a backslash starts an escape sequence (like \n for newline, etc.) so if you specify a path like C:\models\bob.obj the compiler will not be able to find it because it will interpret \m and \b as escape sequences. But using C:/models/bob.obj or C:\\models\\bob.obj will work. Also, make sure you have the plugin to read your model's file format. Set the notify level higher (set OSG_NOTIFY_LEVEL=DEBUG) to see what's going on - OSG will print out whether it can find and open the plugin to read your model, and then whether it can read the model itself, in the console (stdout and stderr). 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] Crash in nVidia driver : particles + dynamically adding/removing views
Hi Robert, You latest fixes to texture and buffer objects fixed the crash I was experiencing in this code. Thanks! However, starting at the second time the child window is opened (third time you press 'a'), I get these messages every frame, and the particle systems do not render correctly anymore: Warning: detected OpenGL error 'invalid value' at after RenderBin::draw(..) This happens on both Windows and Linux (Ubuntu Jaunty x64) So I think there's still something lurking. Could you check it out please? See the code posted in my previous message. It seems that this issue is close to being put to rest... Thanks in advance, J-S Jean-Sébastien Guay wrote: Hi all, So I just wanted to post my latest code that can reproduce this issue, and see if I can get Robert's attention so he can check it out. It may be related to the crashes others are seeing with texture pools and/or VBOs lately, but it might not. It's also triggered by starting/stopping viewers, but it's reproducible in OSG 2.6 so it's probably not related to the latest texture pool code (unless a bug has carried over from before). The code attached can be changed using #defines at the top of the osgviewer.cpp file to demonstrate the problem and two possible workarounds. First, you can make the program use either osgParticle::PrecipitationEffect or the SiltEffect that's present it osgOcean. Both will reproduce the problem and will react the same to the workarounds (which makes sense since the SiltEffect is a modified PrecepitationEffect to begin with). Change between the two by changing the #define USE_EFFECT to either SILT or PRECIPITATION. Then, if you comment both the defines that follow (that start with WORKAROUND_) you should be able to reproduce the bug. Run the program with those two defines commented, and when the window comes up, press 'a'. You'll get a new window. Press 'a' again and the window will close. Repeat this. On both Linux and Windows, after 2-3 times, the window becomes gray (partially or completely) and I get Warning: detected OpenGL error 'invalid value' at After Renderer::compile Additionally, under Windows, after a few more opens/closes, the app crashes. On Linux it seems to crash much less often, sometimes it does, but most of the time I just get the gray window. Now, you can test out the two workarounds by uncommenting one of the two WORKAROUND_* defines. The first one is to share contexts, and the second is to not reuse context IDs (by incrementing the context ID usage count so that a new one is used each time). We're currently using the latter workaround in our app, and it works well, but of course it would be better if OSG could clean up after itself correctly when a context is destroyed and then the context ID reuse would work as intended. So, I hope this example code helps reproduce and squash another bug... Let me know if there's more I can do to help. Thanks, 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] Organising Geodes and Drawables
Hi Martin, If I store them as drawables in the same Geode, I can create a surface mesh of just the top and bottom by having the same vertex array and different Geometry drawables. Actually, you can give any drawables the same vertex array if you want, even if the drawables are not part of the same Geode. Does this resolve your problems? osg::Geometry doesn't have a nodemask - how can I control which drawables are drawn? All drawables of a geode are drawn. You can work around that somewhat by attaching an empty osg::Drawable::DrawCallback to a drawable (i.e. one that doesn't call drawable-drawImplementation(renderInfo); in its drawImplementation() method). This will cause the drawable not to be drawn. When you want it to be drawn again you just remove the callback. But it's easier to use separate Geodes and use the nodemasks on Geodes. Or is there any easy way to say, draw points 0-n, or n-m osg::DrawArrays does this... 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] The book OpenSceneGraph Design and Implementation is published
Hello Wang Rui, After 3 months of long waiting (from the SIGGRAPH to present), I am very pleased to announce that, the book /OpenSceneGraph Design and Implementation/, which is written by Wang Rui and Qian Xuelei and predicted on the OSG BOF, finally COMES OUT! Great work on getting your book out! I was glad to hear about so much involvement in the OSG community in China at the BOF this year, and it's great to see that this knowledge is being shared to a wide audience. I also hope you can get it translated to English, but I will probably order a Chinese copy anyways as enocuragement! But why didn't Paul write his preface in Mandarin? :-) http://osgenginebook.googlecode.com/svn/tags/images/preface.jpg It was nice to meet you at the BOF as well, hope to see you again next year to announce the English translation (I can hope :-) ) Again, great work, keep it up. 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] The book OpenSceneGraph Design and Implementation is published
Hi again Wang Rui, I just went to the product page on dangdang.com, and it seems it's out of stock? http://product.dangdang.com/product.aspx?product_id=20732977 http://translate.google.com/translate?js=yprev=_thl=enie=UTF-8u=http%3A%2F%2Fproduct.dangdang.com%2Fproduct.aspx%3Fproduct_id%3D20732977sl=zh-CNtl=en I hope you can help me order a copy of your book :-) 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] Custom code in OSG core
Hi Robert, Sukender, The issue of proxy image is something that the osg::Texture's UnrefImageAfterApply could do with as it currently discards the whole osg::Image, so later on when you try to save the model there is no Image to provide the FileName to use to write to file you want to write out. I had also considered making a proxy image class eventually for this exact reason. If you search the archives for proxy image, Sukender, you should find the discussion I and Robert had about this a while ago. An additional benefit would be when doing runtime creation/destruction of contexts. Right now, if you do that, you need to turn off unrefImageAfterApply, or else in the new contexts the textures will be missing. But this completely removes the benefit of unrefImageAfterApply of course, so you have duplicate image data on the CPU memory and GPU memory even if you never (or seldom) create new contexts. So with a proxy image class, you could run a visitor on your models at load time which would replace all images with this proxy image, and then keep unrefImageAfterApply turned on. Then, the image data would only be on the GPU, and at the time when you create a new context, the image would be reloaded by the proxy image, applied to the Texture in the new context, and unreffed again. Since creating new contexts is done seldom, the cost of reloading the image is small and you'd gain the CPU memory back afterwards. Anyways, that's to say that a proxy image was on my to do list (my free time to do list of course, so it will take some time to get to it :-( ) but if you get to it first it could help you and help others at the same time. 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] The book OpenSceneGraph Design and Implementation is published
Hi Wang Rui, Well the next OSG BOF is in August next year - I'll wait to see if dangdang.com has stock soon and try to order it then. Well, I think I was able to register at dangdang.com and sign up to be notified when there is more stock for your book... Yay for Google Translate :-) It said: 亲爱的Skylark13: 您已成功提交,我们会在到货后尽快通知您! 本窗口0秒后自动关闭! We can always poke fun at automatic translations but they get the job done. Looking forward to getting that e-mail. 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] Slave camera configuration by config file
Hi Paul, I have a system with four displays arranged as a 2x2 powerwall. If I simply bring up osgviewer cow.osg, osgViewer seems to think that the four displays are arranged horizontally. That seems like a fine default assumption. Yes, I've seen this too. On Windows (and I expect on Linux and OSX too) there's an API call you can make to get the actual offset of a screen, so you can detect how the screens are physically arranged (as long as the system's display properties are set correctly of course). We use this in our software to set up layouts like the one you want, and I was thinking of submitting a modification to osgViewer (probably GraphicsWindowWin32) to take this into account. But yeah, if you can find a way to make a config file that will do it as you want, that will be a good solution. And simpler than autodetecting correctly :-) 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] CompositeViewer context cleanup and missing textures
Hi Robert, Jason, I would see similar crashes / missing textures, but only when previous context ID's were reused, and only when using paged databases. I'd sure like to see this fixed... I posted an example reproducing the issue on osg-users a while back but Robert was busy on the GLES port. Now that you're done, could you investigate that issue (which seems related to this one too) please? Note that the issue happened both with and without the texture pool support for me (in fact we spotted it in our app which is built on OSG 2.6). We worked around the issue temporarily by incrementing the context usage count so that context IDs are not reused, but it would be better of course if OSG cleaned up after itself correctly when a context was destroyed so that context ID reuse would work correctly. If you want me to repost my (and Jason's) latest code that reproduced the issue with context ID reuse, just ask. I think you can get it from the link Jason posted though. Thanks in advance, 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] heightfield change height crashes
Hello Thomas, i only have set -setDataVariance(osg::Object::DYNAMIC); to the geode, now i also have set it to the shapeDrawable. Should i apply it only to the shapeDrawable or to both? Data variance only has an effect on subclasses of osg::Drawable and on osg::StateSet (at run time - it has an effect on other nodes for the osg::Optimizer if you use that, but at run time it only effects drawables and statesets). After this change it draws the first point of my setHeight() changes, any following setHeight() call doesnt paint anything? If i use -dirtyDisplayList(); on the shapeDrawable directly after calling setHeight() crashes the application. But you didn't answer the other question, do you call it in the update phase? If you don't pay attention to when you call it, you might be calling it during the cull phase while OSG is trying to draw your height field, so one thread will be trying to draw it while another will be trying to update it and it will crash. For the changes in height to be visible, either you need to disable display lists completely (setUseDisplayList(false)) or you need to dirty the display list (dirtyDisplayList()). There's no getting around that, if you don't do one of those two things then the old display list will still be used and you won't see any changes you make using setHeight()... Makes sense doesn't it? For a relatively small height field, the general recommendation is that if you're going to be changing the heights often (say more often than once per second), you should disable display lists completely, or else you'll be spending too much time updating them. But if you're going to be changing the heights less often, then you should keep display lists enabled and call dirtyDisplayList() (from the update phase! say in an update callback on your geode). But for large height fields, you should probably disable display lists in any case, and perhaps even enable VBOs, if you're using a pretty recent video card, it will be more efficient that way. Anyways, try the different alternatives out and see for yourself. 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] CompositeViewer context cleanup and missing textures
Hi J.P., Can anyone confirm the missing textures? Any hints as to what else needs to be done to make sure everything is cleared/flushed correctly? We've been doing something similar to this for a while now and it's worked for us, what I'm wondering is whether the recent changes to texture buffering and such would have broken this (i.e. if something that needs to be cleaned up and was before now isn't). Our own app still uses OSG 2.6 so I wouldn't have seen this. I haven't had a chance to check your code yet, give me a few minutes and I'll check if there's anything amiss that I can see. 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] CompositeViewer context cleanup and missing textures
Hi again, I haven't had a chance to check your code yet, give me a few minutes and I'll check if there's anything amiss that I can see. I'm sorry to say I can't repro here on Windows Vista, VC++ 2005 on SVN head. But it seems that you've pinned it down to the texture pool as I thought, though it would seem to be OS specific? A bit weird. Sorry I couldn't help more. 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] CompositeViewer context cleanup and missing textures
Hi Frederic, Since we don't have direct access to the textures, we can't make the call to setUnRefImageDataAfterApply(). Would there be another way? You can run a visitor to get to the textures and turn this setting off. You can either make your own, or use osgUtil::Optimizer::TextureVisitor like this: osg::Node* node = osgDB::readNodeFile(...); osgUtil::Optimizer::TextureVisitor tv(true, false, false, false, false, false); node-accept(tv); (the arguments to TextureVisitor's constructor are changeAutoUnRef, valueAutoUnRef, and the rest all false so nothing else is changed.) Now, as for the modified CompositeViewer example, I tried it on Windows Vista and it simply crashes the first time I hit ESC or the X button. Strange, I tried it on Vista as well and I didn't have any problem. I notice you're using the stable version of OSG (osg55 = OSG 2.8, the current SVN trunk is at 62), so perhaps something was fixed that affects this, and it would not crash for you in a more recent version. 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] CompositeViewer context cleanup and missing textures
Hi Frederic, Some more fun in perspective! At least, I'll try the texture pool solution in the latest SVN build to see if it helps. I think that's what's most susceptible to work. Even stable releases can have bugs. So I really suspect that you're hitting a bug that's fixed in SVN. As I said, I run the example on Windows Vista without crashes (I tried multiple times without problems) and I run an nVidia card as well (9800GTX+) with semi-recent drivers. 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] [osgOcean] Wake effects?
Hi Buganini, Does same problem also occur for cliff straightly down to deep sea bed ? Possibly, I don't know. 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] Shadows on two-sided polygons
Hi Andreas, However, I have made an option in my program to use the StandardShadowMap, and it does not work for me (yet). Here are the problems: I'll have to let Wojtek answer these questions - I don't normally use planes in my scenes, generally I use manifold objects... I think it´s nicer to have the shaders as separate files, one can easily load them and use them, no need to modify the source. People who want to load different shaders will of course want to have shader files. But the default shaders need to be in the source, that way the examples can work without needing OSG-Data. It's just more self-contained for people who just want to use the effect with the default shaders. It's a pattern that's been used in many effects in OSG, including most shadow techniques. 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] [osgOcean] Wake effects?
Hi Kim, Oh.. and was the attached image supposed to be in 8 bit colour? Are you running osgocean on a zx 81 or something? ;) Looks like images attached to forum posts are converted to lower resolution/bit depth before being sent to the mailing list, it's not the first time I've seen this in the last few weeks. Perhaps this is a setting Art could tune? I don't think our users would purposefully post huge images... Or maybe there could be a resolution limit but keep the original bit depth? 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] osgQtBrowser - compile problem
Hi Robert, I believe this is now fixed thanks the submission I merged from Mathias. Could you test svn/trunk and let me know if any problems arise? Yep it's fixed and in the same way. So forget this one :-) 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] OpenGL ES-2.0, OpenGL ES-1.1 and OpenGL 3.x support now ready for testing :-)
Hi Eric, According to the article, they admittedly used private APIs which is explicitly forbidden in Apple's license terms. I don't believe getenv or any ANSI C function is considered private. Private stuff is usually proprietary Apple APIs hidden away and undocumented which you have to go out of your way to use. I can't imagine OSG would hit any of these either by accident or on purpose. I understand. I just thought calls named _NSGetEnviron and exc_server (those are the calls they refer to in the article) sounded like get some environment variable and some threading functions, so I thought it might be possible that the low-level implementations of some functions might use them without us being aware of it... But if the likeliness of that happening is close to null, that's great. 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] broken osgconv.exe
Hi Mattias, At first I didn't remember that either, but then it struck me - it was me :) I seemed to remember it was a Mat(t?)(h?)ias but didn't remember who exactly, and didn't bother to go check the archives... Shame on me. :-( Thanks for checking. Ted, as a workaround you could also install the VC8SP1 runtimes... It's not a solution because VC9 binaries should not depend on VC8 runtimes, but for the moment it would let you move forward while Mattias sorts this out. 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] Shadows on two-sided polygons
Hi Andreas, I have turned off those things, and now it works good for me. Should I refactor that in a way that the application programmer can choose the behaviour and submit that? You could, but I think setting those things via overridden state is also acceptable, since if you need that you'll probably know what to set... Another thing: I have written a vertex and a fragment shader that work together in a way that allows the shadows to be rendered exactly in the ambient color. This means that shadowed surfaces look the same as surfaces that face away from the light. This gives a much more natural feeling, and you don´t get false shadows on the backs of polygons. I needed the vertex shader to get the correct ambient color, I think it is not possible to do this with a fragment shader alone. I assume you're talking about osgShadow::ShadowMap? The shaders used for the ViewDependentShadow classes (LightSpacePerspectiveShadowMapDB, CB, VB) already do this. Note that osgShadow::StandardShadowMap is the equivalent of osgShadow::ShadowMap but under the ViewDependentShadow architecture, so you could have used that and you would have gotten the right shadow ambient color. You can always submit those shaders (as part of modified ShadowMap.cpp files so that they work by default), I'm sure anyone still using osgShadow::ShadowMap will be glad you do. 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] [osgOcean] Wake effects?
Hello Tian Ma, I have update my source from SVN, when I test the new source, I found that the foam effects around the boat is still sharp white. Is that still a unsolved problem? Yes indeed. We discussed adding (invisible) sloped geometry around the silhouette of objects that contact the water so that the depth buffer around them would go down gradually rather than sharply, kind of the way shadow volume techniques generate geometry for the shadow volumes from silhouette edges as seen from light sources. But this was just discussion. No one has volunteered to do this yet. Any volunteers? :-) 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] broken osgconv.exe
Hi Ted, This application has failed to start because MSVCR80.dll was not found. Re-installing the application may fix this problem Hmmm, that would seem to indicate that the VC9 binaries depend on the VC8 runtime (probably in addition to the VC9 one). That's pretty weird. Could whoever compiled those binaries (I don't remember) check that? 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] OpenGL ES-2.0, OpenGL ES-1.1 and OpenGL 3.x support now ready for testing :-)
Hi Robert, Thomas, Great new on the ES ports. I've been fiddling with OpenGL ES on IPhone and had up till now been using my own very basic port of OSG. I would most certainly be up for trying to get the latest trunk to compile on IPhone. I recon osg shouldn't be too much trouble it's osgDB that scares me :) One thing you apparently need to be careful of is that Apple is now more careful in its screening of iPhone apps that are submitted for the App Store, they apparently got bitten by some apps harvesting phone numbers and such... I don't know personally, but I read it here: http://www.develop-online.net/news/33266/Unity-iPhone-games-rejected-by-Apple http://forum.unity3d.com/viewtopic.php?t=35744 Seems some of the calls they rejected apps for seems to be an equivalent of getenv(), which OSG uses, so it might be interesting to check the actual approval rules and see if we can disable things that would cause apps to be rejected with an iphone-specific define in CMake or something. 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] OpenGL ES-2.0, OpenGL ES-1.1 and OpenGL 3.x support now ready for testing :-)
Hi Robert, Just to be sure you understand, I am not developing iPhone apps myself, I was just relaying some info I had read to those who might be interested to submit an OSG-based iPhone app to the Apple App Store sometime in the future. It may also be useful to toggle such features on/off at runtime, as well as at compile time. As I understand it, they use nm to check which library calls are linked in and used, so disabling at run time wouldn't get past their checks. Though I may be wrong. 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] Best ways to render FE models with millions of tris and quads
Hi Andrew, For a test run osgparameter to see how you get on - it throws lots of vertices at the graphics card and uses a shader to update. Even my 5 year old laptop can render it at 60Hz. That's osgparametric, in case you were wondering. Robert's typos strike again :-) 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] osgOcean also rendering with osgParticle?
Hi Kim, I'm not sure if Ogls multiple render target implementation is any more efficient than using a completely separate pass but rendering the ocean twice would be very costly. Yes, of course MRT is more efficient than multiple passes... It's only one pass of the geometry, but with multiple buffer attachments that you can address independently in your shaders. That's the whole point of MRT :-) 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] [osgPlugins] Updating vertices properly + pick only one Geometry object
Hi Bart, The node mask idea also works fine. However, I saw in osgViewer::View a function computeIntersections. The function gave me the impression that it could also fix my problem, without using a node visitor. My idea was to construct an empty NodePath, push the Cloth's node in this NodePath and then pass it to computeIntersections. Unfortunately, it always says there are now intersections. Am I missing something? computeIntersections uses osgUtil::IntersectionVisitor under the hood, so it's just a convenience function. If you're using IntersectionVisitor and it's working for you, continue using it that way, you'll have more control. And the reason it doesn't work for you is that you need a complete node path from your camera to the model for it to detect intersections correctly. Otherwise it uses the coordinates you give (say 300, 400 which you gave in window space) as object space coordinates... The camera is what gives the transformation from window space to world space, and then the traversal down from there gives the transformation from world space to object space. So if you wanted to use computeIntersections(), you'd still have to set the node masks the way you are now, and use the version of computeIntersections that doesn't take a node path. 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] Functioncall error
Hi Thorsten, textobj is a local object in your constructor, not a member of your class. Here are the changes you need. class TGTextNode : public osg::Geode { public: TGTextNode(std::string T_Text, int T_Size, int T_Res, int T_PosX, int T_PosY, int T_PosZ); void addOutline(); protected: osg::ref_ptrosgText::Text _textobj; }; TGTextNode::TGTextNode(std::string T_Text, int T_Size, int T_Res, int T_PosX, int T_PosY, int T_PosZ) { _textobj = new osgText::Text; // Then replace all textobj with _textobj below textobj-setAlignment(osgText::Text::CENTER_CENTER); textobj-setCharacterSize(T_Size); textobj-setFont(bewilder.ttf); textobj-setFontResolution(T_Res, T_Res); textobj-setPosition(osg::Vec3(T_PosX, T_PosY, T_PosZ)); textobj-setColor(osg::Vec4(100, 50, 0, 1)); textobj-setAxisAlignment(osgText::Text::SCREEN); textobj-setText(T_Text); //textobj-setBackdropType(osgText::Text::OUTLINE); //textobj-setBackdropColor(osg::Vec4(1,.1,.1,1)); textobj-setDataVariance(osg::Object::DYNAMIC); this-addDrawable(textobj.get()); } void TGTextNode::addOutline() { textobj-setBackdropType(osgText::Text::OUTLINE); textobj-setBackdropColor(osg::Vec4(1,.1,.1,1)); } I know that this is maybe a bit noobish, but im really stuck here. No offense, but I think you need to pick up a book on C++ or programming in general. These are not noobish about OSG, they are noobish about programming, and we're normally here to answer questions about OSG itself... 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] [osgPlugins] Updating vertices properly + pick only one Geometry object
Hi Bart, 1. My current project is developing a cloth simulation and it is working. The model consists of particles connected with springs. To visualize everything I use a Geometry object representing a triangle mesh, which I update every time step by first calling the dirtyDisplayList() function. This is not a very clean solution, but OSG is rather big and not everything has been documented, so perhaps one of you know where I should be looking for a cleaner solution. Well, I don't think there's anything cleaner than that, but more efficient probably: For dynamic geometry, you should disable display lists and use vertex buffer objects. There is osgParticle and osgAnimation, though I get the impression that osgParticle has been designed for unconnected particles. Indeed osgParticle is for unconnected particle simulations like rain, dust, splashes, fire, smoke... osgAnimation is for keyframe animation, skinning, etc. Not really what you're looking for. I think you're doing it right, generating the geometry yourself so you have good control over it. So if you use VBOs instead of display lists it'll be faster, and I think you'll be fine. 2. I want to select particles with the mouse using a pick operation and this is working now for all objects in the scene. I only need to pick the cloth's particles, but how do I let OSG only do intersection tests on the cloth's geometry? Set the geometry's node mask to some non-zero value A, other objects' node masks to some other non-zero value B which does not contain A (bitwise), and set your intersection visitor's traversal mask to A. For example, set the node mask on the geometry you want pickable to 2, and the node mask on the other geometry to ~2 (or 4, or 8, or whatever does not bitwise contain 2). Then set the node mask on your intersection visitor to 2. Any traversal in OSG uses node masks to know whether to continue traversing down the graph. The mask of the current node is bitwise-anded with the visitor's traversal mask, and if the result is not 0 then it will traverse into the node's children. So the above has two implications: A) since your intersection visitor's node mask matches the pickable node's mask (bitwise) but not the unpickable nodes', it will only consider the pickable node in its intersection tests. B) since the default traversal mask is 0x (i.e. all bits set), all nodes will still be rendered since the only way to get a bitwise-and value of 0 when the traversal mask is 0x would be to set the node mask to 0 too. 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] osgOcean also rendering with osgParticle?
Hi Erik, I've been playing around with osgOcean recently (nice work, btw!) and realized my fantastic particle effects were not being rendered in the scene. I tried to add them in various places in the scene graph with limited results. I expect it's something to do with the shaders, but I don't know what off the top of my head because I've never really used osgParticle (other than a few small tests). That's the one bad thing about shaders, it forces you to be much more hands-on with what's going on in your scene. Perhaps someone else will chip in and give you some better hints about what's going on. Sorry I can't help more. 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] TexCoords and texture unit
Hi Martin, Can I do this without a glsl shader? A set of textures dependend on one TexCoordArray? geometry-setTexCoordArray(1, geometry-getTexCoordArray(0)); Your data will not be copied CPU-side (one tex coord array for both units, the ref count incremented accordingly) but they will be uploaded twice so it may be slower than the shader version. But if you need to be fixed-pipeline then you don't have a choice, if you're going to multitexture then you'll be sending texcoords for more than one texture unit. I don't think there's a way to tell the fixed pipeline use the same texcoords for two (or all) texture units. 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] [AKO Warning - Message fails DKIM verification] Re: Problems with osgViewer::View::computeIntersections()
Hello Lee, My Speculation: During rendering, there is a cull traversal that is performed. Objects which pass this cull traversal are gathered into a set and that set of objects is rendered. This set of objects might be retained and re-used by the IntersectionVisitor or Intersector class (a reasonable optimization). As a result, if an object got culled last rendering pass, you can't intersect it. I'm the unusual person who wants to perform intersection testing against something that didn't make it through the cull pass of the last frame. This is wrong. The intersection visitor is a normal visitor, it visits your scene and not the set of elements (drawables) gathered by the cull stage. I don't know what the problem is in your case, but intersection is not related to rendering in any way, as Robert said. I even had a program that used IntersectionVisitor to raytrace a scene, so viewer-frame() was never called, and it worked fine. Build OSG with debug information, set a breakpoint at your intersection routine, and trace into OSG as it does the traversal with the intersection visitor. That way you'll find out where it stops traversing and why. 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] std::vector instances from osg::geode derived class error
Hi Thorsten, osg::ref_ptrTGBaseWidget WidgNode01 = new TGBaseWidget(2,1); This is pretty basic... Look at this: for(i=count_width; i0; i--) { (1) ElementLower.push_back( new TGWidgetElement(posX, posY, WidgElementSideLower.png)); posX += 15; posY += 15; (2) int elementnumber = i - 1; std::cout elementnumber std::endl; (3) ElementLower[elementnumber].get()-setDataVariance( osg::Object::DYNAMIC); this-addChild(ElementLower[elementnumber].get()); } Now, trace this in your head. When count_width is 2 (which is the case when you call the constructor as you did above), i starts at 2. Then, you push_back one TGWidgetElement into ElementLower at (1), so ElementLower contains 1 element at index 0. Then you calculate elementnumber as i-1 = 2-1 = 1 at (2), and then you try to access ElementLower[elementnumber] which is ElementLower[1]. That doesn't exist (because ElementLower contains one element at index 0, nothing at index 1. Thus you get a crash, because you tried to access a vector with an index out of its bounds. There are a few ways to fix this, but I'll let you find them yourself. It's a very basic bug which you could have found for yourself by running your code in a debugger, setting a breakpoint at the start of the for loop, and then running one line at a time to check the values as you go. 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] Disable Backface Culling of a node
Hi Dominic, node-getOrCreateStateSet()-setMode( GL_CULL_FACE, osg::StateAttribute::OFF ); thanks but this didn't work. We applied the mode on a loaded osg file. Is this a problem? If the osg file contains a stateset which sets GL_CULL_FACE to ON below the root node where you set it to OFF, it will be overridden and will be ON for the drawables (state is inherited down into the leaf nodes). If you want to force GL_CULL_FACE to OFF for all nodes below the root of your .osg file, use osg::StateAttribute::OFF|osg::StateAttribute::OVERRIDE. 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] osgQtBrowser - compile problem
Hi Robert, As this method isn't available in older versions of Qt then I'd suggest adding an #ifdef around it. Done, and CC'd to osg-submissions. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ #include QGraphicsViewAdapter.h #include QWebViewImage.h #include QtOpenGL/QGLWidget #include osgGA/GUIEventAdapter #include osg/io_utils #define MYQKEYEVENT 2000 #define MYQPOINTEREVENT 2001 QCoreApplication* getOrCreateQApplication() { if (QApplication::instance()==0) { static char** argv = 0; static int argc = 0; static QApplication app(argc,argv); } return QApplication::instance(); } class MyQKeyEvent : public QEvent { public: MyQKeyEvent( int key, bool down ): QEvent( QEvent::Type(MYQKEYEVENT) ), _key(key), _down(down) {} int _key; bool_down; }; struct MyQPointerEvent : public QEvent { MyQPointerEvent(int x, int y, unsigned int buttonMask): QEvent( QEvent::Type(MYQPOINTEREVENT) ), _x(x), _y(y),_buttonMask(buttonMask) {} int _x, _y; unsigned int _buttonMask; }; QGraphicsViewAdapter::QGraphicsViewAdapter(osg::Image* image, QWidget* widget): _image(image), _backgroundColor(255,255,255), _qtKeyModifiers(Qt::NoModifier) { // make sure we have a valid QApplication before we start creating widgets. getOrCreateQApplication(); setUpKeyMap(); _graphicsScene = new QGraphicsScene(); _graphicsView = new QGraphicsView; _graphicsScene-addWidget(widget); _graphicsView-setScene(_graphicsScene); #if QT_VERSION = QT_VERSION_CHECK(4,5,0) _graphicsScene-setStickyFocus(true); #endif _graphicsView-viewport()-setParent(0); int width = _graphicsScene-width(); int height = _graphicsScene-height(); _qimages[0] = QImage(QSize(width, height), QImage::Format_ARGB32); _qimages[0].fill(_backgroundColor.rgba()); _qimages[0] = QGLWidget::convertToGLFormat(_qimages[0]); _qimages[1] = QImage(QSize(width, height), QImage::Format_ARGB32); _qimages[1].fill(_backgroundColor.rgba()); _qimages[2] = QImage(QSize(width, height), QImage::Format_ARGB32); _qimages[2].fill(_backgroundColor.rgba()); _currentRead = 0; _currentWrite = 1; _previousWrite = 2; _previousFrameNumber = 0; _newImageAvailable = false; connect(_graphicsScene, SIGNAL(changed(const QListQRectF )), this, SLOT(repaintRequestedSlot(const QListQRectF ))); assignImage(0); } void QGraphicsViewAdapter::repaintRequestedSlot(const QListQRectF) { // osg::notify(osg::NOTICE)QGraphicsViewAdapter::repaintRequestedSlotstd::endl; render(); } void QGraphicsViewAdapter::customEvent ( QEvent * event ) { if (event-type()==MYQKEYEVENT) { MyQKeyEvent* keyEvent = (MyQKeyEvent*)event; handleKeyEvent(keyEvent-_key, keyEvent-_down); } else if (event-type()==MYQPOINTEREVENT) { MyQPointerEvent* pointerEvent = (MyQPointerEvent*)event; handlePointerEvent(pointerEvent-_x, pointerEvent-_y, pointerEvent-_buttonMask); } } void QGraphicsViewAdapter::setUpKeyMap() { _keyMap[osgGA::GUIEventAdapter::KEY_BackSpace] = Qt::Key_Backspace; _keyMap[osgGA::GUIEventAdapter::KEY_Tab] = Qt::Key_Tab; _keyMap[osgGA::GUIEventAdapter::KEY_Linefeed] = Qt::Key_Return; // No LineFeed in Qt! _keyMap[osgGA::GUIEventAdapter::KEY_Clear] = Qt::Key_Clear; _keyMap[osgGA::GUIEventAdapter::KEY_Return] = Qt::Key_Return; _keyMap[osgGA::GUIEventAdapter::KEY_Pause] = Qt::Key_Pause; _keyMap[osgGA::GUIEventAdapter::KEY_Scroll_Lock] = Qt::Key_ScrollLock; _keyMap[osgGA::GUIEventAdapter::KEY_Sys_Req] = Qt::Key_SysReq; _keyMap[osgGA::GUIEventAdapter::KEY_Escape] = Qt::Key_Escape; _keyMap[osgGA::GUIEventAdapter::KEY_Delete] = Qt::Key_Delete; _keyMap[osgGA::GUIEventAdapter::KEY_Home] = Qt::Key_Home; _keyMap[osgGA::GUIEventAdapter::KEY_Left] = Qt::Key_Left; _keyMap[osgGA::GUIEventAdapter::KEY_Up] = Qt::Key_Up; _keyMap[osgGA::GUIEventAdapter::KEY_Right] = Qt::Key_Right; _keyMap[osgGA::GUIEventAdapter::KEY_Down] = Qt::Key_Down; _keyMap[osgGA::GUIEventAdapter::KEY_Prior] =
Re: [osg-users] HeightField intersection
Hi Teodor, I get the coordinates from getLocalIntersectionNormal() and I try to convert them to row and columns. Is there another way to get these values from mouse position? getLocalIntersectionNormal() will return the normal vector where the intersection occured, i.e. the vector perpendicular to the surface... I think what you want is getLocalIntersectPoint(), that will give you the location in object space where the intersection occured. You might have to do some transformations to get the position in your height field where that corresponds to, but only you can know what those are. 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] ShadowMap problem...
Hi Wyatt, Any suggestions? Not really. At this point you'll probably have to trace into OSG to make sure the shadow map traversal is getting to the right objects (i.e. your masks are set correctly), and check your shaders (perhaps even try with the basic shaders that LISPSM uses by default for starters). Also, try to start with the osgShadow example, and work up progressively to something similar to what you have in your app, and perhaps in the process you'll find out what's not working. If not, then at least you'll have a small app that can demonstrate the problem, which we might be able to help with. 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] HeightField Performance
Hello Teodor, 1. Is this class the appropriate one for what I want to do? I'm assuming you're using osg::HeightField with osg::ShapeDrawable - you didn't specify... Please try to be more precise in the future. In that case, no, it's not appropriate for large height fields. As Robert has said many times in the past, anything using osg::ShapeDrawable with an osg::Shape is meant for debugging and quick-and-dirty tests, not for production use. 2. Are there other alternatives to it that would yield better performance Whenever I've had to use height fields, I've always generated the geometry myself, it's pretty easy to do. You'll want to use triangle strips, and batch vertices together (experiment with different batch sizes per vertex array, for example 1000 or 1 or 10 per vertex array - different sized batches will be better on different generations of video cards). There is osgTerrain::HeightFieldLayer, but I'm not sure how much better than osg::ShapeDrawable that is. Perhaps others can suggest something else. 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] Would someone be willing to help me diagnose a performance issue?
Hi Frank, However, in the Slow App, there's actually a Model class of our own making, that has an osg::Group* member that stores a reference to the model's parent node, and an osg::MatrixTransform* that stores a reference to the model's Matrix Transform. The constructor of this class follows the same basic steps I outlined above, in order to wire everything together, but it's possible that I'm overlooking something amongst the added complexity. That might be the case - encapsulation is a powerful tool but it sometimes inadvertently hides important details... (or makes them less obvious) 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] Would someone be willing to help me diagnose a performance issue?
Hi Frank, So, I think that about wraps it up! Thanks to everyone for your help. Great, good to know you've found one of the culprits! I'd still encourage you to review your hierarchy to facilitate OSG's culling, but as long as your objectives are met, it's probably not that critical for now. :-) As Robert once said, when optimizing, check if you get a solid 60Hz, if so then go have a beer :-) 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