//Displaying some cubes using POV-Ray //Load some interesting colors and textures #include "colors.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "woods.inc" //Describe the location of the camera and where it is aimed camera { location <3,3,-5> look_at <0,0,0> } //Define a background color background { color White } //Describe the location and color of the light source light_source { <3,4,-3> color White*3 } //Define the coordinates of the eight vertices #declare p1 = <-1,-1,-1> #declare p2 = <-1,-1,1> #declare p3 = <-1,1,-1> #declare p4 = <-1,1,1> #declare p5 = <1,-1,-1> #declare p6 = <1,-1,1> #declare p7 = <1,1,-1> #declare p8 = <1,1,1> //Define the polygons for each of the six sides. //Notice that the last point must be a repetition of the first. //The number "5" indicates how many points will be listed. #declare f1 = polygon { 5, p1, p2, p4, p3, p1 } #declare f2 = polygon { 5, p5, p6, p8, p7, p5 } #declare f3 = polygon { 5, p1, p2, p6, p5, p1 } #declare f4 = polygon { 5, p3, p4, p8, p7, p3 } #declare f5 = polygon { 5, p1, p3, p7, p5, p1 } #declare f6 = polygon { 5, p2, p4, p8, p6, p2 } //Define the cube to be the union of its faces. #declare mycube = union { object{f1} object{f2} object{f3} object{f4} object{f5} object{f6} } //Give the cube some texture. #declare cube1 = object { mycube texture { T_Wood1 } } //Define the second cube to be a translation of the first. //Give it some texture. #declare cube2 = object { mycube translate <1,1,1> texture { T_Silver_3B } } //Define a horizontal plane on which to place the cubes (optional). #declare table = object { plane { <0,1,0>,-1 texture { T_Stone7 } } } //List the objects to display cube1 cube2 table