ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/ambpos.cal
Revision: 2.1
Committed: Thu Apr 24 23:15:42 2014 UTC (9 years, 11 months ago) by greg
Branch: MAIN
Log Message:
Deprecated genambpos and put new Perl script in its place

File Contents

# User Rev Content
1 greg 2.1 { RCSid $Id$ }
2     {
3     Compute patterns for ambient position markers
4     }
5     { Relative hit point }
6     rpx = Px - arg(1);
7     rpy = Py - arg(2);
8     rpz = Pz - arg(3);
9    
10     { Calculation of directional gradient pattern }
11     ndx = arg(4); ndy = arg(5); ndz = arg(6);
12     dgx = arg(7); dgy = arg(8); dgz = arg(9);
13     dg = sqrt(dgx*dgx + dgy*dgy + dgz*dgz);
14     dux = (ndy*dgz - ndz*dgy)/dg;
15     duy = (ndz*dgx - ndx*dgz)/dg;
16     duz = (ndx*dgy - ndy*dgx)/dg;
17     dsine = (dux*rpx + duy*rpy + duz*rpz)/sqrt(rpx*rpx + rpy*rpy + rpz*rpz);
18     dirfunc = bound(0, 1 + dg*dsine, 2);
19    
20     { Calculation of positional gradient pattern }
21     pgx = arg(4); pgy = arg(5); pgz = arg(6);
22     posfunc = bound(0, 1 + (pgx*rpx + pgy*rpy + pgz*rpz), 2);
23    
24     { Calculation of ellipse stencil for base }
25     usx = arg(4); usy = arg(5); usz = arg(6);
26     vsx = arg(7); vsy = arg(8); vsz = arg(9);
27     ellipstencil = if(1 - sq(usx*rpx + usy*rpy + usz*rpz) - sq(vsx*rpx + vsy*rpy + vsz*rpz),
28     1, 0);