home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / raytrace / radiance / lib / weave.cal < prev    next >
Encoding:
Text File  |  1988-04-15  |  412 b   |  14 lines

  1. {
  2.     weave.cal - function for simple diagonal weave pattern
  3.             on horizontal surface.
  4.     
  5.     A1 is weave square size.
  6. }
  7.  
  8. weave = fade( f_weave(frac((Px+Pz)/1.4142/A1),frac((Px-Pz)/1.4142/A1)),
  9.                         0.7, T/A1/5);
  10.  
  11. f_weave(m1,m2) = if (m1-.5, if (m1-.55, f_weave(m2,1.05-m1), .1),
  12.          if (m2-.5, if (m2-.55, f_weave(1.05-m2,m1), .1),
  13.     if (m1-.05, if (m2-.25, if (m2-.3, .5, .1), if (m2-.05, 1, .1)), .1)));
  14.