Sphere MapperWritten by Paul Bourke
The following derives warping meshes for projecting fisheye images into a hemispherical dome such that the resulting images look "correct" for an observer on the outside of the dome, that is, on the right side of the diagram below. "Correct" is taken to mean that if one were to project lines of longitude and latitude then they would appear as expected as one looked at the dome from different directions. Note that as described above the images would also look correct for an observer at the center of the dome, except they would be casting a shadow.
The mapping is achieved by simulating the geometry of the situation, tracing rays through mesh points on the projectors image space, and finding where those rays strike the inside surface of the sphere. Once this point on the dome is found the fisheye coordinates can be calculated which in turn determines the texture coordinates for the mesh point. The mesh is saved in the same format used by the author for realtime warping of images for the iDome and planetariums. These mesh files are being used in the warpplayer software, Unity3D game engine, Blender game, Software Bisque, and many other packages.Sample input image
Warped image examples given specifications on top left of image