Alexander, By moving the corners of the frustum, are you wanting to tweak the frustum corners so that they have different depths (i.e. tilt the near plane so that it is no longer orthogonal to the eye)? I don't think OGL (and hence OSG) will allow you to do this directly. There is a "munge" that may allow you to effectively specify an oblique near clipping plane to give you the effect you're looking for. Check out the link http://www.terathon.com/gdc07_lengyel.pdf. Pay particular attention to the last part of the presentation.
If you want to do distortion correction, you can resort to another technique other than just using the projection matrix. One way to do this is to use a two-pass solution whereby you render to texture and then distort the texture coordinates at "small" increments before rendering to an on-screen buffer. I think the first link I sent you last week talks about this. There are other ways to do the distortion correction as well such as shaders, etc. -Shayne -----Original Message----- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Alexander Dieterle Sent: Monday, May 09, 2011 3:18 AM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Manual perspective distortion? Good morning everyone, I hope everyone of you had a nice and enjoyable weekend? Here in Germany it was brilliant weather, in addition, yesterday was mother's day so we had a very enjoyable time with the family - hope the same for you! :) Anyways - first off, thank you all very much for your answers. Torben, I did read into your code on Friday and, from a first glance at it, it seems like a possible solution for the problem. I think the perfect way to create that matrix would be by using a camera and creating the distortion pixel map by analysing the offset dynamically via the camera image. It's a quite complex way to do it, but the result should be quite good - however, if I can't find a student to write his bachelor thesis on that, I fear there won't be resources available to do it ;) Shayne, thank you very much - the links you offered perfectly describe the issues I'm dealing with. If I understand you right, I am already tweaking the frustum to calibrate the viewing area by using setProjectionMatrixAsFrustum(left, right, bottom, top, near, far); . The problem with this method is that by using each of those parameters I can only move an entire border of the projection area - so the entire left, right, bottom or top border of the frustum. This allows me to adjust the frustum such that it does fit into the projection screen; however, it does not help at all against the distortion in the image. To do so, I had to be able to move the corners of the frustum individually, and that's something I don't quite know how to do it. I'll read into the paper more deeply and will let you know if it could help me any further. Have a great start in the new week! -Alex ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39189#39189 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org