// PhotoCube.pov - Demonstration of mapping 6 textures onto the face of a cube. // Note Moray coordinate system used. camera { // Camera StdCam location <-3.5, -3.5, 2> direction <0.0, 0.0, 1.7439> sky <0.0, 0.0, 1.0> // Use right handed-system! up <0.0, 0.0, 1.0> // Where Z is up right <1.33333, 0.0, 0.0> look_at <0,0,0> } // ******* L I G H T S ******* light_source { // Light1 <0, -12.596, 6.781> color rgb <1.000, 1.000, 1.000> } // Macro declaration #macro TextureCube(PText) texture { radial texture_map { [0.0 radial texture_map { [0.000 PText[1]] [0.125 PText[1]] [0.125 PText[2] rotate <-90,90,0>] [0.375 PText[2] rotate <-90,90,0>] [0.375 PText[3]] [0.625 PText[3]] [0.625 PText[4] rotate <-90,90,0>] [0.875 PText[4] rotate <-90,90,0>] [0.875 PText[1]] [1.000 PText[1]] } rotate <90,0,0> ] [0.125 radial texture_map { [0.000 PText[1]] [0.125 PText[1]] [0.125 PText[2] rotate <-90,90,0>] [0.375 PText[2] rotate <-90,90,0>] [0.375 PText[3]] [0.625 PText[3]] [0.625 PText[4] rotate <-90,90,0>] [0.875 PText[4] rotate <-90,90,0>] [0.875 PText[1]] [1.000 PText[1]] } rotate <90,0,0> ] [0.125 radial texture_map { [0.000 PText[2]] [0.125 PText[2]] [0.125 PText[5]] [0.375 PText[5]] [0.375 PText[4]] [0.625 PText[4]] [0.625 PText[0]] [0.875 PText[0]] [0.875 PText[2]] [1.000 PText[2]] } rotate <0,0,90> ] [0.375 radial texture_map { [0.000 PText[2]] [0.125 PText[2]] [0.125 PText[5]] [0.375 PText[5]] [0.375 PText[4]] [0.625 PText[4]] [0.625 PText[0]] [0.875 PText[0]] [0.875 PText[2]] [1.000 PText[2]] } rotate <0,0,90> ] [0.375 radial texture_map { [0.000 PText[1]] [0.125 PText[1]] [0.125 PText[2] rotate <-90,90,0>] [0.375 PText[2] rotate <-90,90,0>] [0.375 PText[3]] [0.625 PText[3]] [0.625 PText[4] rotate <-90,90,0>] [0.875 PText[4] rotate <-90,90,0>] [0.875 PText[1]] [1.000 PText[1]] } rotate <90,0,0> ] [0.626 radial texture_map { [0.000 PText[1]] [0.125 PText[1]] [0.125 PText[2] rotate <-90,90,0>] [0.375 PText[2] rotate <-90,90,0>] [0.375 PText[3]] [0.625 PText[3]] [0.625 PText[4] rotate <-90,90,0>] [0.875 PText[4] rotate <-90,90,0>] [0.875 PText[1]] [1.000 PText[1]] } rotate <90,0,0> ] [0.625 radial texture_map { [0.000 PText[2]] [0.125 PText[2]] [0.125 PText[5]] [0.375 PText[5]] [0.375 PText[4]] [0.625 PText[4]] [0.625 PText[0]] [0.875 PText[0]] [0.875 PText[2]] [1.000 PText[2]] } rotate <0,0,90> ] [0.875 radial texture_map { [0.000 PText[2]] [0.125 PText[2]] [0.125 PText[5]] [0.375 PText[5]] [0.375 PText[4]] [0.625 PText[4]] [0.625 PText[0]] [0.875 PText[0]] [0.875 PText[2]] [1.000 PText[2]] } rotate <0,0,90> ] [0.875 radial texture_map { [0.000 PText[1]] [0.125 PText[1]] [0.125 PText[2] rotate <-90,90,0>] [0.375 PText[2] rotate <-90,90,0>] [0.375 PText[3]] [0.625 PText[3]] [0.625 PText[4] rotate <-90,90,0>] [0.875 PText[4] rotate <-90,90,0>] [0.875 PText[1]] [1.000 PText[1]] } rotate <90,0,0> ] [1.000 radial texture_map { [0.000 PText[1]] [0.125 PText[1]] [0.125 PText[2] rotate <-90,90,0>] [0.375 PText[2] rotate <-90,90,0>] [0.375 PText[3]] [0.625 PText[3]] [0.625 PText[4] rotate <-90,90,0>] [0.875 PText[4] rotate <-90,90,0>] [0.875 PText[1]] [1.000 PText[1]] } rotate <90,0,0> ] } } #end // End of macro declaration #declare Cubetext = array[6] #declare Cubetext[0] = texture { pigment { colour rgb <1,0,0> } normal { quilted // This normal gives a slightly rounde edge to the cube. control0 1 control1 1 scale 2 translate <1,1,1> } finish { ambient 0.3 diffuse 0.7 phong 0.4 phong_size 15 } } #declare Cubetext[1] = texture { pigment { colour rgb <1,1,0> } normal { quilted control0 1 control1 1 scale 2 translate <1,1,1> } finish { ambient 0.3 diffuse 0.7 phong 0.4 phong_size 40 } } #declare Cubetext[2] = texture { pigment { colour rgb <1,0,1> } normal { quilted control0 1 control1 1 scale 2 translate <1,1,1> } finish { ambient 0.3 diffuse 0.7 phong 0.4 phong_size 15 } } #declare Cubetext[3] = texture { pigment { colour rgb <0,1,0> } normal { quilted control0 1 control1 1 scale 2 translate <1,1,1> } finish { ambient 0.3 diffuse 0.7 phong 0.4 phong_size 15 } } #declare Cubetext[4] = texture { pigment { colour rgb <0,0,1> } normal { quilted control0 1 control1 1 scale 2 translate <1,1,1> } finish { ambient 0.3 diffuse 0.7 phong 0.4 phong_size 15 } } #declare Cubetext[5] = texture { pigment { colour rgb <0,1,1> } normal { quilted control0 1 control1 1 scale 2 translate <1,1,1> } finish { ambient 0.3 diffuse 0.7 phong 0.4 phong_size 15 } } box { <-1,-1,-1>, <1,1,1> TextureCube(Cubetext) rotate <0,clock*720,clock*360> }