"CAD-Andi" <nomail@nomail> wrote:
> Hi all!
> I'm investigating Paul Bourke's approach to project povray generated images onto
> a dome screen.
> I found the source code for his implementation of an "offaxis fisheye camera"
> for povray.
> (See: http://ozviz.wasp.uwa.edu.au/~pbourke/modelling_rendering/povcameras/).
> I'm not a full blown programmer and don't know much about compiling. I'm
> working with MegaPOV and Povray for Windows 2000 and also Povray for OSX. Can
> anyone help?
This is the source code that Paul came up with.
pdb - Offset fisheye for planetariums with a shifted sweet spot.
Essentially just translates the view vector in the plane of the
// Normalised coodinates
x0 = 2.0 * x / (DBL)Frame.Screen_Width - 1.0;
y0 = 2.0 * ((DBL)(Frame.Screen_Height - 1) - y) / (DBL)Frame.Screen_Height
// If the pixel lies outside the unit circle no ray is traced.
if ((rad = sqrt(x0 * x0 + y0 * y0)) > 1.0)
// Fisheye polar coordinates
theta = atan2(y0,x0); // -pi .. pi
phi = 0.5 * rad * Frame.Camera->Angle * M_PI_180; // 0 .. aperture/2
// My own unit vector versions
V1 = sin(phi)*cos(theta) - Frame.Camera->Fish_XOffset;
V1 = sin(phi)*sin(theta) - Frame.Camera->Fish_YOffset;
V1 = cos(phi);
I can't compile this myself. Is there any other solution that makes it possible
to create off-axis fisheye projection?
Post a reply to this message