ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/ambpos.cal
(Generate patch)

Comparing ray/src/util/ambpos.cal (file contents):
Revision 2.3 by greg, Thu May 1 03:00:59 2014 UTC vs.
Revision 2.4 by greg, Wed Sep 3 14:05:55 2014 UTC

# Line 2 | Line 2
2   {
3          Compute patterns for ambient position markers
4   }
5 + odd(n) : .5*n - floor(.5*n) - .25;
6 + posangle(a) : if(-a, a + 2*PI, a) / DEGREE;
7   { Relative hit point }
8   rpx = Px - arg(1);
9   rpy = Py - arg(2);
# Line 19 | Line 21 | dirfunc = bound(0, 1 + dgrad, 2);
21   { Calculation of positional gradient pattern }
22   pgx = arg(4); pgy = arg(5); pgz = arg(6);
23   posfunc = bound(0, 1 + (pgx*rpx + pgy*rpy + pgz*rpz), 2);
24 +                                { corral flags and associated pattern }
25 + ux = arg(4); uy = arg(5); uz = arg(6);
26 + cflags = arg(7);
27 + vx = Ny*uz - Nz*uy;
28 + vy = Nz*ux - Nx*uz;
29 + vz = Nx*uy - Ny*ux;
30 + cflg(i) = if(odd(floor( cflags / 2^i )), 1, -1);
31 + corralled = cflg(floor(32/360*posangle(
32 +                atan2(rpx*vx+rpy*vy+rpz*vz, rpx*ux+rpy*uy+rpz*uz) )));
33  
34   { Calculation of ellipse stencil for base }
35   usx = arg(4); usy = arg(5); usz = arg(6);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines