ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cv/tmesh.cal
Revision: 2.5
Committed: Mon Mar 10 19:38:19 2003 UTC (22 years, 2 months ago) by greg
Branch: MAIN
CVS Tags: HEAD
Changes since 2.4: +1 -1 lines
State: FILE REMOVED
Log Message:
Moved tmesh.* files to library and fixed another compile error

File Contents

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