home *** CD-ROM | disk | FTP | other *** search
/ Photo CD Demo 1 / Demo.bin / graphtal / examples / trwthtxt.lsy < prev   
Text File  |  1992-11-02  |  1KB  |  44 lines

  1. /*
  2.  * Tree model from the book 'The algorithmic beauty of plants'
  3.  * by P. Prudinkiewicz and A. Lindenmayer, p. 60.
  4.  *
  5.  * Texture is added to the trunk. Textures appear together
  6.  * with the rayshade driver only!
  7.  *
  8.  *  30.10.92  Christoph Streit (streit@iam.unibe.ch)
  9.  */
  10.  
  11.  
  12. lsystem TreeWithTexture;
  13.  
  14. table Tree 
  15. {
  16.   const d1 = 180.5;
  17.         d2 = 252.5;
  18.         a  = 36.0;
  19.         lr = 1.070;
  20.         vr = 1.732; 
  21.  
  22.  A(n) : n < 4 -> wi(vr) F(50) 
  23.                  [ pt(a) F(50) A(n+1) ] ro(-d1)
  24.                  [ pt(a) F(50) A(n+1) ] ro(-d2)
  25.                  [ pt(a) F(50) A(n+1) ];
  26.  A(n) : n >=4 -> texture("") wi(vr) F(50) // diable texture
  27.                  [ pt(a) F(50) A(n+1) ] ro(-d1)
  28.                  [ pt(a) F(50) A(n+1) ] ro(-d2)
  29.                  [ pt(a) F(50) A(n+1) ];
  30.  F(l)  -> F(l*lr);
  31.  wi(w) -> wi(w*vr); 
  32. };
  33.  
  34. attributes {
  35.   axiom co("SandyBrown") 
  36.         texture("texture bump 0.9 scale 1 4 12 " +
  37.                "texture gloss 0.65") 
  38.     wi(1) F(200) ro(-45) A(1);
  39.  
  40.   derivation Tree(6);
  41.  
  42.   coneres 5;
  43. };
  44.