ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/pdfblur.csh
Revision: 2.6
Committed: Tue Jan 18 01:37:43 2005 UTC (19 years, 3 months ago) by greg
Content type: application/x-csh
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad4R2P2, rad5R0, rad5R1, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R8, rad3R9, rad4R2P1, rad5R3, HEAD
Changes since 2.5: +7 -8 lines
Log Message:
Eliminated redundant specification of focal distance in pdfblur

File Contents

# Content
1 #!/bin/csh -f
2 # RCSid: $Id: pdfblur.csh,v 2.5 2003/02/22 02:07:27 greg Exp $
3 #
4 # Generate views for depth-of-field blurring on picture
5 #
6 if ($#argv != 3) then
7 echo "Usage: $0 aperture nsamp viewfile"
8 exit 1
9 endif
10 set a = "$1"
11 set n = "$2"
12 set vf = "$3"
13 cnt $n | rcalc -e `vwright i < $vf` \
14 -e "M:$n/5+1;a:$a/2;N:$n;" -e 'tmax:PI*a*(M+1)' \
15 -e 't=tmax/N*($1+rand($1))' \
16 -e 'theta=2*M*PI/(M-1)*(M-sqrt(M*M-(M-1)/(PI*a)*t))' \
17 -e 'r=a*(1-(M-1)/(2*M*M*PI)*theta)' \
18 -e 'rcost=r*cos(theta);rsint=r*sin(theta)' \
19 -e 'opx=ipx+rcost*ihx+rsint*ivx' \
20 -e 'opy=ipy+rcost*ihy+rsint*ivy' \
21 -e 'opz=ipz+rcost*ihz+rsint*ivz' \
22 -e 'os=is-rcost/(id*ihn);ol=il-rsint/(id*ivn)' \
23 -o 'VIEW= -vp ${opx} ${opy} ${opz} -vs ${os} -vl ${ol}'