ODSP (Omni Directional Stereoscopic Panorama) Cylindrical Camera for PovRayWritten by Paul BourkeOctober 2025
The following describes how to implement an ODSP (Omni Directional Stereoscopic Panorama) cylindrical camera in Povray version 3.8. In particular, the type of ODSP panorama required for a cylindrical display that is stereoscopic capable. The details of an ODSP cylindrical panorama will not be described, details can be found here and physical camera methods here. The particular display being developed for is an LED based 360 cylinder, approximately 8m in diameter and 4m high. The resolution is 12816 pixels around the circumference and 2048 pixels high, each pixel approximately 2mm pitch. The vertical field of view is therefore 2*atan(pi*2048/12816) = 53.3 degrees.
A bit of history ...
The fundamental requirement for a raytracer camera is to be able to define an origin and direction for each pixel in the final image. For many camera types, like a standard perspective camera, the origin for each ray is identical and the direction vectors diverge from that position. For an orthographic camera the origin for each ray is different (they all lie on a plane) and the direction vectors are all identical. For an ODSP camera both the ray origin and direction vector vary across the panorama image. At the time of writing Povray 3.8 is still in beta, but it has an extremely powerful camera type called "user_defined". This camera type allows one to specify exactly the origin and direction vector for each pixel. The equations can be seen in the code below.
#version 3.8;
/*
Experiment with ODSP (cylindrical) using PovRay user_defined camera in version 3.8
Designed and tested on the Baptist University LED cylinder in Hong Kong: 8m diameter, 4m high
Deals with left and right eye separately, suggest ffmpeg to create top/bottom arrangement
Handles positioning of zero parallax, typically at screen distance or infinity
Supports both a left and right handed coordinate system
The camera rig can be panned in order to set where "front" (y axis) corresponds to in the panorama
All length units in meters
*/
#declare CYLRADIUS = 4.0;
#declare CYLHEIGHT = 4.0;
#declare ODSP_camerax = 0; // View position
#declare ODSP_cameray = 0;
#declare ODSP_cameraz = CYLHEIGHT/2;
#declare ODSP_eyesep = 0.065/2; // Half the eye separation
#declare ODSP_handed = -1; // 1 for left, -1 for right
#declare ODSP_whicheye = -1; // -1 for left, 1 for right, 0 for center
#declare ODSP_vfov = 2*atan(pi*image_height/image_width); // Based on image dimensions not cyclinder dimensions
#declare ODSP_parallax = 4.0; // Distance to zero parallax
// Set to very large number for infinity
#declare ODSP_parangle = atan(ODSP_eyesep / ODSP_parallax); // Rotation angle to set zero parallax
#declare ODSP_panangle = 180*pi/180; // Pan the camera rig
// Mostly to control where "front" is on the panorama
// ODS cylindrical panorama
camera {
user_defined
location {
function { ODSP_camerax + ODSP_whicheye * ODSP_eyesep * cos(x * 2*pi + ODSP_panangle) * ODSP_handed }
function { ODSP_cameray + ODSP_whicheye * ODSP_eyesep * sin(x * 2*pi + ODSP_panangle) }
function { ODSP_cameraz }
}
direction {
function { sin(x * 2*pi - ODSP_whicheye * ODSP_parangle + ODSP_panangle) * ODSP_handed }
function { -cos(x * 2*pi - ODSP_whicheye * ODSP_parangle + ODSP_panangle) }
function { y * 2 * tan(0.5 * ODSP_vfov) }
}
}
The above is based upon the conventions illustrated in the following. Note the the author typically defines "up" as the z axis, different coordinate based up vectors simply require a swapping of the order of the functions. For these types of displays an arbitrary up vector is generally not a good idea since there is already a physical sense of "up", but it could readily be implemented in the camera or by tilting the scene.
Creating stereoscopic views that convey correct scale and depth, and don't place undue stress on the human visual system, requires a precise and careful attention to the camera model. A test scene is supplied theworld.inc with objects at known positions and of known dimensions such that the ODSP camera model and resulting images can be checked. In particular the scene elements have the following features.
For example, the following are the resulting stereo pair when the zero parallax distance is set to infinity. The full resolution images are supplied so that the features as documented can be verified. ![]()
The following checks can be performed.
In the following the zero parallax distance is set to 4m, the radius of the cylindrical display used for this exercise. ![]()
The following checks can be performed.
|