ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cv/tmesh.cal
Revision: 2.3
Committed: Wed Jun 15 15:07:05 1994 UTC (30 years, 11 months ago) by greg
Branch: MAIN
Changes since 2.2: +6 -11 lines
Log Message:
further reduced complexity and size of barycentric calculation

File Contents

# User Rev Content
1 greg 2.1 { SCCSid "$SunId$ LBL" }
2    
3     {
4     Interpolate triangle-mesh values using barycentric coordinates.
5    
6 greg 2.2 A1 = Major axis (0==X, 1==Y, 2==Z)
7 greg 2.3 A2 through A10 = Surface normal perturbation matrix
8 greg 2.1 or:
9 greg 2.3 A2 through A7 = Lookup in 2-dimensional pattern or texture
10 greg 2.1 }
11 greg 2.3 { Get dominant coordinates }
12 greg 2.2 bu = select(arg(1)+1, Py, Pz, Px);
13     bv = select(arg(1)+1, Pz, Px, Py);
14 greg 2.1 { Compute variables }
15 greg 2.3 v1 = bu*arg( 2) + bv*arg( 3) + arg( 4);
16     v2 = bu*arg( 5) + bv*arg( 6) + arg( 7);
17     v3 = bu*arg( 8) + bv*arg( 9) + arg(10);
18 greg 2.1 { Surface normal perturbation }
19     nf = 1/sqrt(v1*v1 + v2*v2 + v3*v3);
20     dx = v1*nf - Nx;
21     dy = v2*nf - Ny;
22     dz = v3*nf - Nz;
23     { Lookup table index }
24     u = v1;
25     v = v2;