Hi Roy,

What you are looking to do is called distortion correction - you are
correcting for distortion created by projecting an image onto a curved
surface.  Doing distortion correct is rather advanced OSG/graphics
usage, and not something I'd recommend for a beginner.

To do this correction you'll need to compute the mapping between the
coordinate frame of the projector and that of the display surface, and
set up the OSG so that it renders the normal 3D scene into a texture
(using a frame buffer object) and then using this texture to render a
rectangular distortion mesh that uses texture coordinates that provide
the appropriate distortion correction.

The osgdistortion example and the implementation of
View::setUpViewAs3DSphericalDisplay(..)  provides code that implements
both the render to texture setup and the texture coordinate setup to
provide distortion correction.  The setUpViewAs3DSphericalDisplay()
provides code for a full spherical display such as a PufferFish
display, and is probably overkill for what you need - it creates 6
render to texture cameras to render the full 360 surround view,
rendering to a texture cube map, then uses the cube map texture when
rendering the final distortion mesh.  If you are using less than 160
degree wide projection you can probably get away with a single render
to texture camera.

How to fit this around FlightGear will depend upon how cleanly it
integrates with osgViewer.

As said above, this is an advanced topic, and teaching you all that is
required will potentially take a lot of time and effort, so I will
have to gracefully bow out from hand holding your through this
experiment as I have lots of other work and users to support.

Robert.

On 14 February 2012 01:47, Roy Caligan <[email protected]> wrote:
> Hi everyone,
>
> I've been speaking with some of the folks on the FlightGear forum about a 
> problem I'm having, and I was recommended to contact this group for some 
> help. I'm trying to project an image onto a curved screen using a video 
> projector and a hemispherical mirror. Basically, images are applied to a 
> texture, then applied to a warped matrix, and then displayed.
>
> The author of those papers was kind enough to share his code libraries with 
> me, too. Unfortunately, the board says I need to make two posts before 
> posting URLs. So as soon as I get there, I'll post the links to the libraries.
>
> The problem, however, is that the code is written for OpenGL, not OSG. I've 
> been told that OSG does something similar using the Anaglyph 3D support, but 
> I'm not sure how to implement it. I'm not a programmer, but I'm willing to 
> learn and do as much as I can just so I can get this to work.
>
> Any help or advice will be greatly appreciated!
>
> Thanks,
>
> Roy
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=45458#45458
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to