ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/test/renders/diskcoords.cal
(Generate patch)

Comparing ray/test/renders/diskcoords.cal (file contents):
Revision 1.1 by greg, Fri Nov 30 17:49:59 2018 UTC vs.
Revision 1.2 by greg, Sat Dec 1 02:06:05 2018 UTC

# Line 4 | Line 4
4  
5          Assumes material in X-Y plane with Y axis "up" and surface normal is Z-axis
6   }
7 Up(i) = arg(AC-3+i);    { up vector does not need to be normalized }
8 Vux = cross(1,Up,N);
9 Vuy = cross(2,Up,N);
10 Vuz = cross(3,Up,N);
11 vnorm = 1/sqrt(Vux*Vux + Vuy*Vuy + Vuz*Vuz);
12 Vnx = Vux*vnorm;
13 Vny = Vuy*vnorm;
14 Vnz = Vuz*vnorm;
15 Vn(i) = select(i, Vnx, Vny, Vnz);
16 Unx = cross(1,N,Vn);
17 Uny = cross(2,N,Vn);
18 Unz = cross(3,N,Vn);
19                        { Transform vectors, normalized (dx,dy,dz) away from surf }
20 surf_dx(dx,dy,dz) = dx*Unx + dy*Uny + dz*Unz;
21 surf_dy(dx,dy,dz) = dx*Vnx + dy*Vny + dz*Vnz;
22 surf_dz(dx,dy,dz) = dx*Nx + dy*Ny + dz*Nz;
23
24 inc_dx = surf_dx(-Dx,-Dy,-Dz);
25 inc_dy = surf_dy(-Dx,-Dy,-Dz);
26 inc_dz = Rdot;
7                          { Compute square position from disk coordinates }
8   norm_radians(p) : if(-p - PI/4, p + 2*PI, p);
9   idr(idx,idy) = sqrt(idx*idx + idy*idy);
# Line 46 | Line 26 | square_b(idr,idp) = select(idrgn(idp),
26   square_x(idx,idy) = (square_a(idr(idx,idy),idp(idx,idy)) + 1)/2;
27   square_y(idx,idy) = (square_b(idr(idx,idy),idp(idx,idy)) + 1)/2;
28  
29 < inc_sqx = square_x(-inc_dx,-inc_dy);    { Negative because of Klems reversal }
30 < inc_sqy = square_y(-inc_dx,-inc_dy);
29 > inc_sqx = square_x(-Idx,-Idy);          { Negative because of Klems reversal }
30 > inc_sqy = square_y(-Idx,-Idy);
31  
32   sqx_in(sx,sy,sz) = inc_sqx;             { Only a function of incident ray direction }
33   sqy_in(sx,sy,sz) = inc_sqy;
34  
35 < sqx_out(sx,sy,sz) = square_x(surf_dx(sx,sy,sz),surf_dy(sx,sy,sz));
36 < sqy_out(sx,sy,sz) = square_y(surf_dx(sx,sy,sz),surf_dy(sx,sy,sz));
35 > sqx_out(sx,sy,sz) = square_x(Ldx(sx,sy,sz),Ldy(sx,sy,sz));
36 > sqy_out(sx,sy,sz) = square_y(Ldx(sx,sy,sz),Ldy(sx,sy,sz));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines