Code

moving trunk for module inkscape
[inkscape.git] / share / examples / istest.pov
1 /*#########################################################################
2 ##
3 ## File:  itest.pov
4 ## 
5 ## Authors:
6 ##   Bob Jamison
7 ##
8 ## Copyright (C) 2004 The Inkscape Organization
9 ##
10 ## Released under GNU GPL, read the file 'COPYING' for more information
11 ##
12 ###########################################################################
13 ##
14 ##  This simple file is provided to demonstrate POV output from Inkscape.
15 ##  PovRay output is intended for people who have had moderate experience
16 ##  with authoring POV files.  This is NOT for beginners.
17 ##
18 ##  To use:
19 ##  1)  Install PovRay, version 3.5 or above, and put the povray executable
20 ##      in your PATH.  PovRay is found at http://www.povray.org .  For
21 ##      PovRay-specific questions, please look there.  They are the experts.
22 ##
23 ##  2)  Copy this file to a working area.
24 ##
25 ##  3)  Make or load a document in Inkscape with some shapes in it.
26 ##
27 ##  4)  Save as a .pov file using the SaveAs dialog.  For this example, save
28 ##      it in the same directory as this file, with the name 'isshapes.pov'
29 ##
30 ##  5)  Execute povray with this file.  An example command would be:
31 ##
32 ##  povray +X +V +A +W320 +H320 +Iistest.pov +FN
33 ##
34 ##  6)  Adjust the values to suit your needs and desires.  Have fun.
35 ##
36 #########################################################################*/
38 /*#########################################################################
39 # Some standard PovRay scene additives
40 #########################################################################*/
42 #include "colors.inc"
43 #include "textures.inc"
44 #include "shapes.inc"
45 #include "metals.inc"
46 #include "skies.inc"
48 /*#########################################################################
49 # Note the Z-order differentation of the prisms in the object is
50 # normally just sufficient to display all of the objects, and
51 # avoid 'black spots' where surfaces are coincident.  This can
52 # be adjusted by changing the value below.
53 #########################################################################*/
55 /*
56 #declare AllShapes_Z_Increment = 0.008;
57 */
60 /*#########################################################################
61 # Note that the finish of the "all shapes" object exported
62 # at the end of the shapes file can be modified, by defining
63 # if before the #include.  Uncomment the following declaration
64 # to adjust it.  Have fun.
65 #########################################################################*/
67 /*
68 #declare AllShapes_Finish = finish {
69            phong 0.7
70            reflection 0.5
71            specular 0.8
72        }
73 */
75 /*#########################################################################
76 # Our Inkscape-exported shapes file
77 #########################################################################*/
79 #include "isshapes.pov"
81 /*#########################################################################
82 # Move the camera back in the -Z direction, about 1.5 times the width
83 # or height of the image.  This will provide about a 60-degree view.
84 # 'AllShapes' is an item in isshapes.pov, and refers to the union of
85 # all of the shapes exported.
86 #########################################################################*/
88 camera {
89     location <0, 0, -(AllShapes_WIDTH * 1.5)>
90     look_at  <0, 0, 0>
91     right x*image_width/image_height
92 }
94 /*#########################################################################
95 # Put one or two lights in front of the objects, and at an angle to
96 # the viewer.
97 #########################################################################*/
99 light_source { <-200,   1, -8000> color White}
100 light_source { < 200, 100,  -600> color White}
103 /*#########################################################################
104 # Make a pretty background, for contrast
105 #########################################################################*/
107 sky_sphere {
108     pigment {
109       gradient y
110       color_map {
111         [ 0.5  color CornflowerBlue ]
112         [ 1.0  color MidnightBlue   ]
113       }
114       scale 1000
115       translate -1
116     }
117   }
120 /*#########################################################################
121 # Now let us use our shapes.  We can include them individually, or include
122 # them as a group.  Notice that we have two AllShapes.  One plain, and
123 # an AllShapesZ.  The 'Z' version is different in that the shapes are
124 # shifted slightly higher in their order of creation, so that coincident
125 # shapes can be discerned.
126 #########################################################################*/
129 object {
130     /*
131     //## Individually
132     union{
133     object { droplet01       }
134     object { droplet02       }
135     object { droplet03       }
136     object { mountainDroplet }
137     }
138     */
140     //## As a group
141     object { AllShapes_Z }
144     translate<-AllShapes_CENTER_X, 0, -AllShapes_CENTER_Y>
145     scale  <  1,  60,   1>
146     rotate <-90,   0,   0>   //x first
147     rotate <  0,   0,   0>   //z second
148     rotate < 20,   0,   0>   //whatever else
149     rotate <  0, -27,   0>   //whatever else
151 }//object
155 /*#########################################################################
156 # End of File
157 #########################################################################*/