ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cv/source.cal
Revision: 2.8
Committed: Fri Jul 25 12:08:06 1997 UTC (26 years, 8 months ago) by gregl
Branch: MAIN
Changes since 2.7: +7 -0 lines
Log Message:
eliminated use of "glow" type and applied boxcorr and new cylcorr

File Contents

# User Rev Content
1 greg 1.1 { SCCSid "$SunId$ LBL" }
2    
3     {
4     Source distribution coordinates (degrees).
5    
6 greg 2.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 greg 1.1
10     srcB_vert and srcB_horiz are angles
11     used in type B photometry.
12    
13 greg 2.2 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 greg 2.5 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 greg 2.2
21 gregl 2.8 cylcorr function provides the same correction for a
22     cylinder whose central axis is aligned with the Z-axis.
23    
24 greg 1.2 A1 - optional multipier
25 greg 2.5 A2,A3,A4 - X,Y,Z dimensions of axis-aligned box (in meters!)
26 gregl 2.8 or
27     A2,A3 - diameter and height of Z-aligned cylinder (meters)
28 greg 1.1 }
29 greg 1.2 { local definitions }
30     boxprojection = abs(Dx)*A3*A4 + abs(Dy)*A2*A4 + abs(Dz)*A2*A3;
31 greg 2.2 lboxprojection = ( noneg(abs(Px-Dx*Ts)-A2/2)*A3*A4 +
32     noneg(abs(Py-Dy*Ts)-A3/2)*A2*A4 +
33     noneg(abs(Pz-Dz*Ts)-A4/2)*A2*A3 ) / Ts;
34 gregl 2.8 cylprojection = A2*A3*sqrt(1-Dz*Dz) + PI/4*A2*A2*abs(Dz);
35 greg 1.1
36     flatcorr(v) = corr(v) / Rdot; { correction for flat sources }
37     corr(v) = if(AC-.5, A1*v, v); { multiplier correction }
38 greg 1.2 boxcorr(v) = A1 * v / boxprojection; { correction for emitting box }
39 greg 2.2 lboxcorr(v) = A1 * v / lboxprojection; { local box correction }
40 gregl 2.8 cylcorr(v) = A1 * v / cylprojection; { cylinder correction }
41 greg 1.1
42     src_theta = Acos(Dz) / DEGREE; { 0-180 }
43 greg 2.7 src_phi = mod( Atan2(Dy, -Dx) / DEGREE, 360 ); { 0-360 }
44 greg 1.1 { bilateral symmetry }
45     src_phi2 = tri( src_phi, 180 ); { 0-180 }
46     { quadrilateral symmetry }
47     src_phi4 = tri( src_phi, 90 ); { 0-90 }
48    
49     { Type B photometry coordinates }
50     srcB_vert = atan( -Dx/Dz ) / DEGREE;
51     srcB_horiz = Asin(Dy) / DEGREE;
52 greg 2.4 { w/ symmetry }
53     srcB_vert2 = abs( srcB_vert );
54 greg 1.1 srcB_horiz2 = abs( srcB_horiz );