ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/vwparab.cal
Revision: 1.2
Committed: Sun Feb 24 23:04:44 2008 UTC (16 years, 2 months ago) by greg
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad4R2P2, rad5R0, rad5R1, rad4R2, rad4R1, rad4R0, rad3R9, rad4R2P1, rad5R3, HEAD
Changes since 1.1: +3 -2 lines
Log Message:
Created planisphere (stereographic) fisheye projection

File Contents

# User Rev Content
1 greg 1.2 { RCSid $Id$ }
2 greg 1.1 {
3     Generate rays for a parabolic view projection --
4     i.e., a round image that when projected downwards
5     in parallel onto a parabolic reflector results in
6     a panoramic view from the paraboloid's focal point.
7    
8     The forward view direction corresponding to the top
9     of the image is always +Y, and the up direction is
10     always +Z.
11    
12     9/8/98 Greg Ward Larson
13    
14     Inputs:
15     maxalt : Maximum altitude (in degrees)
16     x, y = Image position, (0,0)->(1,0) is LL->LR
17    
18     Outputs:
19     dx, dy, dz = Direction vector for image point (x,y)
20    
21     Typical command line:
22 greg 1.2 cnt 1024 1024 | rcalc -od -e maxalt:25 \
23 greg 1.1 -e 'x=($2+.5)/1024;y=1-($1+.5)/1024' -f vwparab.cal \
24     -e '$1=25.5;$2=12;$3=5;$4=dx;$5=dy;$6=dz' \
25 greg 1.2 | rtrace @electric.opt -fdc -x 1024 -y 1024 \
26 greg 1.1 electric.oct > pan.pic
27     }
28     amax : PI/180*maxalt;
29     F0 : .5/cos(amax) - .5*tan(amax); { dist. btwn. parabola and directrix }
30     xr = 2*x - 1;
31     yr = 2*y - 1;
32     r2 = xr*xr + yr*yr;
33     r = sqrt(r2); { never actually needed }
34     z = r2/(4*F0) + F0;
35     zo = r2/(4*F0) - F0;
36     sin_alt = zo/z;
37     cos_alt = r/z;
38     dx = xr/z; { same as xr/r*cos_alt }
39     dy = yr/z; { same as yr/r*cos_alt }
40     dz = zo/z; { same as sin_alt }