home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / p / ply15dat.zip / SOMBFN.PI < prev    next >
Text File  |  1992-10-24  |  737b  |  33 lines

  1. // File demonstrating height field function
  2. // Polyray input file: Alexander Enzmann
  3.  
  4. // Set up the camera
  5. viewpoint {
  6.    from <0, 5, -8>
  7.    at <0, 0, 0>
  8.    up <0,1,0>
  9.    angle 40
  10.    resolution 256, 256
  11.    }
  12.  
  13. // Get various surface finishes
  14. include "..\colors.inc"
  15.  
  16. // Set up background color & lights
  17. background midnightblue
  18. light <10,10,-10>
  19.  
  20. // Define constants for the sombrero function
  21. define a_const 1.0
  22. define b_const 1.0
  23. define c_const 3.0
  24. define two_pi_a 2.0 * 3.14159265358 * a_const
  25.  
  26. // Define a diminishing cosine surface (sombrero)
  27. object {
  28.    height_fn 80, 80, -4, 4, -4, 4,
  29.       c_const * cos(two_pi_a * sqrt(x^2 + z^2)) *
  30.                 exp(-b_const * sqrt(x^2 + z^2))
  31.    shiny_red
  32.    }
  33.