Re: [osg-users] Using MVPW in a Resizeable Window.
Skylark wrote: Hi David, You don't recall by chance any fixes that were made after the OSG 2.8.1 release based on resizing issues? Not off the top of my head, no. It might be interesting to set a breakpoint in the resize event handler and see if it ever gets there when it should. But anyways, if you've got it working the way you want, that's fine too. :-) J-S -- __ Jean-Sebastien Guay http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum Oh yea, the resize event handler is being called. I actually have two points where resizing is used: One is the resizing event routine that is called every time the Whole Window is resized, and the Second is where a tab slider is at where you can make the controls disappear - to get the most maximum view. D Glenn (a.k.a David Glenn) - Moving Heaven and Earth! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35752#35752 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using MVPW in a Resizeable Window.
Skylark wrote: Hi David, Well, I got something working for now! What I had to do was to call hudCamera-setProjectionMatrixAsOrtho2D(0, windowWidth ,0, windowHeight ); for every time I resize the OSG window. Fortunately I have a resize command for the window to do just that. I had to add the function there and someplace else that is activated when a tab is moved. Tested this out and that seemed to fix the problem so far. Hmmm, if you're using the *new* window width and height in that call to setProjectionMatrixAsOrtho2D, then you're probably doing the same thing as if you'd set the projection resize policy to something other than FIXED on your ortho camera... I would think... J-S -- __ Jean-Sebastien Guay http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum Yea! You would think so (and I have the resizing policy set to default). Still, this is the only way that I was able to get it to work. Either QT is doing something weird with OSG or there might be a bug! As far as I can tell, I'm passing on all the resize events that I know of to OSG from QT! You don't recall by chance any fixes that were made after the OSG 2.8.1 release based on resizing issues? D Glenn (a.k.a David Glenn) - Moving Heaven and Earth! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=3#3 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using MVPW in a Resizeable Window.
Hi David, You don't recall by chance any fixes that were made after the OSG 2.8.1 release based on resizing issues? Not off the top of my head, no. It might be interesting to set a breakpoint in the resize event handler and see if it ever gets there when it should. But anyways, if you've got it working the way you want, that's fine too. :-) 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] Using MVPW in a Resizeable Window.
Skylark wrote: Hi David, BTW: does anyone remember what is the Default setting for the projection resizing policy? Yes, I mentioned in my previous post it was HORIZONTAL :-) I think it means it will use the resized horizontal values and the new aspect ratio to calculate the new vertical values (i.e. it gives priority to the horizontal dimension). But I'm not sure. J-S -- __ Jean-Sebastien Guay http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum Well J-S when I got to the code today I did find out that I has set the setProjectionResizePolicy to FIXED and I did commented that code out, but when I tried it, it has no effect on the problem - when I resize the window I still get a delta that moves to the right and up! Can't figure why! Well that was a good try anyway! D Glenn D Glenn (a.k.a David Glenn) - Moving Heaven and Earth! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35504#35504 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using MVPW in a Resizeable Window.
Hi David, Well J-S when I got to the code today I did find out that I has set the setProjectionResizePolicy to FIXED and I did commented that code out, but when I tried it, it has no effect on the problem - when I resize the window I still get a delta that moves to the right and up! Can't figure why! Then you'll have to break out the debugger and put some camera-getProjectionMatrixAsOrtho(...) in some places and see why it's not matching what you expect, and perhaps reproject / reposition the objects once the window has been resized. Hope this helps, J-S -- __ Jean-Sebastien Guay jean-sebastien.g...@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] Using MVPW in a Resizeable Window.
Skylark wrote: Hi David, Well J-S when I got to the code today I did find out that I has set the setProjectionResizePolicy to FIXED and I did commented that code out, but when I tried it, it has no effect on the problem - when I resize the window I still get a delta that moves to the right and up! Can't figure why! Then you'll have to break out the debugger and put some camera-getProjectionMatrixAsOrtho(...) in some places and see why it's not matching what you expect, and perhaps reproject / reposition the objects once the window has been resized. Hope this helps, J-S -- __ Jean-Sebastien Guay http://whitestar02.webhop.org/ ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum Well, I got something working for now! What I had to do was to call hudCamera-setProjectionMatrixAsOrtho2D(0, windowWidth ,0, windowHeight ); for every time I resize the OSG window. Fortunately I have a resize command for the window to do just that. I had to add the function there and someplace else that is activated when a tab is moved. Tested this out and that seemed to fix the problem so far. Tanks for the help J-S! D Glenn D Glenn (a.k.a David Glenn) - Moving Heaven and Earth! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35510#35510 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using MVPW in a Resizeable Window.
Hi David, Well, I got something working for now! What I had to do was to call hudCamera-setProjectionMatrixAsOrtho2D(0, windowWidth ,0, windowHeight ); for every time I resize the OSG window. Fortunately I have a resize command for the window to do just that. I had to add the function there and someplace else that is activated when a tab is moved. Tested this out and that seemed to fix the problem so far. Hmmm, if you're using the *new* window width and height in that call to setProjectionMatrixAsOrtho2D, then you're probably doing the same thing as if you'd set the projection resize policy to something other than FIXED on your ortho camera... I would think... 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] Using MVPW in a Resizeable Window.
Skylark wrote: Just wondering, do you use this: hudCamera-setProjectionResizePolicy(osg::Camera::FIXED) It all depends on how you've set things up and how you want things to behave. If you set as above, the projection will not change even if your viewport changes size. This won't work if your marker in your HUD is meant to follow some other object in the 3D scene, whose camera has a different projection resize policy... Try the different policies and see how they work for you, or check your main camera to see which policy it uses (perhaps the default which is HORIZONTAL). A Good point J-S! When I was writing this hud display stuff I was fallowing the OSG Heads Up Display example. It's been so long ago. I'd got to see if I blindly added that in for some reason! I don't recall doing that or why I would do that! Anyway, it might be worth experimenting with that! Skylark wrote: On the other hand, you might have to save your 3D points somewhere and reproject them when the window gets resized. You can either wire that in your resizeGL function, or you can add a ResizedCallback to your GraphicsContext (GraphicsWindow). It can be a pain to get everything match up correctly, but once you understand how things fit together it all makes sense. You may also want to place breakpoints and inspect the projection matrices (or the result of getProjectionMatrixAsOrtho(), which is easier to interpret :-) ) before and after the resize, and you'll understand what's going on. One page I like on the subject is http://www.songho.ca/opengl/gl_projectionmatrix.html it has nice diagrams, easy to read text and the math is well explained. Hope this helps, J-S -- __ Jean-Sebastien Guay http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum Well, I check the first thing out Monday - I'm on my day off today! Let you know what happens! BTW: does anyone remember what is the Default setting for the projection resizing policy? Thanks! D Glenn D Glenn (a.k.a David Glenn) - Moving Heaven and Earth! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35421#35421 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using MVPW in a Resizeable Window.
Hi David, BTW: does anyone remember what is the Default setting for the projection resizing policy? Yes, I mentioned in my previous post it was HORIZONTAL :-) I think it means it will use the resized horizontal values and the new aspect ratio to calculate the new vertical values (i.e. it gives priority to the horizontal dimension). But I'm not sure. 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] Using MVPW in a Resizeable Window.
Hi David, I'm using the MVPW routine to convert a point 3D perspective so I can display a marker on to my Ortho2D heads up display camera: Just wondering, do you use this: hudCamera-setProjectionResizePolicy(osg::Camera::FIXED) It all depends on how you've set things up and how you want things to behave. If you set as above, the projection will not change even if your viewport changes size. This won't work if your marker in your HUD is meant to follow some other object in the 3D scene, whose camera has a different projection resize policy... Try the different policies and see how they work for you, or check your main camera to see which policy it uses (perhaps the default which is HORIZONTAL). On the other hand, you might have to save your 3D points somewhere and reproject them when the window gets resized. You can either wire that in your resizeGL function, or you can add a ResizedCallback to your GraphicsContext (GraphicsWindow). It can be a pain to get everything match up correctly, but once you understand how things fit together it all makes sense. You may also want to place breakpoints and inspect the projection matrices (or the result of getProjectionMatrixAsOrtho(), which is easier to interpret :-) ) before and after the resize, and you'll understand what's going on. One page I like on the subject is http://www.songho.ca/opengl/gl_projectionmatrix.html it has nice diagrams, easy to read text and the math is well explained. 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