--- ray/src/cv/source.cal 1992/10/14 13:21:09 2.4 +++ ray/src/cv/source.cal 1993/12/09 16:58:03 2.7 @@ -3,9 +3,9 @@ { Source distribution coordinates (degrees). - Theta is measured from the negative z-axis, - phi is measured from the positive x-axis - according to the right-hand rule. + Theta is measured from the negative z-axis. + Phi is measured from the positive x-axis (0 degrees) + towards the negative y-axis (90 degrees). srcB_vert and srcB_horiz are angles used in type B photometry. @@ -14,9 +14,12 @@ with a rectangular box. lboxcorr provides a more accurate calculation for nearby surfaces, but requires that the source box be centered at the origin. + The dimensions of the box, which must be aligned with + the x,y,z axes, are given in meters regardless of the + units being used in the scene file. A1 - optional multipier - A2,A3,A4 - X,Y,Z dimensions of axis-aligned box + A2,A3,A4 - X,Y,Z dimensions of axis-aligned box (in meters!) } { local definitions } boxprojection = abs(Dx)*A3*A4 + abs(Dy)*A2*A4 + abs(Dz)*A2*A3; @@ -30,7 +33,7 @@ boxcorr(v) = A1 * v / boxprojection; { correction for lboxcorr(v) = A1 * v / lboxprojection; { local box correction } src_theta = Acos(Dz) / DEGREE; { 0-180 } -src_phi = mod( atan2(Dy, Dx) / DEGREE, 360 ); { 0-360 } +src_phi = mod( Atan2(Dy, -Dx) / DEGREE, 360 ); { 0-360 } { bilateral symmetry } src_phi2 = tri( src_phi, 180 ); { 0-180 } { quadrilateral symmetry }