[osg-users] [build] Getting "error C2988: unrecognizable template declaration/definition" while compiling osgdb_vrml
Hi everybody! I try to compile the osgdb_vrml reader plugin. As of now I have managed to compile a openvrml.lib from the current version OpenVRML 0.18.5 (not via subversion but downloaded the source directly from website). When I try to compile I get a "error C2988: unrecognizable template declaration/definition" in openvrml\local\float.h. It seems to have something to do with the definition of OPENVRML_LOCAL beyond. Code: template OPENVRML_LOCAL inline Float fabs(const Float f) { return f < 0.0 ? -f : f; } Did anyone ran into same troubles like me? Any pointer is appreciated, unfortunately my C++ knowledge is limited (little bit "rusty", you know :) ) Thanks! Cheers, Holger -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34907#34907 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [ANN] MS Kinect - official drivers available
Hi dimi, Primesense produces the MS Kincect product. In germany there is a very famous publisher of IT journals (Publisher 'Heise' www.heise.de, journals IX, CT) They reported a lot regarding MS Kinect and the open source drivers. They also reported the release of the openni drivers. I haven't tested it yet because I'll buy it as a christmas gift to myself next week (yes, sometimes christmas is a great plea :D ) But regarding the journal qualities of heise, I'm absolutely sure it will work out of the box. I can give feedback in two weeks :) Best regards, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34906#34906 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Limitation in current ImageLayer serializer
Hi Brad, 2010/12/16 Christiansen, Brad : > ps- I am not used to such quick resposes. Geat having someone in the same > time zone for a change! > I'm in China and its afternoon here. I'm just in my best shape after a rest at midnood. ;-) Wang Rui ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Limitation in current ImageLayer serializer
Thanks. Seems obvious now. I think a C++ 101 course would do me the world of good : ) It shows the only C++ I have ever done is OSG hacking. ps- I am not used to such quick resposes. Geat having someone in the same time zone for a change! -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Wang Rui Sent: Thursday, 16 December 2010 2:12 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Limitation in current ImageLayer serializer Hi Brad, In your compile error reports: cannot convert parameter 3 from 'bool (__cdecl *)(osgDB::InputStream &,const osgTerrain::ImageLayer &) Shouldn't it be: bool readFunction(osgDB::InputStream&, osgTerrain::ImageLayer&) 'const' may not be used here. :-) Wang Rui 2010/12/16 Christiansen, Brad : > Hi Rui, > > I have finally found some time to have a look at this issue, and would love > to get a fix implemented before 3.0, but I am not having much luck. > I have previously managed to add a user serializer to VirtualPlanetBuilder > without issue to add support for some extra options, but am getting nowhere > with the ImageLyer serializer. > > I changed the code exactly as you suggested and have added the required check > / read and write functions. I am pretty sure I can implement these ok but I > cant get things compiling with simple stub implementations that simply return > true. > > The compile error I am getting is: > > 2> ImageLayer.cpp > 2>..\..\..\..\..\..\..\Source\src-osg\src\osgWrappers\serializers\osgTerrain\ImageLayer.cpp(52): > error C2664: 'osgDB::UserSerializer::UserSerializer(const char *,bool > (__cdecl *)(const C &),bool (__cdecl *)(osgDB::InputStream &,C &),bool > (__cdecl *)(osgDB::OutputStream &,const C &))' : cannot convert parameter 3 > from 'bool (__cdecl *)(osgDB::InputStream &,const osgTerrain::ImageLayer &)' > to 'bool (__cdecl *)(osgDB::InputStream &,C &)' > 2> with > 2> [ > 2> C=MyClass > 2> ] > 2> This conversion requires a reinterpret_cast, a C-style cast or > function-style cast > > After examing the the VirtualPlanetBuilder code I modified for an earlier > submission, I think I need to register a lookup (or something like that) to > solve the issue but my C++ skills just arnt up to the job of figuring out > exactly what it is I need to do. Any suggestions or simple examples I could > look at would be greatly appreciated. > > Cheers, > Brad > > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org DISCLAIMER:--- This e-mail transmission and any documents, files and previous e-mail messages attached to it are private and confidential. They may contain proprietary or copyright material or information that is subject to legal professional privilege. They are for the use of the intended recipient only. Any unauthorised viewing, use, disclosure, copying, alteration, storage or distribution of, or reliance on, this message is strictly prohibited. No part may be reproduced, adapted or transmitted without the written permission of the owner. If you have received this transmission in error, or are not an authorised recipient, please immediately notify the sender by return email, delete this message and all copies from your e-mail system, and destroy any printed copies. Receipt by anyone other than the intended recipient should not be deemed a waiver of any privilege or protection. Thales Australia does not warrant or represent that this e-mail or any documents, files and previous e-mail messages attached are error or virus free. -- ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Limitation in current ImageLayer serializer
Hi Brad, In your compile error reports: cannot convert parameter 3 from 'bool (__cdecl *)(osgDB::InputStream &,const osgTerrain::ImageLayer &) Shouldn't it be: bool readFunction(osgDB::InputStream&, osgTerrain::ImageLayer&) 'const' may not be used here. :-) Wang Rui 2010/12/16 Christiansen, Brad : > Hi Rui, > > I have finally found some time to have a look at this issue, and would love > to get a fix implemented before 3.0, but I am not having much luck. > I have previously managed to add a user serializer to VirtualPlanetBuilder > without issue to add support for some extra options, but am getting nowhere > with the ImageLyer serializer. > > I changed the code exactly as you suggested and have added the required check > / read and write functions. I am pretty sure I can implement these ok but I > cant get things compiling with simple stub implementations that simply return > true. > > The compile error I am getting is: > > 2> ImageLayer.cpp > 2>..\..\..\..\..\..\..\Source\src-osg\src\osgWrappers\serializers\osgTerrain\ImageLayer.cpp(52): > error C2664: 'osgDB::UserSerializer::UserSerializer(const char *,bool > (__cdecl *)(const C &),bool (__cdecl *)(osgDB::InputStream &,C &),bool > (__cdecl *)(osgDB::OutputStream &,const C &))' : cannot convert parameter 3 > from 'bool (__cdecl *)(osgDB::InputStream &,const osgTerrain::ImageLayer &)' > to 'bool (__cdecl *)(osgDB::InputStream &,C &)' > 2> with > 2> [ > 2> C=MyClass > 2> ] > 2> This conversion requires a reinterpret_cast, a C-style cast or > function-style cast > > After examing the the VirtualPlanetBuilder code I modified for an earlier > submission, I think I need to register a lookup (or something like that) to > solve the issue but my C++ skills just arnt up to the job of figuring out > exactly what it is I need to do. Any suggestions or simple examples I could > look at would be greatly appreciated. > > Cheers, > Brad > > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Limitation in current ImageLayer serializer
Hi Rui, I have finally found some time to have a look at this issue, and would love to get a fix implemented before 3.0, but I am not having much luck. I have previously managed to add a user serializer to VirtualPlanetBuilder without issue to add support for some extra options, but am getting nowhere with the ImageLyer serializer. I changed the code exactly as you suggested and have added the required check / read and write functions. I am pretty sure I can implement these ok but I cant get things compiling with simple stub implementations that simply return true. The compile error I am getting is: 2> ImageLayer.cpp 2>..\..\..\..\..\..\..\Source\src-osg\src\osgWrappers\serializers\osgTerrain\ImageLayer.cpp(52): error C2664: 'osgDB::UserSerializer::UserSerializer(const char *,bool (__cdecl *)(const C &),bool (__cdecl *)(osgDB::InputStream &,C &),bool (__cdecl *)(osgDB::OutputStream &,const C &))' : cannot convert parameter 3 from 'bool (__cdecl *)(osgDB::InputStream &,const osgTerrain::ImageLayer &)' to 'bool (__cdecl *)(osgDB::InputStream &,C &)' 2> with 2> [ 2> C=MyClass 2> ] 2> This conversion requires a reinterpret_cast, a C-style cast or function-style cast After examing the the VirtualPlanetBuilder code I modified for an earlier submission, I think I need to register a lookup (or something like that) to solve the issue but my C++ skills just arnt up to the job of figuring out exactly what it is I need to do. Any suggestions or simple examples I could look at would be greatly appreciated. Cheers, Brad -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Wang Rui Sent: Tuesday, 30 November 2010 1:47 PM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Limitation in current ImageLayer serializer Hi Brad, In fact when I'm working on the osgTerrain serializers, I don't pay much attention to the special mechanism that may be required when loading terrain tile and layer classes. For the case that the image layer may be loaded inactive according to an additional flag, I suggest that we should handle all of these with a user serializer instead, that is, REGISTER_OBJECT_WRAPPER( osgTerrain_ImageLayer, new osgTerrain::ImageLayer, osgTerrain::ImageLayer, "osg::Object osgTerrain::Layer osgTerrain::ImageLayer" ) { ADD_USER_SERIALIZER( Image ); // _image } And write/read images and activate them by ourselves. Here we can read out an image object from the input stream using is.readImage(), and write image to disk files with the << operator. Hope this can help if you would like to help fix the problem. :-) Cheers, Wang Rui 2010/11/30 Brad Christiansen : > Hi, > > I have discovered a piece of missing functionality in the new serializer for > osgTerrain::ImageLayers. The issue is that all optional layers are loaded > when an osgb file is loaded regardless of weather they should be or not. > > The relevant piece of code for the the .ive format is in (in osgDB_ive) > "void ImageLayer::read(DataInputStream* in)" at line 64: > > bool deferExternalLayerLoading = > osgTerrain::TerrainTile::getTileLoadedCallback().valid() ? > > osgTerrain::TerrainTile::getTileLoadedCallback()->deferExternalLayerLoading() > : false; > // Should we read image data from stream > IncludeImageMode includeImg = (IncludeImageMode)in->readChar(); > > if (includeImg==IMAGE_REFERENCE_FILE && deferExternalLayerLoading) > { > setFileName(in->readString()); > } > else > { > setImage(in->readImage(includeImg)); > } > > The new serializer simple adds an image serializer for an ImageLayer with no > similar checks. > > I have had a quick look at coding a fix but have to admit I still dont fully > understand how the new system works in such cases. If anyone can give me some > pointers on how to go about adding this functionality that would be greatly > apprecaited as at the momment I am having to covert my terrain databases back > to .ive. > > For reference, I discovered the issue as my osgb databses where laoding alot > slower than my ive based ones. The reason was that all optional layers were > being loaded even if they weren't active. > > > Cheers, > Brad > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=34231#34231 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org DISCLAIMER:--- This e-mail transmission and any documents,
Re: [osg-users] Render on two screens with an angle
Hello Bart, I must be missing something obvious I guess, but for me it isn't obvious (yet). Not quite obvious, I would say, but something you could have found out by using the debugger or looking at the OSG code for the functions you're calling. Both are tools you should learn to use when you develop with third-party libraries, especially open source ones like OSG. You don't need to create a new camera. In fact, in creating a new camera and replacing the view's camera with yours AFTER the view->setUpViewOnSingleScreen(x) line, you're effectively destroying the graphics context that the setUpView...() function created for you. And your own camera has no graphics context, so you see a black screen. When you create an osgViewer::View, it creates an osg::Camera for you, with appropriate settings. When you call view->setUpView...(), it creates a graphics context and sets it on the view's camera. Creating your own camera and setting it on the view basically voids all that work that was done for you. So just remove the lines: osg::Camera* camera = new osg::Camera; ... view->setCamera(camera); for both your views, and whenever you used the camera variable, use view->getCamera() instead. I'm not sure why you say that just setting a manipulator on the view did not give a black screen. Running your code with the setCameraManipulator(Tman) line uncommented, I still get a black screen in the second view, as I would expect. The camera manipulator is not related to the graphics context in any way, it only acts on the camera's view matrix. If the camera doesn't have a graphics context, you'll get a black screen whether you have a camera manipulator or not. What will make a difference is using viewer.run() instead of while !viewer.done()) viewer.frame(); . The former is a shortcut for doing quick demos. It will do a few things for you, including setting a camera manipulator and creating a graphics context that spans all your screens. So this might have led you to believe that the two were related, but they're not. It's just that viewer.run() does these two things for you... But if you don't want to use a camera manipulator, you don't want viewer.run() anyways. This kind of thing could be seen in a debugger by the way. By setting a breakpoint when you create your views, you could have seen that the view already had a camera as soon as it was created, then that the setUpView...() function had set a graphics context on that camera, and then when you assigned your own camera you could have seen that it had no graphics context. Finally, for future reference, if you want someone to actually compile and run your code, it's much more helpful to include a complete file, with all necessary headers etc that you know compiles, rather than copy and paste some code (even if it's almost complete). It just provides a lower barrier for people to help you easily... For example, here's a source file ready to be compiled that shows what I'm talking about above. You should see the cow on both screens. (note I've commented out checking the arguments for -2, so I can test without any command line arguments, again make it easy for people to help you...) Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ #include #include #include #include #include int main(int argc, char** argv) { osg::ArgumentParser arguments(&argc, argv); osg::Group* scene = new osg::Group(); osg::Node* groundNode = NULL; osg::Node* tankNode = NULL; groundNode = osgDB::readNodeFile("cow.osg"); scene->addChild(groundNode); osgGA::TrackballManipulator* Tman = new osgGA::TrackballManipulator; // construct the viewer. osgViewer::CompositeViewer viewer(arguments); //if (arguments.read("-2")) { // view one { //osg::Camera* camera = new osg::Camera;// don't create a new camera osgViewer::View* view = new osgViewer::View; osg::Camera* camera = view->getCamera();// use the view's existing camera instead. view->setName("View one"); viewer.addView(view); view->setUpViewOnSingleScreen(0); view->setSceneData(scene); // Get the scene bounding sphere osg::BoundingSphere bsph = scene->getBound(); // Look at the center of the scene osg::Vec3 lookAt = bsph.center(); // Place eye at an appropriate distance 'south' of the look-at point osg::Vec3 eyef = lookAt + osg::Vec3(0,-1,0) * bsph.radius() * 3.5f; // Set camera view matrix camera->setViewMatrixAsLookAt(eyef, lookAt, osg::Vec3
Re: [osg-users] Render on two screens with an angle
Hi Ulrich, Thank you again for your patience and insight. Your code makes absolute sense. But I still get the same result. If I have no trackball manipulator for either view, I get a black screen. When I have set it up for one view, only that view gets an image. My code: Code: osg::Group* scene = new osg::Group(); osg::Node* groundNode = NULL; osg::Node* tankNode = NULL; groundNode = osgDB::readNodeFile("cow.osg"); scene->addChild(groundNode); osgGA::TrackballManipulator* Tman = new osgGA::TrackballManipulator; // construct the viewer. osgViewer::CompositeViewer viewer(arguments); if (arguments.read("-2")) { // view one { osg::Camera* camera = new osg::Camera; osgViewer::View* view = new osgViewer::View; view->setName("View one"); viewer.addView(view); view->setUpViewOnSingleScreen(0); view->setSceneData(scene); // Get the scene bounding sphere osg::BoundingSphere bsph = scene->getBound(); // Look at the center of the scene osg::Vec3 lookAt = bsph.center(); // Place eye at an appropriate distance 'south' of the look-at point osg::Vec3 eyef = lookAt + osg::Vec3(0,-1,0) * bsph.radius() * 3.5f; // Set camera view matrix camera->setViewMatrixAsLookAt(eyef, lookAt, osg::Vec3(0,0,1)); view->setCamera(camera); } // view two { osg::Camera* camera = new osg::Camera; osgViewer::View* view = new osgViewer::View; view->setName("View two"); viewer.addView(view); view->setUpViewOnSingleScreen(1); view->setSceneData(scene); // Get the scene bounding sphere osg::BoundingSphere bsph = scene->getBound(); // Look at the center of the scene osg::Vec3 lookAt = bsph.center(); // Place eye at an appropriate distance 'south' of the look-at point osg::Vec3 eyef = lookAt + osg::Vec3(0,-1,0) * bsph.radius() * 1.5f; // Set camera view matrix camera->setViewMatrixAsLookAt(eyef, lookAt, osg::Vec3(0,0,1)); view->setCamera(camera); //view->setCameraManipulator(Tman); } } viewer.realize(); while(!viewer.done()) { viewer.frame(); } I must be missing something obvious I guess, but for me it isn't obvious (yet). Thank you! Cheers, Bart Jan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34900#34900 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Render on two screens with an angle
Hi Bart, On 15/12/10 22:53 , Bart Jan Schuit wrote: > Thank you for your quick response. Well when I delete my CameraManipulator > (Trackball), > the screen goes blank (just blue or black background, depending on which > model I load). > So I assumed a Manipulator was needed. You see nothing because the cameras are not properly set up. The CameraManipulators will by default place the camera so that the entire model is visible. Camera doesn't do that for you. What I usually do first (to get something visible) is to place the camera so it's watching the entire scene: // Get the scene bounding sphere osg::BoundingSphere bsph = scene->getBound(); // Look at the center of the scene osg::Vec3 lookAt = bsph.center(); // Place eye at an appropriate distance 'south' of the look-at point osg::Vec3 eye = lookAt + osg::Vec3(0,-1,0) * bsph.radius() * 1.5f; // Set camera view matrix camera->setViewMatrixAsLookAt(eye, lookAt, osg::Vec3(0,0,1)); > (with what values but also where and how), the projection matrix etc. > Because the view > and projection matrix can only be set via a camera. But I cannot manipulate a > camera > myself, because a Manipulator is defined. That's why I said don't use a Manipulator. The Manipulator is only calling osg::Camera::setViewMatrix* with a properly constructed view matrix, but you can just as well do that yourself. See above. Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [ANN] MS Kinect - official drivers available
Are you sure these drivers work for the Kinect. On the site it states that it only works with a Primesense camera. And although its the same company that produced both the Primesense camera and gave the design for XBox Kinect, Can you just plugin the Kinect and use the drivers as is? Or does it only work as stated on the site with a Primesense camera. Which by the way looks very much like the kinect.. http://www.primesense.com/?p=514 Dimi - Original Message From: Torben Dannhauer To: osg-users@lists.openscenegraph.org Sent: Tue, December 14, 2010 12:25:24 PM Subject: [osg-users] [ANN] MS Kinect - official drivers available Hiho, I thought this might be interesting for some of you: The manufacturer of Microsofts Kinect Sensor released a official driver package for linux and windows! you can download and read the spects on http://www.openni.org I think it would be great to swim through osgOceans underwater scene for example ;) H, Kinect would be a nice christmas present to myself :)) Best regards, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34817#34817 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] SphericalManipulator with limited elevation range
If you want to reuse a lot of the code from SphericalManipulator but add some new features, derive a new class from SphericalManipulator (instead of changing the osg source at all). At the very least it's a good way to experiment with the new features you're adding without having to start over all the way. And later if you want to clean your manipulator up a bit you can derive it from MatrixManipulator directly, and reimplement that necessary functions while cutting out anything from SphericalManipulator which you don't need. Cheers, Tom -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34897#34897 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] SphericalManipulator with limited elevation range
I'm transitioning my map viewer code from using GL/GLUT directly to using OSG. In my old code, the camera manipulation interface was very similar to osgGA::SphericalManipulator, in that the camera stared at a point on the ground, while the mouse moved the camera around on a sphere centered at that point. The one difference was that in my interface, the camera elevation was limited to 0 to pi/2 radians. This prevented the camera from sinking below the ground (elevation < 0), or rising up and over the top of the sphere, looking at the ground upside-down (elevation > pi/2). I would like to have this same camera behavior in OSG. What would be the best way to go about it? Obviously I could add setMaximumElevation and setMinimumElevation methods to SphericalManipulator (it already has setMinimumZoomScale, etc), but if there's a way to limit elevation without changing the OSG source code, that would be preferable, for distribution reasons. Thanks, -- Matt ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Fullscreen dual monitor spanning
Alberto Luaces wrote: > "David Glenn" writes: > > > > Greetings Alberto! > > > > Just for grins, I tried this on a similar example program, and other > > than the ability to change resolutions and go to a full single screen, > > I was not able to get it to span both screens! Maybe there is > > something in the XConfig file that I have to set in X Windows manager > > (I use Genome) to get that to work, because I can’t even get my other > > windows to pan screens unless I drag them. I know that I would like to > > figure that out also! > > > > Hi David, > > Given I'm currently using nVidia cards, I have activated "TwinView" in > the "X Server Display Configuration" section of "nvidia-settings". That > should modify your xorg.conf accordingly. Maybe that's the difference. > > Regards, > > -- > Alberto > > ___ > osg-users mailing list > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > -- > Post generated by Mail2Forum Well, "TwinView" is active! I'm using an nVidia card (GeForce 8600 GT) and their drivers (195.36.24)! It's gota be something else! Maybe in the Windows Manager there is a setting I missing, I suspect! D Glenn (a.k.a David Glenn) - Moving Heaven and Earth! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34895#34895 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Tiling osg files
Hi Torben, I've been probably unclear. I would like to tile directly an .osg file as it contains too much data, and I need only part of it. vpb/dem outputs osg file(s) but takes as inputs dem and texture files. I mentioned vpb/dem for its tiling ability, but I doubt it could solve my problem. Thank you! Cheers, Henry -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34894#34894 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using getGlShaderInfoLog
Hi Joel, I think I had assumed to this point that the shader would be compiled once it was loaded and bound to the program object - it seemed the most logical way to manage it. Of course, once you indicated that even compilation doesn't happen until the shader's called for (which makes sense, now that I think of it), I tried retrieving the log after calling viewer.frame() inside the viewer loop and it worked perfectly. Yes, well in conjunction with what I said also, that the main thread often doesn't have a graphics context, it makes even more sense. How would it compile your shader immediately after loading it if there's no graphics context? Glad I could clear things up for 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
[osg-users] Setting camera Viewmatrix with TrackBallManipulator Matrix gives nothing but black screen
Hi, I'm trying to setup some cameras without a manipulator. When I assign a Trackballmanipulator on the vies, I get the cow projected on the screen. But as soon as I manually setup the cameras, I get a completely black screen. I extract eye, center and up from Tman (Trackballmanipulator) by Tman->getMatrix().lookat(eye, center, up). This gives some nice coordinates, but when I put these in a camera without a manipulator like Tman, I just get a black screen. What am I doing wrong here? Code: int main( int argc, char **argv ) { // use an ArgumentParser object to manage the program arguments. osg::ArgumentParser arguments(&argc,argv); osg::Group* scene = new osg::Group(); osg::Node* groundNode = NULL; groundNode = osgDB::readNodeFile("cow.osg"); scene->addChild(groundNode); osgViewer::CompositeViewer viewer(arguments); if (arguments.read("-2")) { // view one { osg::Vec3d eye = osg::Vec3d(0,0,250); osg::Vec3d center = osg::Vec3d(0,0,250); osg::Vec3d up = osg::Vec3d(0,0,-1); osg::Quat rotation; osg::Matrixd viewmat; osg::Camera* camera = new osg::Camera; osgViewer::View* view = new osgViewer::View; view->setName("View one"); viewer.addView(view); //camera->setProjectionMatrix( osg::Matrix::ortho2D(0,512,0,512) ); //not doing anything //camera->setReferenceFrame( osg::Transform::ABSOLUTE_RF ); //camera->setViewMatrix( osg::Matrix::identity() ); view->setCameraManipulator(Tman); //Tman->setAutoComputeHomePosition(false); view->setUpViewOnSingleScreen(0); view->setSceneData(scene); //view->setCamera(camera); } // view two { osg::Matrixd viewmat; osg::Camera* camera = new osg::Camera; osgViewer::View* view = new osgViewer::View; view->setName("View two"); viewer.addView(view); view->setUpViewOnSingleScreen(1); view->setSceneData(scene); //view->setCamera(camera); view->setCameraManipulator(Tman); view->setName("right"); osg::Vec3d eye = osg::Vec3d(0,0,25); osg::Vec3d center = osg::Vec3d(0,0,25); osg::Vec3d up = osg::Vec3d(0,0,-1); } } viewer.realize(); while(!viewer.done()) { osg::Vec3d eye = osg::Vec3d(0,0,50); osg::Vec3d center = osg::Vec3d(0,0,50); osg::Vec3d up = osg::Vec3d(0,0,-1); Tman->setHomePosition(eye,center,up); //not working. Doesn't matter how I set eye, center etc. viewer.frame(); } } -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34890#34890 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] draw a curve and a curved pive
Hi, I want to draw a curve from a list of points (osg::Vec3f). I looked at osgModeling but I can't draw a curve, I used the class Curve. This gives me an edge between the points and does not calculate a curve. Can you help me, please? Thank you! Cheers, lucie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34889#34889 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Curves/splines
pamakela wrote: > Hi > > > I'd like to use curves, particularly simple 2d control point based splines to > drive variables of scene graph objects over time. I'd also like to use both > linear and cubic interpolated curves. So for example the curve could be sharp > sawtooth, a cubic curve with smooth knee/shoulder, etc. A smooth curve could > be used to control the fade-in or fade-out of a text object for example. > > Is there a (fast) library for doing this? Or is there another approach for > doing this? > > > Paavo Yes, osgAnimation. Cheers, ParticlePeter -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34888#34888 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Error Compiling OSG GL3 on Win7/VS 2008
On 12/15/2010 2:25 AM, Torben Dannhauer wrote: @Paul: You seem to have a running GL3 OSG. Is your OS windows? If yes, what ist build environment? Yes, it was on Windows, which, of course, only support GL 1.1 native. When I had this working, I was using gl3.h only for function prototype definitions, then filling in the necessary function pointers. As a result, there were no undefined symbols. -- -Paul Martz Skew Matrix Software http://www.skew-matrix.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using getGlShaderInfoLog
J-S, Thanks for the reply. You told me exactly what I needed to know. I think I had assumed to this point that the shader would be compiled once it was loaded and bound to the program object - it seemed the most logical way to manage it. Of course, once you indicated that even compilation doesn't happen until the shader's called for (which makes sense, now that I think of it), I tried retrieving the log after calling viewer.frame() inside the viewer loop and it worked perfectly. Anyway, thanks for the help! Joel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34886#34886 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Render on two screens with an angle
Hi Ulrich, Thank you for your quick response. Well when I delete my CameraManipulator (Trackball), the screen goes blank (just blue or black background, depending on which model I load). So I assumed a Manipulator was needed. And I think I need two of them, so I can manipulate each camera independently. The main problem I'm stuck on now is how to setup the view. I've made two views, fullscreen. But now they both show the same image. I do know how to change camera positions. I do not know where they should be in the first place and which direction they face. I didn't quite understand that from your reply. The same goes for the views: how do I set the views correctly, so they are sheared? How should I set the viewmatrix (with what values but also where and how), the projection matrix etc. Because the view and projection matrix can only be set via a camera. But I cannot manipulate a camera myself, because a Manipulator is defined. And through the manipulator I cannot set the projection and view matrix. Maybe it's just a dumb question, I'm sorry for that. I'm completely new to programming with OpenGL and OSG. Made some examples, read the QSG and a lot of forum posts, but I still don't get it. Thank you alot for your help. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34885#34885 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Error Compiling OSG GL3 on Win7/VS 2008
Hi Paul, J-S I applied 2 modifications, and it nearly works: Mod 1: your suggested CMAKE modification Mod 2: I extended the osg/GL includefile to define some windows constants before including GL3/gl3.h to aviod the name confilcts in the same way like it is done prior to the GL2 include: Code: #elif defined(OSG_GL3_AVAILABLE) // Under Windows avoid including // to avoid name space pollution, but Win32's // needs APIENTRY and WINGDIAPI defined properly. // XXX This is from Win32's #ifndef APIENTRY #define GLUT_APIENTRY_DEFINED #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) #define WINAPI __stdcall #define APIENTRY WINAPI #else #define APIENTRY #endif #endif // XXX This is from Win32's #ifndef CALLBACK #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) #define CALLBACK __stdcall #else #define CALLBACK #endif #endif // XXX This is from Win32's and #ifndef WINGDIAPI #define GLUT_WINGDIAPI_DEFINED #define DECLSPEC_IMPORT __declspec(dllimport) #define WINGDIAPI DECLSPEC_IMPORT #endif // XXX This is from Win32's #if !defined(_WCHAR_T_DEFINED) && !(defined(__GNUC__)&&((__GNUC__ == 3)||(__GNUC__ == 4))) typedef unsigned short wchar_t; #define _WCHAR_T_DEFINED #endif #define GL3_PROTOTYPES 1 #include #ifndef GL_APIENTRY #define GL_APIENTRY APIENTRY #endif // GL_APIENTRY #else No the compile works, and most of the linking as well. Only the Qtosg Module faisl to link, because it includes Qts OpenGL module, wich includes gl.h The resulting definition conflict of gl3.h and gl.h ends in a lot of compile errors in osgQt. What would be the approriate way to solve this issue? According to this Qt issue report http://bugreports.qt.nokia.com/browse/QTBUG-8611 Qt currently does not support gl3.h usage. So currently the only option is to disable osgQt while using GL3. I'll submit my two modified files, afterwards the following steps are required for windows+MSVC users: 1. Download gl3.h from www.opengl.org/registry and put it into /GL3/gl3.h 2. Configure CMake to disable all OSG_GLx_AVAILABLE 3. Configure CMake to disable OSG_GL_DISPLAYLISTS_AVAILABLE 4. Configure CMake to disable OSG_GL_FIXED_FUNCTION_AVAILABLE 5. Configure CMake to disable OSG_GL_MATRICES_AVAILABLE 6. Configure CMake to disable OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE 7. Configure CMake to disable OSG_GL_VERTEX_FUNCS_AVAILABLE 8. Configure CMake to ENable OSG_GL3_AVAILABLE 9. Configure CMake to disable Qt usage, because currently Qt is not GL3 capable. Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34883#34883 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Render on two screens with an angle
Hi Bart, On 15/12/10 21:27 , Bart Jan Schuit wrote: > But my question is: how should I > set both cameras? And their projection matrix and view matrix? I've made two > views, > both with their own camera of course. But I think I cannot easily add a > CameraManipulator like the TrackBall manipulator, as moving the camera might > impose > some problems I think. So I tried to just add a CameraManipulator, but VS > tells me I I'd forget about Manipulators for now. For a first cut I would just create the two cameras manually and set the perspective and view matrices manually. If you want to move the camera you can create a keyboard handler that moves the eye point. Then use this new eye point when setting the view matrix. This may not help very much, but I don't really understand at which point you're stuck a.t.m. Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Render to Texture
Hi Delport, I am getting the several pass with the chain effect within the dynamic scene. But the scene freezes after the third pass. And the scene remains frozen(i mean the animation), i can only see the blurred scene. What should i look into to debug this? Thanks for all the useful hint you have put forward so far. Regards Sajjadul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34881#34881 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Render on two screens with an angle
I've made some progress, but not the one I want. I'm trying to figure out how I set the cameras properly. I figure that the shearing is actually the easiest step, once you know how to set the cameras and the projections/views. But my question is: how should I set both cameras? And their projection matrix and view matrix? I've made two views, both with their own camera of course. But I think I cannot easily add a CameraManipulator like the TrackBall manipulator, as moving the camera might impose some problems I think. So I tried to just add a CameraManipulator, but VS tells me I cannot do that as it is an abstract class. Simply, I just want to have a view pre-set views where the camera moves to like 3 or 5 positions, all around the camera point drawn above (so I can test for a couple of views, to see if the projections are correct). So how can I set the cameras this way? Because if I don't add a Manipulator, nothing is shown on the screen. But my main question is how to set the view and/or projection matrices for each camera correctly. Hope you can help me, I'm spending hours on trying stuff out but I can't figure out how it should be done. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34880#34880 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Error Compiling OSG GL3 on Win7/VS 2008
Hi Paul, Hi J-S, the CMAKE modification works. All other compile errors in a lot of files are cause on ambiguous symbols caused by wingdi.h. THis file is included in windows.h, which is in cluded in the gl3.h. To test if it is the reason, I modified gl3.h and disabled the include of windows.h. Now the ambiguous symbols are disappared, but OSG has hundrets of linker errors, because all the _gl* functions are missing. Is this problem caused by my exclusion of windows.h, or is it another problem? @Paul: You seem to have a running GL3 OSG. Is your OS windows? If yes, what ist build environment? Thank you! Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34879#34879 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Texture subloads
Hi All! Searching the answers on my question I've discovered some posts about osg::Texture2D::SubloadCallback and I think that this feature fits my purposes. The only question I have is about osg::Texture2D::apply() function - when is it called? Does it depend on parent node visibility or not? I need this callback to be called every frame regardless of parent node's spatial orientation. Thank you! Best regards, Yurii Monakov ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Fullscreen dual monitor spanning
"David Glenn" writes: > Greetings Alberto! > > Just for grins, I tried this on a similar example program, and other > than the ability to change resolutions and go to a full single screen, > I was not able to get it to span both screens! Maybe there is > something in the XConfig file that I have to set in X Windows manager > (I use Genome) to get that to work, because I can’t even get my other > windows to pan screens unless I drag them. I know that I would like to > figure that out also! Hi David, Given I'm currently using nVidia cards, I have activated "TwinView" in the "X Server Display Configuration" section of "nvidia-settings". That should modify your xorg.conf accordingly. Maybe that's the difference. Regards, -- Alberto ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org