ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/screen.cal
Revision: 1.1
Committed: Sat Feb 22 02:07:21 2003 UTC (21 years, 1 month 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 Uses gensurf to compute CRT geometry based on spherical assumption.
3
4 Author:
5 Greg Ward 11/13/95
6
7 Input:
8 w: screen width (total)
9 h: screen height (total)
10 d: displacement from center tangent at max. right or left
11
12 Usage:
13 gensurf mat name 'x(s,t)' 'y(s,t)' 'z(s,t)' N M -s \
14 -e 'w:{width};h:{height};d:{depth}' -f screen.cal
15
16 Output is oriented vertically, with the lower left corner at
17 (x,y,z)=(0,0,0), the lower right at (w,0,0), the upper right
18 at (w,0,h), and the screen bulge in the negative y direction.
19 Surface normals face negative y, also.
20 }
21 { compute sphere radius }
22 r : d/2 + w*w/8/d;
23 { compute x and z }
24 x(s,t) = w*s;
25 z(s,t) = h*t;
26
27 sq(x) : x*x;
28 { compute maximum depth (y) value }
29 dmax : sqrt(r*r - sq(w/2) - sq(h/2));
30 { compute y }
31 y(s,t) = dmax - sqrt(r*r - sq(w*s-w/2) - sq(h*t-h/2));