ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/landscape.cal
Revision: 1.1
Committed: Sat Feb 22 02:07:21 2003 UTC (21 years, 2 months ago) by greg
Branch: MAIN
CVS Tags: rad5R2, rad4R2P2, rad5R0, rad5R1, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R5, rad3R6, rad3R6P1, rad3R8, rad3R9, rad4R2P1
Log Message:
Changes and check-in for 3.5 release
Includes new source files and modifications not recorded for many years
See ray/doc/notes/ReleaseNotes for notes between 3.1 and 3.5 release

File Contents

# Content
1 {
2 A set of randomly located points at known positions to be
3 interpolated by gensurf.
4 }
5 { The following are our known point values }
6 point(i,j) = select( i*3+j+1,
7 2, 1, 5, { x0, y0, z0 }
8 3.7, 1, 1,
9 4.2, 2.5, 2,
10 3,7, 2.5, 4,
11 2, 2.5, 3,
12 2, 3.5, 2
13 );
14
15 Npoints = 6; { Number of points in above }
16
17 sq(x) : x*x;
18
19 Recip(x) : if( x, 1/x, 1e10 );
20
21 Sum(f,x,y,n) = if(n-.5, f(x,y,n-1)+Sum(f,x,y,n-1), 0);
22
23 weight(x,y,i) = Recip(sq(x-point(i,0)) + sq(y-point(i,1)));
24
25 wval(x,y,i) = weight(x,y,i) * point(i,2);
26
27 sheight(x,y) = Sum(wval,x,y,Npoints) / Sum(weight,x,y,Npoints);