[visionegg] Re: map singratings on cylinder

  • From: Andrew Straw <astraw@xxxxxxxxxxx>
  • To: visionegg@xxxxxxxxxxxxx
  • Date: Thu, 20 Dec 2007 15:23:35 +0100

Hi Kaspar,

I think the simplest way for now would be to approximate the cylindrical projection you need with N perspective projections in adjacent Viewports. For example, the left 100 pixels of your screen would be set up with one viewport, the next 100 pixels with another, and so on. All the viewports would be viewing the same Stimulus instance(s) and displaying on the same screen, just viewing different angles. You should be able to adjust the value of N to get acceptable projection error, and the rendering speed shouldn't be too bad. By the way - do you have optics that focus on such a screen? I'd be interested in hearing about them...

As far as SinGrating3D -- it should be working, but I noticed that it's not used in any of the demos, so it could have been broken for a long time without me noticing. I'll check on this. And I do think SinGrating3D is what you want to use with any kind of trick like the above. The initial suggestion I have is to make sure that the camera is actually looking at the stimulus. In the process of checking SinGrating3D, I'll create a demo, so hopefully this will be working in the next day or so...

Ultimately, the better approach to doing this type of this is what OpenSceneGraph does with their osgDistortion demo. Namely, render the image to a texture, and then distort that texture before sending the image to the display. I'm currently investigating these ideas, but I have no real implementation timeline that anyone should depend on.

Cheers!
Andrew

Kaspar Müller wrote:
Hi!

I would like to project singratings on a round screen, therefore I need to correct the distortion in such a way that the grating-bars have the same width everywhere. I tried to map singratings on a cylinder, but somehow the projections don't work. singrating3d doesn't work at all (is this class not supported anymore? I didn't find it in the visionegg library reference), and for singrating2d I didn't find out how to do it. I tried to change vertex coordinates in the gratings class, and I also tried to work with projections, but neither worked.

Unfortunately, I can't use the spheregrating class, since (1) I need colors, and (2) I need the projection the other way round (at the sides of the screen, the grating has to be narrower than in the center). The mapping function for the horizontal coordinates should be x'=R*tan(x/R), where R is the radius of the screen, x is the position where the ray would hit a flat screen and x' is the horizontal coordinate on the screen.

Any idea how I could manage this?

Thanks, Kaspar

======================================
The Vision Egg mailing list
Archives: //www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html


=====================================The Vision Egg mailing list
Archives: //www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html

Other related posts: