home *** CD-ROM | disk | FTP | other *** search
- // Persistence of Vision Raytracer
- /*
-
- DKB Script for a big ol' Halloween pumpkin!
- Try your hand at carving it using a paint program, or better still,
- using the DKB CSG commands!
- By Dan Farmer Oct 8, 1990
- Turned into a POV Jack-O-Lantern
- By Rob LaMoreaux Oct 8, 1992
-
- */
-
- //#include "basicsha.dat"
- #include "colors.inc"
- #include "textures.inc"
- #include "shapes.inc"
- #include "shapesq.inc"
- #include "hallway1.inc"
- #include "pumpdefs.inc"
-
-
- /* The correct camera */
- camera { /*Hint:for starters, make "Z" 5 times the largest sphere radius */
- //location <0.0 75.0 -185.0>
- location <CAMERAX CAMERAY CAMERAZ >
- direction <0.0 0.0 1.0>
- //look_at < 0 -30 0 >
- look_at < LOOKX LOOKY LOOKZ >
- up <0.0 1.0 0.0>
- right <1.33333 0.0 0.0>
- }
-
- /* the test camera
- camera { /*Hint:for starters, make "Z" 5 times the largest sphere radius */
- location <0.0 -25.0 -185.0>
- direction <0.0 0.0 1.0>
- look_at < 0 -30 0 >
- up <0.0 1.0 0.0>
- right <1.33333 0.0 0.0>
- }
- */
-
- object {
- light_source { <320.0 300.0 -600.0> colour red 1.0 green 1.0 blue 1.0 }
- // light_source { <100.0 85.0 -220.0> colour red 1.0 green 1.0 blue 1.0 }
- }
-
-
-
- #declare PumpSkin = color red 1.0 green 0.430 blue 0.0
- #declare PumpGuts = color red 1.0 green 0.644 blue 0.102
- //#declare PumpStem = color red 0.281 green 0.431 blue 0.225
- #declare PumpStem = color red 0.387 green 0.419 blue 0.231
- /* Create Mouth here */
- #declare Mouth =
- intersection {
- difference {
- quadric { Cylinder_Y
- //scale <35.0 35.0 35.0>
- scale < LLIPDIA LLIPDIA LLIPDIA >
- translate < LLIPX LLIPY LLIPZ >
- }
-
- quadric { Cylinder_Y
- scale < ULIPDIA ULIPDIA ULIPDIA >
- translate < ULIPX ULIPY ULIPZ >
- //scale <35.0 35.0 35.0>
- //translate < 0 0 -25>
- }
- /* tooth */
- box { <-5.5 -115 -4> < 5.5 0 4>
- //translate < 0 0 31 >
- //rotate < 0 -35 0 >
- translate < 0 0 LTOOTH1Z >
- rotate < 0 LTOOTH1R 0 >
- }
- /* tooth */
- box { <-5 -115 -4> < 5 0 4>
- //translate < 0 0 31 >
- //rotate < 0 35 0 >
- translate < 0 0 LTOOTH2Z >
- rotate < 0 LTOOTH2R 0 >
- }
- /* tooth */
- box { <-5 -115 -5> < 5 0 5>
- //translate < 0 0 14 >
- translate < 0 0 UTOOTH1Z >
- rotate < 0 UTOOTH1R 0 >
- translate < 0 0 UTOOTH1O >
- }
- /* tooth */
- box { <-5 -115 -5> < 5 0 5>
- //translate < 0 0 14 >
- translate < 0 0 UTOOTH2Z >
- rotate < 0 UTOOTH2R 0 >
- translate < 0 0 UTOOTH2O >
- }
- }
- plane { <0.0 1.0 0.0> 0.0 } /* clip top of "stem" */
- plane { <0.0 -1.0 0.0> 115.0 } /* clip bottom of "stem */
- rotate < 10 0 0 >
- }
- /* Standard Eye cutout */
- #declare REye =
- /* CReate Eyes... */
- intersection {
- difference {
- quadric { Cylinder_Y
- //scale <10.0 10.0 10.0>
- scale < 10 10 REYESC >
- }
- quadric { Cylinder_Y
- scale < 5.0 5.0 5.0 >
- translate < RIRISX 0 RIRISY >
- }
- }
- plane { <0.0 1.0 0.0> -50.0 } /* clip top of "stem" */
- plane { <0.0 -1.0 0.0> 115.0 } /* clip bottom of "stem */
- }
-
-
- #declare LEye =
- /* CReate Eyes... */
- intersection {
- difference {
- quadric { Cylinder_Y
- //scale <10.0 10.0 10.0>
- scale < 10 10 LEYESC >
-
- }
- quadric { Cylinder_Y
- scale < 5.0 5.0 5.0 >
- translate < LIRISX 0 LIRISY >
- }
- }
- plane { <0.0 1.0 0.0> -50.0 } /* clip top of "stem" */
- plane { <0.0 -1.0 0.0> 115.0 } /* clip bottom of "stem */
- }
-
- /* now the nose */
- #declare Nose =
- intersection {
-
- box { <-5 -115 -5> < 5 0 5>
- rotate < 0 45 0 >
- }
- //plane { < 1 0 0 > 0.0 }
- rotate < 13 0 0 >
- }
-
-
- /********************
- /* Now draw the sky */
- OBJECT
- SPHERE <0.0 0.0 0.0> 300.0 END_SPHERE
- COLOUR RED 0.0 GREEN 0.5 BLUE 1.0
- AMBIENT 0.7
- DIFFUSE 0.0 /* we don't want clouds casting shadows on the sky */
- END_OBJECT
- **********************/
- //#declare pumpkin =
- composite {
- object {
- difference {
- union {
- sphere { < 50.0 0.0 0.0 > 50.0 }
- sphere { < 48.44563 12.3702 0.0 > 50.5 }
- sphere { < 43.87913 23.97128 0.0 > 51.0 }
- sphere { < 36.58445 34.08194 0.0 > 49.0 }
- sphere { < 27.01512 42.07355 0.0 > 51.0 }
- sphere { < 15.76612 47.44923 0.0 > 50.0 }
- sphere { < 3.536866 49.87476 0.0 > 51.0 }
- sphere { < -8.912303 49.1993 0.0 > 49.0 }
- sphere { < -20.80734 45.46488 0.0 > 50.0 }
- sphere { < -31.40868 38.90366 0.0 > 51.5 }
- sphere { < -40.05718 29.92361 0.0 > 50.0 }
- sphere { < -46.21512 19.08306 0.0 > 49.0 }
- sphere { < -49.49963 7.056011 0.0 > 50.0 }
- sphere { < -49.70648 -5.409742 0.0 > 48.5 }
- sphere { < -46.82284 -17.53916 0.0 > 50.0 }
- sphere { < -41.02797 -28.57806 0.0 > 50.5 }
- sphere { < -32.68219 -37.84012 0.0 > 51.0 }
- sphere { < -22.30439 -44.74947 0.0 > 49.0 }
- sphere { < -10.53981 -48.87651 0.0 > 50.0 }
- sphere { < 1.880106 -49.96465 0.0 > 50.0 }
- sphere { < 14.18311 -47.94622 0.0 > 51.0 }
- sphere { < 25.60427 -42.94673 0.0 > 50.5 }
- sphere { < 35.43348 -35.27703 0.0 > 50.0 }
- sphere { < 43.05961 -25.41397 0.0 > 51.0 }
- sphere { < 48.00851 -13.9708 0.0 > 49.0 }
- sphere { < 49.97247 -1.658968 0.0 > 50.0 }
- intersection {
- quadric { Cylinder_Z
- scale <50.0 50.0 50.0>
- }
- plane { <0.0 0.0 1.0> 50.0 } /* clip top of "stem" */
- plane { <0.0 0.0 -1.0> 30.0 } /* clip bottom of "stem */
- }
- }
- union {
- sphere { < 50.0 0.0 0.0 > 49.0 }
- sphere { < 48.44563 12.3702 0.0 > 49.5 }
- sphere { < 43.87913 23.97128 0.0 > 50.0 }
- sphere { < 36.58445 34.08194 0.0 > 48.0 }
- sphere { < 27.01512 42.07355 0.0 > 50.0 }
- sphere { < 15.76612 47.44923 0.0 > 49.0 }
- sphere { < 3.536866 49.87476 0.0 > 50.0 }
- sphere { < -8.912303 49.1993 0.0 > 48.0 }
- sphere { < -20.80734 45.46488 0.0 > 49.0 }
- sphere { < -31.40868 38.90366 0.0 > 50.5 }
- sphere { < -40.05718 29.92361 0.0 > 49.0 }
- sphere { < -46.21512 19.08306 0.0 > 48.0 }
- sphere { < -49.49963 7.056011 0.0 > 49.0 }
- sphere { < -49.70648 -5.409742 0.0 > 47.5 }
- sphere { < -46.82284 -17.53916 0.0 > 49.0 }
- sphere { < -41.02797 -28.57806 0.0 > 49.5 }
- sphere { < -32.68219 -37.84012 0.0 > 50.0 }
- sphere { < -22.30439 -44.74947 0.0 > 48.0 }
- sphere { < -10.53981 -48.87651 0.0 > 49.0 }
- sphere { < 1.880106 -49.96465 0.0 > 49.0 }
- sphere { < 14.18311 -47.94622 0.0 > 50.0 }
- sphere { < 25.60427 -42.94673 0.0 > 49.5 }
- sphere { < 35.43348 -35.27703 0.0 > 49.0 }
- sphere { < 43.05961 -25.41397 0.0 > 50.0 }
- sphere { < 48.00851 -13.9708 0.0 > 48.0 }
- sphere { < 49.97247 -1.658968 0.0 > 49.0 }
- intersection {
- quadric { Cylinder_Z
- scale <50.0 50.0 50.0>
- }
- plane { <0.0 0.0 1.0> 49.0 } /* clip top of "stem" */
- plane { <0.0 0.0 -1.0> 29.0 } /* clip bottom of "stem */
- }
- }
- /* put eyes in */
-
- intersection { REye
- translate < 15 0 -35 >
- }
-
- intersection { LEye
- translate < -15 0 -35 >
- }
-
- /* put mouth in */
- intersection { Mouth }
-
- /* put nose in */
- intersection { Nose }
-
- }
-
- texture {
- color PumpSkin
- bumps .2
- phong 0.35
- phong_size 60.0
- }
- }
-
- object {
- difference {
- union {
- sphere { < 50.0 0.0 0.0 > 49.0 }
- sphere { < 48.44563 12.3702 0.0 > 49.5 }
- sphere { < 43.87913 23.97128 0.0 > 50.0 }
- sphere { < 36.58445 34.08194 0.0 > 48.0 }
- sphere { < 27.01512 42.07355 0.0 > 50.0 }
- sphere { < 15.76612 47.44923 0.0 > 49.0 }
- sphere { < 3.536866 49.87476 0.0 > 50.0 }
- sphere { < -8.912303 49.1993 0.0 > 48.0 }
- sphere { < -20.80734 45.46488 0.0 > 49.0 }
- sphere { < -31.40868 38.90366 0.0 > 50.5 }
- sphere { < -40.05718 29.92361 0.0 > 49.0 }
- sphere { < -46.21512 19.08306 0.0 > 48.0 }
- sphere { < -49.49963 7.056011 0.0 > 49.0 }
- sphere { < -49.70648 -5.409742 0.0 > 47.5 }
- sphere { < -46.82284 -17.53916 0.0 > 49.0 }
- sphere { < -41.02797 -28.57806 0.0 > 49.5 }
- sphere { < -32.68219 -37.84012 0.0 > 50.0 }
- sphere { < -22.30439 -44.74947 0.0 > 48.0 }
- sphere { < -10.53981 -48.87651 0.0 > 49.0 }
- sphere { < 1.880106 -49.96465 0.0 > 49.0 }
- sphere { < 14.18311 -47.94622 0.0 > 50.0 }
- sphere { < 25.60427 -42.94673 0.0 > 49.5 }
- sphere { < 35.43348 -35.27703 0.0 > 49.0 }
- sphere { < 43.05961 -25.41397 0.0 > 50.0 }
- sphere { < 48.00851 -13.9708 0.0 > 48.0 }
- sphere { < 49.97247 -1.658968 0.0 > 49.0 }
- intersection {
- quadric { Cylinder_Z
- scale <50.0 50.0 50.0>
- }
- plane { <0.0 0.0 1.0> 49.0 } /* clip top of "stem" */
- plane { <0.0 0.0 -1.0> 29.0 } /* clip bottom of "stem */
- }
- }
- union {
- sphere { < 50.0 0.0 0.0 > 44.0 }
- sphere { < 48.44563 12.3702 0.0 > 44.5 }
- sphere { < 43.87913 23.97128 0.0 > 45.0 }
- sphere { < 36.58445 34.08194 0.0 > 43.0 }
- sphere { < 27.01512 42.07355 0.0 > 45.0 }
- sphere { < 15.76612 47.44923 0.0 > 44.0 }
- sphere { < 3.536866 49.87476 0.0 > 45.0 }
- sphere { < -8.912303 49.1993 0.0 > 43.0 }
- sphere { < -20.80734 45.46488 0.0 > 44.0 }
- sphere { < -31.40868 38.90366 0.0 > 45.5 }
- sphere { < -40.05718 29.92361 0.0 > 44.0 }
- sphere { < -46.21512 19.08306 0.0 > 43.0 }
- sphere { < -49.49963 7.056011 0.0 > 44.0 }
- sphere { < -49.70648 -5.409742 0.0 > 42.5 }
- sphere { < -46.82284 -17.53916 0.0 > 44.0 }
- sphere { < -41.02797 -28.57806 0.0 > 44.5 }
- sphere { < -32.68219 -37.84012 0.0 > 45.0 }
- sphere { < -22.30439 -44.74947 0.0 > 43.0 }
- sphere { < -10.53981 -48.87651 0.0 > 44.0 }
- sphere { < 1.880106 -49.96465 0.0 > 44.0 }
- sphere { < 14.18311 -47.94622 0.0 > 45.0 }
- sphere { < 25.60427 -42.94673 0.0 > 44.5 }
- sphere { < 35.43348 -35.27703 0.0 > 44.0 }
- sphere { < 43.05961 -25.41397 0.0 > 45.0 }
- sphere { < 48.00851 -13.9708 0.0 > 43.0 }
- sphere { < 49.97247 -1.658968 0.0 > 44.0 }
- intersection {
- quadric { Cylinder_Z
- scale <50.0 50.0 50.0>
- }
- plane { <0.0 0.0 1.0> 44.0 } /* clip top of "stem" */
- plane { <0.0 0.0 -1.0> 27.0 } /* clip bottom of "stem */
- }
- }
-
- /* put eyes in */
- intersection { REye
- translate < 15 0 -35 >
-
- }
-
- intersection { LEye
- translate < -15 0 -35 >
- }
-
-
- intersection { Mouth }
-
- /* put nose in */
- intersection { Nose }
- }
-
- texture {
- color PumpGuts
- phong 0.45
- phong_size 60.0
- ambient 0.33
- diffuse .7
- }
- }
- /* stem */
- object {
- intersection {
- quadric { Hyperboloid_Y /* make a "stem"*/
- rotate < 0 0 90 >
- rotate < 2 0 0 >
- scale <1.5 1.5 1.5>
- rotate < 0 90 0>
- }
- plane { <0.0 0.0 1.0> 13.0 } /* clip top of "stem" */
- plane { <0.0 0.0 -1.0> -2.0 } /* clip bottom of "stem */
- }
- texture { 0.5
- color PumpStem
- // color Green
- ambient 0.3
- diffuse 0.7
- wrinkles .4
- }
- scale < 1 1 3 >
- translate <0.0 0.0 -70.0>
-
- }
-
- /* Candle stick */
-
- object {
- intersection {
- quadric { Cylinder_Z
- scale <5.0 5.0 5.0>
- }
- plane { <0.0 0.0 1.0> 44.0 } /* clip top of "stem" */
- plane { <0.0 0.0 -1.0> -29.0 } /* clip bottom of "stem */
- }
- texture
- {
- color red 1 green .839 blue .502
- ambient .8
- phong .8
-
- }
- }
- /* Candle Wick */
-
- object {
- intersection {
- quadric { Cylinder_Z
- scale <1.0 1.0 1.0>
- }
- plane { <0.0 0.0 1.0> 44.0 } /* clip top of "stem" */
- plane { <0.0 0.0 -1.0> -20.0 } /* clip bottom of "stem */
- } // end intersection
- texture
- {
- color red 0.15 green .15 blue .15
- }
-
- } // end wick
- /* Candle Flame */
- object {
- union {
- quartic { Piriform sturm
- rotate <0 -90 0>
- scale <6 6 25>
- translate < 0 0 -1>
- texture {
- gradient < 0 0 1 >
- color_map {
- [ 0.0 0.18 color red 1.0 green .98 blue .92 alpha 1
- color red 1.0 green .80 blue .705 alpha 0.750]
- [ 0.18 0.35 color red 1.0 green .80 blue .705 alpha 0.750
- color red 1.0 green .95 blue .705 alpha 0.550]
-
- [ 0.35 0.50 color red 1.0 green .95 blue .705 alpha 0.55
- color red 1.0 green .92 blue .77 alpha 0.850]
- [ 0.50 0.75 color red 1.0 green .92 blue .77 alpha 0.850
- color red 1.0 green .80 blue .705 alpha 0.95]
- [ 0.75 1.0 color red 1.0 green .80 blue .705 alpha .95
- color red 1 green .98 blue .92 alpha 1]
- }
- turbulence .4
- scale < 1 1 15 >
- translate < 0 0 19 >
- ambient .9
- diffuse 0.8
- }
- translate < 0 0 -25>
- rotate < 0 CANDROTY 0 >
- rotate < 0 0 CANDROTZ >
- translate < 0 0 25 >
- translate <0 0 4.5>
-
- }
- /* light up the flame */
- light_source { <LIGHTX LIGHTY LIGHTZ> colour red 1.0 green .95 blue .85 }
- } // End flame outer
- no_shadow
- }
-
-
- /* MOve Jack to position */
- //rotate <90.0 0.0 0.0 >
- scale < PSCALEZ PSCALEZ PSCALEZ >
- rotate < PROTX 0 0 >
- rotate < 0 PROTY 0 >
- rotate < 0 0 PROTZ >
- translate < PUMPX PUMPY PUMPZ >
-
-
-
- bounded_by { sphere { < PUMPX PUMPY PUMPZ > 150 } }
- }
-
-
-
-
- /* lay down the floor */
-
- composite { the_floor
- scale < 0.5 0.5 0.5 >
- rotate < 90 -10 0 >
- translate < -175 -55 0 >
- }
-
-
- /* lay down the wall */
- /*
- composite { the_floor
- scale < 0.5 0.5 0.5 >
- //rotate < 65 0 0 >
- translate < -120 100 400 >
- }
- */
-