Charles has revised his formula for getting the warp map correct for projecting onto the dome. Use the following two images as a legend to follow his formula step by step below:

Projector and mirror diagram

Mirror and reflection onto dome diagram
And here is Charles’ new formula step by step:

line 1: l0 is the light vector coming from the projector out to a grid behind the mirror. G is a position vector on the grid. P0 is the point of projection.

line 2: l^0 is a unit vector, which is the vector divided by its magnitude. The magnitude of a vector is the square root of the sum of its component scalars squared. The unit vector is used in line 4.

line 3: c_global is the center of the mirror (if it were completely spherical), c is the position vector of the mirror centre relative to p0, the projector point.

line 4: x_local is the intersection of the light vector with the mirror. Its called x local because its still relative to the projection point p0. d is a scalar amount, l^0 is the unit vector. Trying to find the length of the vector where it hits the surface mirror .

line 5: d is defined by the following variation of the quadratic forumula: http://en.wikipedia.org/wiki/Line–sphere_intersection

line 6: defining the global position of x, the local position of which was found in line 4.

line 7: r_ is the vector from the centre to the surface of the mirror at x global.

line 8: f_ is the focal length. In spheres, the actual focal length is half the radius, multiplying it by the unit vector to get in three dimensions. focal lenght is used to determine the angle of reflection of the light


line 9&10: l_r is the reflected light vector

line 11: the unit vector, which we use to find where the reflected light hits the dome, similar to lines 4 and 6.

line 12: C_ is the centre of the dome. We need to find where it is, relative to where the reflected light hit the mirror.

line 13: X_local is where the reflected light hits the dome relative to the mirror intersection point. It is the scalar product of D and the unit vector l^r. D is defined in the next step

line 14: D is analogous to the formula used in line 5 to find d.

line 15: X_global is the global coordinates of where the light hits the dome, using X_local from line 13 and x_global from line 7.