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

Comparing ray/src/util/disk2square.cal (file contents):
Revision 2.2 by greg, Tue Jul 22 23:21:56 2014 UTC vs.
Revision 2.3 by greg, Fri Jul 25 16:58:20 2014 UTC

# Line 65 | Line 65 | out_square_y = (out_square_b + 1)/2;
65          The following forumulas compute Shirley-Chiu bin "scbin" based on:
66  
67          Dx,Dy,Dz        - Incident direction (normalized, towards surface front)
68 <        Nx,Ny,Nz        - Surface normal (normalized, away from surface)
68 >        rNx,rNy,rNz     - Surface normal (normalized, away from surface)
69          Ux,Uy,Uz        - Up direction vector (does not need to be normalized)
70  
71          The SCdim variable assigns the square side dimension for bins, which are
# Line 73 | Line 73 | out_square_y = (out_square_b + 1)/2;
73   }
74  
75                                  { Compute oriented axis values }
76 < inc_dz = -Dx*Nx-Dy*Ny-Dz*Nz;
77 < inc_rx = -Dx*(Uy*Nz-Uz*Ny) - Dy*(Uz*Nx-Ux*Nz) - Dz*(Ux*Ny-Uy*Nx);
78 < inc_ry = -Dx*Ux-Dy*Uy-Dz*Uz - inc_dz*(Nx*Ux+Ny*Uy+Nz*Uz);
76 > inc_dz = -Dx*rNx-Dy*rNy-Dz*rNz;
77 > inc_rx = -Dx*(Uy*rNz-Uz*rNy) - Dy*(Uz*rNx-Ux*rNz) - Dz*(Ux*rNy-Uy*rNx);
78 > inc_ry = -Dx*Ux-Dy*Uy-Dz*Uz - inc_dz*(rNx*Ux+rNy*Uy+rNz*Uz);
79   inc_den2 = inc_rx*inc_rx + inc_ry*inc_ry;
80 < inc_radf = if(inc_den2-1e-7, sqrt((1 - inc_dz* inc_dz)/inc_den2), 0);
80 > inc_radf = if(inc_den2-1e-7, sqrt((1 - inc_dz*inc_dz)/inc_den2), 0);
81                                  { Pass to formulas in first section }
82   in_disk_x = inc_rx*inc_radf;
83   in_disk_y = inc_ry*inc_radf;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines