home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / NEWS / RADIANCE / LIB / BRICKWEA.CAL < prev    next >
Text File  |  1993-10-07  |  2KB  |  108 lines

  1. { file created by makewarp }
  2.  
  3. brickweave_u = if(brickweave_inbounds(Px,Py), brickweave_wu(Px,Py), Px) ;
  4. brickweave_v = if(brickweave_inbounds(Px,Py), brickweave_wv(Px,Py), Py) ;
  5.  
  6. brickweave_tile_u = brickweave_wu(mod(Px,brickweave_mu),mod(Py,brickweave_mv)) ;
  7. brickweave_tile_v = brickweave_wv(mod(Px,brickweave_mu),mod(Py,brickweave_mv)) ;
  8.  
  9. brickweave_match_u = brickweave_wu(tri(Px,brickweave_mu),tri(Py,brickweave_mv)) ;
  10. brickweave_match_v = brickweave_wv(tri(Px,brickweave_mu),tri(Py,brickweave_mv)) ;
  11.  
  12. brickweave_wu(u,v) =
  13.     linterp(frac(brickweave_iu(u)),
  14.         linterp(frac(brickweave_iv(v)),
  15.             brickweave_gu(floor(brickweave_iu(u)),floor(brickweave_iv(v))),
  16.             brickweave_gu(floor(brickweave_iu(u)),ceil(brickweave_iv(v)))
  17.         ), linterp(frac(brickweave_iv(v)),
  18.             brickweave_gu(ceil(brickweave_iu(u)),floor(brickweave_iv(v))),
  19.             brickweave_gu(ceil(brickweave_iu(u)),ceil(brickweave_iv(v)))
  20.         )
  21. ) ;
  22. brickweave_wv(u,v) =
  23.     linterp(frac(brickweave_iu(u)),
  24.         linterp(frac(brickweave_iv(v)),
  25.             brickweave_gv(floor(brickweave_iu(u)),floor(brickweave_iv(v))),
  26.             brickweave_gv(floor(brickweave_iu(u)),ceil(brickweave_iv(v)))
  27.         ), linterp(frac(brickweave_iv(v)),
  28.             brickweave_gv(ceil(brickweave_iu(u)),floor(brickweave_iv(v))),
  29.             brickweave_gv(ceil(brickweave_iu(u)),ceil(brickweave_iv(v)))
  30.         )
  31. ) ;
  32.  
  33. brickweave_iu(u) = 1 + 4 * u / brickweave_mu ;
  34. brickweave_iv(v) = 1 + 4 * v / brickweave_mv ;
  35.  
  36. brickweave_inbounds(u,v) = and( and( u, brickweave_mu - u),
  37.             and(v, brickweave_mv - v) ) ;
  38.  
  39. brickweave_mu = 1.000000 ;
  40. brickweave_mv = 1.000000 ;
  41.  
  42. brickweave_gu(i, j) = select( i,
  43.     select( j,
  44.         0.000000,
  45.         0.000000,
  46.         0.000000,
  47.         0.000000,
  48.         0.000000
  49.     ), select( j,
  50.         0.248322,
  51.         0.248322,
  52.         0.248322,
  53.         0.248322,
  54.         0.248322
  55.     ), select( j,
  56.         0.496644,
  57.         0.496644,
  58.         0.496644,
  59.         0.496644,
  60.         0.496644
  61.     ), select( j,
  62.         0.744966,
  63.         0.744966,
  64.         0.744966,
  65.         0.744966,
  66.         0.744966
  67.     ), select( j,
  68.         1.000000,
  69.         1.000000,
  70.         1.000000,
  71.         1.000000,
  72.         1.000000
  73.     )
  74. ) ;
  75. brickweave_gv(i, j) = select( i,
  76.     select( j,
  77.         1.000000,
  78.         0.751678,
  79.         0.503356,
  80.         0.255034,
  81.         0.000000
  82.     ), select( j,
  83.         1.000000,
  84.         0.751678,
  85.         0.503356,
  86.         0.255034,
  87.         0.000000
  88.     ), select( j,
  89.         1.000000,
  90.         0.751678,
  91.         0.503356,
  92.         0.255034,
  93.         0.000000
  94.     ), select( j,
  95.         1.000000,
  96.         0.751678,
  97.         0.503356,
  98.         0.255034,
  99.         0.000000
  100.     ), select( j,
  101.         1.000000,
  102.         0.751678,
  103.         0.503356,
  104.         0.255034,
  105.         0.000000
  106.     )
  107. ) ;
  108.