home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / formats / ttddd / spec / t3d_doc / igensurf.zoo / examples / mountain.cal < prev    next >
Text File  |  1991-09-27  |  756b  |  28 lines

  1. {
  2.     mountain.cal: Create a 'mountain' landscape
  3.  
  4.     igensurf -v -s 30 -t 30 mountain.cal | writetddd >mountain.obj
  5.  
  6.     In this example, the noise functions is used to modify an otherwise
  7.     simple surface.
  8.  
  9.     Three color functions are defined to add some color to the landscape.
  10. }    
  11.  
  12. #name  mountain
  13. #color on
  14.  
  15. x_scale    : 300.0;        { Scale factor for the x axis }
  16. y_scale    : 300.0;        { Scale factor for the y axis }
  17. z_scale    : 100.0;        { Scale factor for the z axis }
  18.  
  19. x(u,v) = x_scale * u;
  20. y(u,v) = y_scale * v;
  21. z(u,v) = z_scale * (fnoise3(3*u,3*v,0) + 1);
  22.  
  23. { Color functions: Let top be white, and everything else green }
  24.  
  25. cr(u,v,x,y,z) = if (1.5 * z_scale - z, .2, .9);
  26. cg(u,v,x,y,z) = if (1.5 * z_scale - z, .9, .9);
  27. cb(u,v,x,y,z) = if (1.5 * z_scale - z, .2, .9);
  28.