ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/tmesh.cal
Revision: 2.1
Committed: Mon Mar 10 19:38:19 2003 UTC (21 years, 1 month ago) by greg
Branch: MAIN
CVS Tags: rad3R5
Log Message:
Moved tmesh.* files to library and fixed another compile error

File Contents

# Content
1 { RCSid: $Id$ }
2 {
3 Interpolate triangle-mesh values using barycentric coordinates.
4
5 A1 = Major axis (0==X, 1==Y, 2==Z)
6 A2 through A10 = Surface normal perturbation matrix
7 or:
8 A2 through A7 = Lookup in 2-dimensional pattern or texture
9 }
10 { Get dominant coordinates }
11 bu = select(arg(1)+1, Py, Pz, Px);
12 bv = select(arg(1)+1, Pz, Px, Py);
13 { Compute variables }
14 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 { 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;