home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / scripts / pov / jackodat / pumpkin.pov < prev    next >
Encoding:
Text File  |  1992-10-28  |  17.4 KB  |  492 lines

  1. // Persistence of Vision Raytracer
  2. /*
  3.  
  4.   DKB Script for a big ol' Halloween pumpkin!
  5.   Try your hand at carving it using a paint program, or better still,
  6.   using the DKB CSG commands!
  7.   By Dan Farmer Oct 8, 1990
  8.   Turned into a POV Jack-O-Lantern 
  9.   By Rob LaMoreaux Oct 8, 1992
  10.  
  11. */
  12.  
  13. //#include "basicsha.dat"
  14. #include "colors.inc"
  15. #include "textures.inc"
  16. #include "shapes.inc"
  17. #include "shapesq.inc"
  18. #include "hallway1.inc"
  19. #include "pumpdefs.inc"
  20.  
  21.  
  22. /* The correct camera */
  23. camera { /*Hint:for starters, make "Z" 5 times the largest sphere radius */ 
  24.     //location <0.0  75.0  -185.0>
  25.     location <CAMERAX CAMERAY CAMERAZ >
  26.     direction <0.0 0.0  1.0>
  27.     //look_at < 0 -30 0 >
  28.     look_at < LOOKX LOOKY LOOKZ >
  29.     up  <0.0  1.0  0.0>
  30.     right <1.33333 0.0 0.0>
  31.  }
  32.  
  33. /* the test camera 
  34. camera { /*Hint:for starters, make "Z" 5 times the largest sphere radius */ 
  35.     location <0.0  -25.0  -185.0>
  36.     direction <0.0 0.0  1.0>
  37.     look_at < 0 -30 0 >
  38.     up  <0.0  1.0  0.0>
  39.     right <1.33333 0.0 0.0>
  40.  }
  41. */
  42.  
  43. object {
  44.    light_source { <320.0  300.0  -600.0> colour red 1.0 green 1.0 blue 1.0 }
  45. //   light_source { <100.0  85.0  -220.0> colour red 1.0 green 1.0 blue 1.0 }
  46.  }
  47.  
  48.  
  49.  
  50. #declare PumpSkin = color red 1.0 green 0.430 blue 0.0
  51. #declare PumpGuts = color red 1.0 green 0.644 blue 0.102
  52. //#declare PumpStem = color red 0.281 green 0.431 blue 0.225
  53. #declare PumpStem = color red 0.387 green 0.419 blue 0.231
  54. /* Create Mouth here */
  55. #declare Mouth = 
  56.         intersection {
  57.             difference {
  58.                 quadric { Cylinder_Y                   
  59.                         //scale <35.0 35.0 35.0>
  60.                         scale < LLIPDIA LLIPDIA LLIPDIA >
  61.                         translate < LLIPX LLIPY LLIPZ >
  62.                 }
  63.                 
  64.                 quadric { Cylinder_Y                   
  65.                         scale < ULIPDIA ULIPDIA ULIPDIA >
  66.                         translate < ULIPX ULIPY ULIPZ >
  67.                         //scale <35.0 35.0 35.0>
  68.                         //translate < 0 0 -25>
  69.                 }
  70.                 /* tooth */
  71.                 box { <-5.5 -115 -4> < 5.5 0 4> 
  72.                         //translate < 0 0 31 > 
  73.                         //rotate < 0 -35 0 >
  74.                         translate < 0 0 LTOOTH1Z >
  75.                         rotate < 0 LTOOTH1R 0 >
  76.                 }
  77.                 /* tooth */
  78.                 box { <-5 -115 -4> < 5 0 4> 
  79.                         //translate < 0 0 31 > 
  80.                         //rotate < 0 35 0 >
  81.                         translate < 0 0 LTOOTH2Z >
  82.                         rotate < 0 LTOOTH2R 0 >
  83.                 }                  
  84.                 /* tooth */
  85.                 box { <-5 -115 -5> < 5 0 5> 
  86.                         //translate < 0 0 14 > 
  87.                         translate < 0 0 UTOOTH1Z >
  88.                         rotate < 0 UTOOTH1R 0 >
  89.                         translate < 0 0 UTOOTH1O >
  90.                 }
  91.                 /* tooth */
  92.                 box { <-5 -115 -5> < 5 0 5> 
  93.                         //translate < 0 0 14 > 
  94.                         translate < 0 0 UTOOTH2Z >
  95.                         rotate < 0 UTOOTH2R 0 >
  96.                         translate < 0 0 UTOOTH2O >
  97.                 }
  98.             }
  99.             plane { <0.0 1.0 0.0> 0.0  }   /* clip top of "stem" */
  100.             plane { <0.0 -1.0 0.0> 115.0  }  /* clip bottom of "stem */
  101.             rotate < 10 0 0 >
  102.          }
  103. /* Standard Eye cutout */
  104. #declare REye = 
  105. /* CReate Eyes...          */
  106.         intersection {
  107.             difference {
  108.                 quadric { Cylinder_Y                   
  109.                         //scale <10.0 10.0 10.0>
  110.                         scale < 10 10 REYESC >
  111.                 }
  112.                 quadric { Cylinder_Y
  113.                         scale < 5.0 5.0 5.0 >
  114.                         translate < RIRISX 0 RIRISY >
  115.                 }
  116.             }
  117.             plane { <0.0 1.0 0.0> -50.0  }   /* clip top of "stem" */
  118.             plane { <0.0 -1.0 0.0> 115.0  }  /* clip bottom of "stem */
  119.          }
  120.  
  121.  
  122. #declare LEye = 
  123. /* CReate Eyes...          */
  124.         intersection {
  125.             difference {
  126.                 quadric { Cylinder_Y                   
  127.                         //scale <10.0 10.0 10.0>
  128.                         scale < 10 10 LEYESC >
  129.  
  130.                 }
  131.                 quadric { Cylinder_Y
  132.                         scale < 5.0 5.0 5.0 >
  133.                         translate < LIRISX 0 LIRISY >
  134.                 }
  135.             }
  136.             plane { <0.0 1.0 0.0> -50.0  }   /* clip top of "stem" */
  137.             plane { <0.0 -1.0 0.0> 115.0  }  /* clip bottom of "stem */
  138.          }
  139.  
  140. /* now the nose */
  141. #declare Nose =               
  142.         intersection {
  143.         
  144.                 box { <-5 -115 -5> < 5 0 5> 
  145.                         rotate < 0 45 0 >
  146.                 }
  147.                 //plane { < 1 0 0 > 0.0 }
  148.                 rotate < 13 0 0 >
  149.         }
  150.  
  151.  
  152. /********************
  153. /* Now draw the sky */
  154. OBJECT
  155.    SPHERE <0.0  0.0  0.0> 300.0 END_SPHERE
  156.    COLOUR RED 0.0  GREEN 0.5 BLUE 1.0
  157.    AMBIENT 0.7
  158.    DIFFUSE 0.0   /* we don't want clouds casting shadows on the sky */
  159. END_OBJECT
  160. **********************/
  161. //#declare pumpkin =
  162. composite {
  163.     object {
  164.         difference {
  165.         union {
  166.             sphere { <  50.0       0.0       0.0 > 50.0  }
  167.             sphere { <  48.44563   12.3702   0.0 > 50.5   }
  168.             sphere { <  43.87913   23.97128  0.0 > 51.0   }
  169.             sphere { <  36.58445   34.08194  0.0 > 49.0   }
  170.             sphere { <  27.01512   42.07355  0.0 > 51.0   }
  171.             sphere { <  15.76612   47.44923  0.0 > 50.0   }
  172.             sphere { <  3.536866   49.87476  0.0 > 51.0   }
  173.             sphere { < -8.912303   49.1993   0.0 > 49.0   }
  174.             sphere { < -20.80734   45.46488  0.0 > 50.0   }
  175.             sphere { < -31.40868   38.90366  0.0 > 51.5   }
  176.             sphere { < -40.05718   29.92361  0.0 > 50.0   }
  177.             sphere { < -46.21512   19.08306  0.0 > 49.0   }
  178.             sphere { < -49.49963   7.056011  0.0 > 50.0   }
  179.             sphere { < -49.70648  -5.409742  0.0 > 48.5   }
  180.             sphere { < -46.82284  -17.53916  0.0 > 50.0   }
  181.             sphere { < -41.02797  -28.57806  0.0 > 50.5   }
  182.             sphere { < -32.68219  -37.84012  0.0 > 51.0   }
  183.             sphere { < -22.30439  -44.74947  0.0 > 49.0   }
  184.             sphere { < -10.53981  -48.87651  0.0 > 50.0   }
  185.             sphere { <  1.880106  -49.96465  0.0 > 50.0   }
  186.             sphere { <  14.18311  -47.94622  0.0 > 51.0   }
  187.             sphere { <  25.60427  -42.94673  0.0 > 50.5   }
  188.             sphere { <  35.43348  -35.27703  0.0 > 50.0   }
  189.             sphere { <  43.05961  -25.41397  0.0 > 51.0   }
  190.             sphere { <  48.00851  -13.9708   0.0 > 49.0   }
  191.             sphere { <  49.97247  -1.658968  0.0 > 50.0   }
  192.         intersection {
  193.             quadric { Cylinder_Z                   
  194.                 scale <50.0 50.0 50.0>
  195.              }
  196.             plane { <0.0 0.0 1.0> 50.0  }   /* clip top of "stem" */
  197.             plane { <0.0 0.0 -1.0> 30.0  }  /* clip bottom of "stem */
  198.          }
  199.          }
  200.         union {
  201.             sphere { <  50.0       0.0       0.0 > 49.0  }
  202.             sphere { <  48.44563   12.3702   0.0 > 49.5   }
  203.             sphere { <  43.87913   23.97128  0.0 > 50.0   }
  204.             sphere { <  36.58445   34.08194  0.0 > 48.0   }
  205.             sphere { <  27.01512   42.07355  0.0 > 50.0   }
  206.             sphere { <  15.76612   47.44923  0.0 > 49.0   }
  207.             sphere { <  3.536866   49.87476  0.0 > 50.0   }
  208.             sphere { < -8.912303   49.1993   0.0 > 48.0   }
  209.             sphere { < -20.80734   45.46488  0.0 > 49.0   }
  210.             sphere { < -31.40868   38.90366  0.0 > 50.5   }
  211.             sphere { < -40.05718   29.92361  0.0 > 49.0   }
  212.             sphere { < -46.21512   19.08306  0.0 > 48.0   }
  213.             sphere { < -49.49963   7.056011  0.0 > 49.0   }
  214.             sphere { < -49.70648  -5.409742  0.0 > 47.5   }
  215.             sphere { < -46.82284  -17.53916  0.0 > 49.0   }
  216.             sphere { < -41.02797  -28.57806  0.0 > 49.5   }
  217.             sphere { < -32.68219  -37.84012  0.0 > 50.0   }
  218.             sphere { < -22.30439  -44.74947  0.0 > 48.0   }
  219.             sphere { < -10.53981  -48.87651  0.0 > 49.0   }
  220.             sphere { <  1.880106  -49.96465  0.0 > 49.0   }
  221.             sphere { <  14.18311  -47.94622  0.0 > 50.0   }
  222.             sphere { <  25.60427  -42.94673  0.0 > 49.5   }
  223.             sphere { <  35.43348  -35.27703  0.0 > 49.0   }
  224.             sphere { <  43.05961  -25.41397  0.0 > 50.0   }
  225.             sphere { <  48.00851  -13.9708  0.0 > 48.0   }
  226.             sphere { <  49.97247  -1.658968  0.0 > 49.0   }
  227.             intersection {
  228.                 quadric { Cylinder_Z
  229.                         scale <50.0 50.0 50.0>
  230.                 }
  231.                 plane { <0.0 0.0 1.0> 49.0  }   /* clip top of "stem" */
  232.                 plane { <0.0 0.0 -1.0> 29.0  }  /* clip bottom of "stem */
  233.             }
  234.          }
  235. /* put eyes in */
  236.  
  237.          intersection { REye                  
  238.                 translate < 15 0 -35 >
  239.          }
  240.  
  241.         intersection { LEye
  242.                 translate < -15 0 -35 >
  243.          }
  244.  
  245. /* put mouth in */
  246.         intersection { Mouth }
  247.  
  248. /* put nose in */
  249.         intersection { Nose }
  250.    
  251.    }
  252.  
  253.         texture {
  254.                 color PumpSkin
  255.                 bumps .2
  256.                 phong 0.35
  257.                 phong_size 60.0
  258.                 }
  259.      }
  260.     
  261.      object {
  262.         difference {
  263.         union {
  264.             sphere { <  50.0       0.0       0.0 > 49.0  }
  265.             sphere { <  48.44563   12.3702   0.0 > 49.5   }
  266.             sphere { <  43.87913   23.97128  0.0 > 50.0   }
  267.             sphere { <  36.58445   34.08194  0.0 > 48.0   }
  268.             sphere { <  27.01512   42.07355  0.0 > 50.0   }
  269.             sphere { <  15.76612   47.44923  0.0 > 49.0   }
  270.             sphere { <  3.536866   49.87476  0.0 > 50.0   }
  271.             sphere { < -8.912303   49.1993   0.0 > 48.0   }
  272.             sphere { < -20.80734   45.46488  0.0 > 49.0   }
  273.             sphere { < -31.40868   38.90366  0.0 > 50.5   }
  274.             sphere { < -40.05718   29.92361  0.0 > 49.0   }
  275.             sphere { < -46.21512   19.08306  0.0 > 48.0   }
  276.             sphere { < -49.49963   7.056011  0.0 > 49.0   }
  277.             sphere { < -49.70648  -5.409742  0.0 > 47.5   }
  278.             sphere { < -46.82284  -17.53916  0.0 > 49.0   }
  279.             sphere { < -41.02797  -28.57806  0.0 > 49.5   }
  280.             sphere { < -32.68219  -37.84012  0.0 > 50.0   }
  281.             sphere { < -22.30439  -44.74947  0.0 > 48.0   }
  282.             sphere { < -10.53981  -48.87651  0.0 > 49.0   }
  283.             sphere { <  1.880106  -49.96465  0.0 > 49.0   }
  284.             sphere { <  14.18311  -47.94622  0.0 > 50.0   }
  285.             sphere { <  25.60427  -42.94673  0.0 > 49.5   }
  286.             sphere { <  35.43348  -35.27703  0.0 > 49.0   }
  287.             sphere { <  43.05961  -25.41397  0.0 > 50.0   }
  288.             sphere { <  48.00851  -13.9708  0.0 > 48.0   }
  289.             sphere { <  49.97247  -1.658968  0.0 > 49.0   }
  290.         intersection {
  291.             quadric { Cylinder_Z                   
  292.                 scale <50.0 50.0 50.0>
  293.             }
  294.             plane { <0.0 0.0 1.0> 49.0  }   /* clip top of "stem" */
  295.             plane { <0.0 0.0 -1.0> 29.0  }  /* clip bottom of "stem */
  296.          }
  297.          }
  298.         union {
  299.             sphere { <  50.0       0.0       0.0 > 44.0  }
  300.             sphere { <  48.44563   12.3702   0.0 > 44.5   }
  301.             sphere { <  43.87913   23.97128  0.0 > 45.0   }
  302.             sphere { <  36.58445   34.08194  0.0 > 43.0   }
  303.             sphere { <  27.01512   42.07355  0.0 > 45.0   }
  304.             sphere { <  15.76612   47.44923  0.0 > 44.0   }
  305.             sphere { <  3.536866   49.87476  0.0 > 45.0   }
  306.             sphere { < -8.912303   49.1993   0.0 > 43.0   }
  307.             sphere { < -20.80734   45.46488  0.0 > 44.0   }
  308.             sphere { < -31.40868   38.90366  0.0 > 45.5   }
  309.             sphere { < -40.05718   29.92361  0.0 > 44.0   }
  310.             sphere { < -46.21512   19.08306  0.0 > 43.0   }
  311.             sphere { < -49.49963   7.056011  0.0 > 44.0   }
  312.             sphere { < -49.70648  -5.409742  0.0 > 42.5   }
  313.             sphere { < -46.82284  -17.53916  0.0 > 44.0   }
  314.             sphere { < -41.02797  -28.57806  0.0 > 44.5   }
  315.             sphere { < -32.68219  -37.84012  0.0 > 45.0   }
  316.             sphere { < -22.30439  -44.74947  0.0 > 43.0   }
  317.             sphere { < -10.53981  -48.87651  0.0 > 44.0   }
  318.             sphere { <  1.880106  -49.96465  0.0 > 44.0   }
  319.             sphere { <  14.18311  -47.94622  0.0 > 45.0   }
  320.             sphere { <  25.60427  -42.94673  0.0 > 44.5   }
  321.             sphere { <  35.43348  -35.27703  0.0 > 44.0   }
  322.             sphere { <  43.05961  -25.41397  0.0 > 45.0   }
  323.             sphere { <  48.00851  -13.9708  0.0 > 43.0   }
  324.             sphere { <  49.97247  -1.658968  0.0 > 44.0   }
  325.         intersection {
  326.             quadric { Cylinder_Z                   
  327.                 scale <50.0 50.0 50.0>
  328.             }
  329.             plane { <0.0 0.0 1.0> 44.0  }   /* clip top of "stem" */
  330.             plane { <0.0 0.0 -1.0> 27.0  }  /* clip bottom of "stem */
  331.          }
  332.          }
  333.  
  334. /* put eyes in */
  335.          intersection { REye
  336.                 translate < 15 0 -35 >
  337.                 
  338.          }                           
  339.  
  340.         intersection { LEye
  341.                 translate < -15 0 -35 >
  342.          }
  343.  
  344.  
  345.    intersection { Mouth }
  346.          
  347. /* put nose in */
  348.         intersection { Nose }
  349.    }
  350.  
  351.         texture {
  352.                 color PumpGuts
  353.                 phong 0.45
  354.                 phong_size 60.0
  355.                 ambient 0.33
  356.                 diffuse .7
  357.                 }
  358.      }
  359. /* stem */
  360.     object {
  361.         intersection {
  362.             quadric { Hyperboloid_Y                   /* make a "stem"*/
  363.                 rotate < 0 0 90 >
  364.                 rotate < 2 0 0 >
  365.                 scale <1.5 1.5 1.5>
  366.                 rotate < 0 90 0>
  367.              }
  368.             plane { <0.0 0.0 1.0> 13.0  }   /* clip top of "stem" */
  369.             plane { <0.0 0.0 -1.0> -2.0  }  /* clip bottom of "stem */
  370.          }
  371.         texture { 0.5  
  372.                 color PumpStem
  373. //                color Green
  374.                 ambient 0.3
  375.                 diffuse 0.7
  376.                 wrinkles .4
  377.         }
  378.         scale < 1 1 3 >
  379.         translate <0.0 0.0 -70.0>
  380.  
  381.     }
  382.  
  383. /* Candle stick */
  384.  
  385.     object {       
  386.         intersection {
  387.             quadric { Cylinder_Z                   
  388.                 scale <5.0 5.0 5.0>
  389.             }
  390.             plane { <0.0 0.0 1.0> 44.0  }   /* clip top of "stem" */
  391.             plane { <0.0 0.0 -1.0> -29.0  }  /* clip bottom of "stem */
  392.          }
  393.          texture
  394.                 {
  395.                 color red 1 green .839 blue .502
  396.                 ambient .8
  397.                 phong .8
  398.  
  399.                 }
  400.     }
  401. /* Candle Wick */
  402.      
  403.         object {
  404.           intersection {
  405.               quadric { Cylinder_Z                   
  406.                   scale <1.0 1.0 1.0>
  407.               }
  408.               plane { <0.0 0.0 1.0> 44.0  }   /* clip top of "stem" */
  409.               plane { <0.0 0.0 -1.0> -20.0  }  /* clip bottom of "stem */
  410.           } // end intersection 
  411.          texture
  412.                 {
  413.                 color red 0.15 green .15 blue .15
  414.                 }
  415.  
  416.        } // end wick
  417. /* Candle Flame */
  418. object {
  419.  union {
  420.    quartic { Piriform sturm 
  421.         rotate <0 -90 0>
  422.         scale <6 6 25>
  423.         translate < 0 0 -1>
  424.         texture {
  425.                 gradient < 0 0 1 >
  426.                 color_map {
  427.                 [ 0.0 0.18 color red 1.0 green .98 blue .92 alpha 1
  428.                                 color red 1.0 green .80 blue .705 alpha 0.750]
  429.                 [ 0.18 0.35 color red 1.0 green .80 blue .705 alpha 0.750
  430.                                 color red 1.0 green .95 blue .705 alpha 0.550]
  431.  
  432.                 [ 0.35 0.50 color red 1.0 green .95 blue .705 alpha 0.55
  433.                                 color red 1.0 green .92 blue .77 alpha 0.850]
  434.                 [ 0.50 0.75 color red 1.0 green .92 blue .77 alpha 0.850
  435.                                 color red 1.0 green .80 blue .705 alpha 0.95]
  436.                 [ 0.75 1.0 color red 1.0 green .80 blue .705 alpha .95
  437.                                 color red 1 green .98 blue .92 alpha 1]
  438.                 }
  439.                 turbulence .4
  440.                 scale < 1 1 15 >
  441.                 translate < 0 0 19 >
  442.                 ambient .9
  443.                 diffuse 0.8
  444.         }
  445.         translate < 0 0 -25>
  446.         rotate < 0 CANDROTY 0 >
  447.         rotate < 0 0 CANDROTZ >
  448.         translate < 0 0 25 >
  449.         translate <0 0 4.5>
  450.  
  451.    }
  452. /* light up the flame */
  453.         light_source { <LIGHTX LIGHTY LIGHTZ> colour red 1.0 green .95 blue .85 }
  454. } // End flame outer
  455.         no_shadow
  456. }
  457.  
  458.  
  459. /* MOve Jack to position */
  460.         //rotate <90.0 0.0 0.0 >
  461.         scale < PSCALEZ PSCALEZ PSCALEZ >
  462.         rotate < PROTX 0 0 >
  463.         rotate < 0 PROTY 0 >
  464.         rotate < 0 0 PROTZ >
  465.         translate < PUMPX PUMPY PUMPZ >
  466.  
  467.  
  468.  
  469.         bounded_by { sphere { < PUMPX PUMPY PUMPZ  > 150 } }
  470.  }
  471.  
  472.  
  473.  
  474.  
  475. /* lay down the floor */
  476.  
  477. composite { the_floor 
  478.         scale < 0.5 0.5 0.5 >
  479.         rotate < 90 -10 0 >
  480.         translate < -175 -55 0 >
  481. }
  482.  
  483.  
  484. /* lay down the wall */
  485. /*
  486. composite { the_floor 
  487.         scale < 0.5 0.5 0.5 >
  488.         //rotate < 65 0 0 >
  489.         translate < -120 100 400 >
  490. }
  491. */
  492.