home *** CD-ROM | disk | FTP | other *** search
- // Persistence of Vision Raytracer
- // Sample file
- // By Dan Farmer
-
- { lily1.dat PvRay Script January 26, '91
- By Dan Farmer
- 1001 e. 80th Street, Apt #102
- Minneapolis, mn 55425
-
- Renders a water lily & pad on a pond.
-
- }
-
- #include "shapes.dat"
- #include "colors.dat"
- #include "textures.dat"
-
- { a speckled yellow texture }
- #declare StamenTexture = texture
- bumps 0.3
- granite 0.5
- color_map
- [0.00 0.40 color Yellow color Yellow]
- [0.40 0.50 color Gold color Wheat]
- [0.50 1.001 color Wheat color Yellow]
- end_color_map
- scale <0.5 0.5 0.5>
- end_texture
-
- #declare Petal = object
- { Creates a shape like a wedge of orange peel
- With the main axis is in the z plane, rotated upward on the x axis.
-
- ^
- / \ ^
- / \ |
- / \ y
- / \ |
- --_ _-- v
- --_ _ --
- -- <- x ->
- }
- intersection
- sphere <0.0 0.0 0.0> 30.0 end_sphere
- sphere <0.0 0.0 0.0> 29.9 inverse end_sphere
- plane <-1.0 0.0 0.0> 0.0 rotate <0.0 0.0 -45.0> end_plane
- plane <1.0 0.0 0.0> 0.0 rotate <0.0 0.0 45.0> end_plane
- end_intersection
- texture
- color White
- end_texture
- color White
- rotate <-20.0 0.0 0.0>
- end_object
-
- { Rotate the petals around the center point to create the flower composite}
- #declare PetalLayer1 = composite
- object Petal translate <0.0 0.0 30.0> end_object
- object Petal translate <0.0 0.0 30.0> rotate < 0.0 -45.000000 0.0 > end_object
- object Petal translate <0.0 0.0 30.0> rotate < 0.0 -90.000000 0.0 > end_object
- object Petal translate <0.0 0.0 30.0> rotate < 0.0 -135.000000 0.0 > end_object
- object Petal translate <0.0 0.0 30.0> rotate < 0.0 180.000000 0.0 > end_object
- object Petal translate <0.0 0.0 30.0> rotate < 0.0 -225.000000 0.0 > end_object
- object Petal translate <0.0 0.0 30.0> rotate < 0.0 -270.000000 0.0 > end_object
- object Petal translate <0.0 0.0 30.0> rotate < 0.0 -315.000000 0.0 > end_object
- object sphere <0.0 -6.0 0.0> 15.0 end_sphere
- color Yellow
- texture StamenTexture end_texture
- end_object
- rotate <0.0 -22.5 0.0> { rotate 1/2 of the 45 degree step }
- end_composite
-
- {******************************************************************************}
- { You }
- view_point
- location <20.0 120.0 -170.0>
- direction <0.0 0.0 1.0>
- up <0.0 1.0 0.0>
- right <1.33333 0.0 0.0>
- look_at <0.0 0.0 -30.0>
- end_view_point
-
- { The Sun}
- object
- sphere <0.0 0.0 0.0> 2.0 end_sphere
- translate <10.0 200.0 -150.0>
- texture
- colour red 1.0 green 1.0 blue 1.0
- ambient 1.0
- diffuse 0.0
- end_texture
- colour red 1.0 green 1.0 blue 1.0
- light_source
- end_object
-
- { The pond }
- object
- plane <0.0 1.0 0.0> 0.0 end_plane
- color CBlue
- texture
- color CBlue
- waves 0.3
- frequency 100.0
- scale <1000.0 1000.0 1000.0>
- end_texture
- end_object
-
- { Create a somewhat rounded lily-pad with the split in one end, and a
- "cleavage-line" down the center }
- object
- union
- quadric QSphere
- scale <45.0 5.0 25.0>
- translate <45.0 0.0 0.0>
- end_quadric
- quadric QSphere
- scale <45.0 5.0 25.0>
- translate <45.0 0.0 0.0>
- rotate <0.0 -20.0 0.0>
- end_quadric
- translate <0.0 0.0 0.0>
- end_union
- translate <-45.0 0.0 -10.0>
- scale <2.5 2.5 2.5>
- texture
- color CGreen
- end_texture
- end_object
-
- { Now, put it all together.}
- composite PetalLayer1 translate <15.0 45.0 -10.0> end_composite
-