ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cv/source.cal
(Generate patch)

Comparing ray/src/cv/source.cal (file contents):
Revision 1.1 by greg, Thu Aug 22 08:43:46 1991 UTC vs.
Revision 2.7 by greg, Thu Dec 9 16:58:03 1993 UTC

# Line 3 | Line 3
3   {
4          Source distribution coordinates (degrees).
5  
6 <        Theta is measured from the negative z-axis,
7 <        phi is measured from the positive x-axis
8 <        according to the right-hand rule.
6 >        Theta is measured from the negative z-axis.
7 >        Phi is measured from the positive x-axis (0 degrees)
8 >                towards the negative y-axis (90 degrees).
9  
10          srcB_vert and srcB_horiz are angles
11          used in type B photometry.
12  
13 <        A1      - optional multipier
13 >        boxcorr function corrects for distribution modeled
14 >        with a rectangular box.  lboxcorr provides a more
15 >        accurate calculation for nearby surfaces, but requires
16 >        that the source box be centered at the origin.
17 >        The dimensions of the box, which must be aligned with
18 >        the x,y,z axes, are given in meters regardless of the
19 >        units being used in the scene file.
20 >
21 >        A1              - optional multipier
22 >        A2,A3,A4        - X,Y,Z dimensions of axis-aligned box (in meters!)
23   }
24 +                                        { local definitions }
25 + boxprojection = abs(Dx)*A3*A4 + abs(Dy)*A2*A4 + abs(Dz)*A2*A3;
26 + lboxprojection = (      noneg(abs(Px-Dx*Ts)-A2/2)*A3*A4 +
27 +                        noneg(abs(Py-Dy*Ts)-A3/2)*A2*A4 +
28 +                        noneg(abs(Pz-Dz*Ts)-A4/2)*A2*A3 ) / Ts;
29  
30   flatcorr(v) = corr(v) / Rdot;           { correction for flat sources }
31   corr(v) = if(AC-.5, A1*v, v);           { multiplier correction }
32 + boxcorr(v) = A1 * v / boxprojection;    { correction for emitting box }
33 + lboxcorr(v) = A1 * v / lboxprojection;  { local box correction }
34  
35   src_theta = Acos(Dz) / DEGREE;                  { 0-180 }
36 < src_phi = norm_deg( atan2(Dy, Dx) / DEGREE );   { 0-360 }
36 > src_phi = mod( Atan2(Dy, -Dx) / DEGREE, 360 );  { 0-360 }
37                                  { bilateral symmetry }
38   src_phi2 = tri( src_phi, 180 );         { 0-180 }
39                                  { quadrilateral symmetry }
40   src_phi4 = tri( src_phi, 90 );          { 0-90 }
41  
26 norm_deg(d) : if( d, d, d+360 );
27
42                                  { Type B photometry coordinates }
43   srcB_vert = atan( -Dx/Dz ) / DEGREE;
44   srcB_horiz = Asin(Dy) / DEGREE;
45 <                                { w/ bilateral symmetry }
45 >                                { w/ symmetry }
46 > srcB_vert2 = abs( srcB_vert );
47   srcB_horiz2 = abs( srcB_horiz );

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines