Advertisement
Guest User

Saucer 3D source code

a guest
Mar 27th, 2010
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Render with these flags: +fn +kff40 +kc +w80 +h60
  2.  
  3. // perspective (default) camera
  4. camera {
  5.   location  <0.0, 0.5, -3.0>*0.75
  6.   look_at   <0.0, 0.0,  0.0>
  7.   right     x*image_width/image_height
  8. }
  9.  
  10. // set a color of the background (sky)
  11. background {
  12.   color rgb 1
  13. }
  14.  
  15. // create a regular point light source
  16. light_source {
  17.   0*x                  // light's position (translated below)
  18.   color rgb <1,0.75,0.25>*1    // light's color
  19.   translate <0, -10, 0>
  20. }
  21. light_source {
  22.   0*x                  // light's position (translated below)
  23.   color rgb <0.25,0.75,1>*1    // light's color
  24.   translate -<0, -10, 0>
  25. }
  26.  
  27. #macro Hemisphere(Offset)
  28. difference {
  29.     sphere {
  30.         0, 1
  31.     }
  32.     box {
  33.         <-1,-1,-1>,
  34.         <1,Offset,1>
  35.     }
  36.     translate -Offset*y
  37. }
  38. #end
  39.  
  40.  
  41. union {
  42.     object {
  43.         Hemisphere(0.6)
  44.         scale 0.5*y
  45.     }
  46.     object {
  47.         Hemisphere(0.6)
  48.         scale 0.5*y
  49.         rotate 180*z                                                      
  50.     }
  51.     object {                                                                              
  52.         Hemisphere(0.5)
  53.         scale 0.425
  54.         translate 0.16*y
  55.     }
  56.     pigment {
  57.         color rgb 1
  58.     }
  59.     finish {
  60.             ambient 0.5
  61.     }
  62.     rotate 15*x
  63.     rotate 360*y*(clock+pow(sin(clock*pi/2),2))/2
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement