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.3 by greg, Fri Jul 25 16:58:20 2014 UTC vs.
Revision 2.4 by greg, Fri Mar 27 18:58:06 2015 UTC

# Line 64 | Line 64 | out_square_y = (out_square_b + 1)/2;
64   {
65          The following forumulas compute Shirley-Chiu bin "scbin" based on:
66  
67 +        RHS             - right-handed system (-1 for left-handed coords)
68          Dx,Dy,Dz        - Incident direction (normalized, towards surface front)
69          rNx,rNy,rNz     - Surface normal (normalized, away from surface)
70          Ux,Uy,Uz        - Up direction vector (does not need to be normalized)
# Line 71 | Line 72 | out_square_y = (out_square_b + 1)/2;
72          The SCdim variable assigns the square side dimension for bins, which are
73          ordered with the "up" direction changing fastest.
74   }
75 <
75 > RHS = 1;
76                                  { Compute oriented axis values }
77   inc_dz = -Dx*rNx-Dy*rNy-Dz*rNz;
78 < inc_rx = -Dx*(Uy*rNz-Uz*rNy) - Dy*(Uz*rNx-Ux*rNz) - Dz*(Ux*rNy-Uy*rNx);
78 > inc_rx = -RHS*(Dx*(Uy*rNz-Uz*rNy) + Dy*(Uz*rNx-Ux*rNz) + Dz*(Ux*rNy-Uy*rNx));
79   inc_ry = -Dx*Ux-Dy*Uy-Dz*Uz - inc_dz*(rNx*Ux+rNy*Uy+rNz*Uz);
80   inc_den2 = inc_rx*inc_rx + inc_ry*inc_ry;
81   inc_radf = if(inc_den2-1e-7, sqrt((1 - inc_dz*inc_dz)/inc_den2), 0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines