ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/tregsrc.cal
Revision: 1.2
Committed: Wed Jul 1 00:39:34 2009 UTC (14 years, 9 months ago) by greg
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad4R2P2, rad5R0, rad5R1, rad4R2, rad4R1, rad4R0, rad4R2P1, rad5R3, HEAD
Changes since 1.1: +6 -4 lines
Log Message:
Added subdivided Tregenza sky patch files (Reinhart partitions)

File Contents

# Content
1 { RCSid $Id: tregsrc.cal,v 1.1 2005/06/15 17:46:08 greg Exp $ }
2 {
3 Tregenza patch positions & solid angles
4
5 Greg Ward June 2005
6
7 The Tregenza sky uses 145 patches, with patch 1 pointing due
8 North at the horizon, and continuing around to the East to
9 patch 30, which comprises the first altitude row (alt = 6 degrees).
10 Each successive row increases altitude by 12 degrees, with the
11 final altitude at the zenith (90 degrees). Azimuth is evenly
12 divided among 30, 30, 24, 24, 18, 12, 6, and 1 divisions per row.
13
14 Input is Tbin from 1-145 and optional random variables x1 & x2
15 Output is Dx Dy Dz theta (degree full angle of source)
16 }
17 DEGREE : PI/180;
18
19 x1 = .5; x2 = .5; { default random variable settings for midpoint }
20
21 Trow = if(30.5-Tbin, 1,
22 if(60.5-Tbin, 2,
23 if(84.5-Tbin, 3,
24 if(108.5-Tbin, 4,
25 if(126.5-Tbin, 5,
26 if(138.5-Tbin, 6,
27 if(144.5-Tbin, 7, 8) ) ) ) ) ) );
28
29 cols_row = select(Trow, 30, 30, 24, 24, 18, 12, 6, 1);
30
31 Tcol = Tbin - select(Trow, 0, 30, 60, 84, 108, 126, 138, 144);
32
33 Tazi_width = 2*PI / cols_row;
34
35 TAH : 12*DEGREE;
36
37 Tazi = (Tcol - .5 - x2)*Tazi_width;
38 Talt = (Trow - x1)*TAH;
39
40 Tomega = if(144.5-Tbin,
41 Tazi_width*(sin(TAH*Trow) - sin(TAH*(Trow-1))),
42 0.0344199465 );
43
44 cos_talt = cos(Talt);
45
46 Dx = sin(Tazi)*cos_talt;
47 Dy = cos(Tazi)*cos_talt;
48 Dz = sin(Talt);
49
50 theta = 2/DEGREE * acos(1 - Tomega/(2*PI));