/********************************************************************************** Persistence of Vision Ray Tracer Scene Description File File name : TdG_CubeTile_mcr.inc Version : 3.6 / MegaPOV 1.0 Description : A macro for making a tiled floor of lozanges Date : July 2005 Author : Thomas A. M. de Groot E-mail : t.degroot@inter.nl.net Copyright (C) 2005. All rights reserved. **********************************************************************************/ #ifndef (Standalone) #declare Standalone = true; #end // true for testing, otherwise set to false in main script #if (Standalone) global_settings { assumed_gamma 1.0 ambient_light 0.01 noise_generator 2 } default { texture { pigment { rgb <1,0,0> } } } plane { y, -0.5 pigment {color rgb <0.7, 0.7, 0.7>}} camera { location <-0, 50, -20> sky <0.0, 1.0, 0.0> up <0.0, 1.0, 0.0> right x*image_width/image_height angle 28 look_at <0, 0, 0> } light_source { <-50, 50, 50> color rgb 2.0 } #end // end of if Standalone //==================================================================================== // Start of the macro: // ------------------ #macro TileFloor () #ifndef (Moray) #local Moray = false; #end //==================================================================================== // Textures: // -------- #ifndef (Tex01) #local Tex01 = texture {pigment {rgb <1, 0, 0>}} #end #ifndef (Tex02) #local Tex02 = texture {pigment {rgb <0, 1, 0>}} #end #ifndef (Tex03) #local Tex03 = texture {pigment {rgb <0, 0, 1>}} #end #ifndef (Tex04) #local Tex04 = texture {pigment {rgb <1, 1, 0>}} #end #ifndef (Tex05) #local Tex05 = texture {pigment {rgb <0, 1, 1>}} #end //==================================================================================== // Tile definitions: // ---------------- #local HalfTileAxis = 0.866025; #local BorderAdd = 0.06; #local Tile01 = mesh2 { vertex_vectors { 9, <1.49905, 0, 0>, <-0.00095439, 0, -0.866025>, <-0.000954419, 0, 0.866025>, <-1.49905, -1.22461e-016, 0>, <0, 0.1, 0>, <-0.000954419, 0.1, 0.866025>, <1.49905, 0.1, 0>, <-1.49905, 0.1, 0>, <-0.00095439, 0.1, -0.866025> } uv_vectors { 42, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 1>, <1, 1>, <0, 0>, <1, 1>, <1, 0>, <0, 0>, <0, 1>, <1, 1>, <0, 0>, <1, 1>, <1, 0>, <0, 0>, <0, 1>, <1, 1>, <0, 0>, <1, 1>, <1, 0>, <0, 0>, <0, 1>, <1, 1>, <0, 0>, <1, 1>, <1, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0> } texture_list { 1, texture { Tex01 } } face_indices { 14, <6, 4, 5>, 0, <7, 4, 5>, 0, <6, 8, 4>, 0, <7, 8, 4>, 0, <2, 0, 6>, 0, <2, 6, 5>, 0, <2, 3, 7>, 0, <2, 7, 5>, 0, <0, 1, 8>, 0, <0, 8, 6>, 0, <3, 1, 8>, 0, <3, 8, 7>, 0, <2, 0, 1>, 0, <2, 1, 3>, 0 } uv_indices { 14, <0, 1, 2>, <3, 4, 5>, <6, 7, 8>, <9, 10, 11>, <12, 13, 14>, <15, 16, 17>, <18, 19, 20>, <21, 22, 23>, <24, 25, 26>, <27, 28, 29>, <30, 31, 32>, <33, 34, 35>, <36, 37, 38>, <39, 40, 41> } translate -(HalfTileAxis + BorderAdd)*z } #local Tile02 = mesh2 { vertex_vectors { 9, <1.49905, 0, 0>, <-0.00095439, 0, -0.866025>, <-0.000954419, 0, 0.866025>, <-1.49905, -1.22461e-016, 0>, <0, 0.1, 0>, <-0.000954419, 0.1, 0.866025>, <1.49905, 0.1, 0>, <-1.49905, 0.1, 0>, <-0.00095439, 0.1, -0.866025> } uv_vectors { 42, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 1>, <1, 1>, <0, 0>, <1, 1>, <1, 0>, <0, 0>, <0, 1>, <1, 1>, <0, 0>, <1, 1>, <1, 0>, <0, 0>, <0, 1>, <1, 1>, <0, 0>, <1, 1>, <1, 0>, <0, 0>, <0, 1>, <1, 1>, <0, 0>, <1, 1>, <1, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0> } texture_list { 1, texture { Tex02 } } face_indices { 14, <6, 4, 5>, 0, <7, 4, 5>, 0, <6, 8, 4>, 0, <7, 8, 4>, 0, <2, 0, 6>, 0, <2, 6, 5>, 0, <2, 3, 7>, 0, <2, 7, 5>, 0, <0, 1, 8>, 0, <0, 8, 6>, 0, <3, 1, 8>, 0, <3, 8, 7>, 0, <2, 0, 1>, 0, <2, 1, 3>, 0 } uv_indices { 14, <0, 1, 2>, <3, 4, 5>, <6, 7, 8>, <9, 10, 11>, <12, 13, 14>, <15, 16, 17>, <18, 19, 20>, <21, 22, 23>, <24, 25, 26>, <27, 28, 29>, <30, 31, 32>, <33, 34, 35>, <36, 37, 38>, <39, 40, 41> } translate -(HalfTileAxis + BorderAdd)*z rotate -120*y } #local Tile03 = mesh2 { vertex_vectors { 9, <1.49905, 0, 0>, <-0.00095439, 0, -0.866025>, <-0.000954419, 0, 0.866025>, <-1.49905, -1.22461e-016, 0>, <0, 0.1, 0>, <-0.000954419, 0.1, 0.866025>, <1.49905, 0.1, 0>, <-1.49905, 0.1, 0>, <-0.00095439, 0.1, -0.866025> } uv_vectors { 42, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 1>, <1, 1>, <0, 0>, <1, 1>, <1, 0>, <0, 0>, <0, 1>, <1, 1>, <0, 0>, <1, 1>, <1, 0>, <0, 0>, <0, 1>, <1, 1>, <0, 0>, <1, 1>, <1, 0>, <0, 0>, <0, 1>, <1, 1>, <0, 0>, <1, 1>, <1, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0>, <0, 0> } texture_list { 1, texture { Tex03 } } face_indices { 14, <6, 4, 5>, 0, <7, 4, 5>, 0, <6, 8, 4>, 0, <7, 8, 4>, 0, <2, 0, 6>, 0, <2, 6, 5>, 0, <2, 3, 7>, 0, <2, 7, 5>, 0, <0, 1, 8>, 0, <0, 8, 6>, 0, <3, 1, 8>, 0, <3, 8, 7>, 0, <2, 0, 1>, 0, <2, 1, 3>, 0 } uv_indices { 14, <0, 1, 2>, <3, 4, 5>, <6, 7, 8>, <9, 10, 11>, <12, 13, 14>, <15, 16, 17>, <18, 19, 20>, <21, 22, 23>, <24, 25, 26>, <27, 28, 29>, <30, 31, 32>, <33, 34, 35>, <36, 37, 38>, <39, 40, 41> } translate -(HalfTileAxis + BorderAdd)*z rotate 120*y } //==================================================================================== // Tile group definition: // --------------------- #local TileWidth = 1.5; #local TileHeight = 1.7304; #local BorderWidth = 0.1; // Group of three tiles: #local TileGroup = union { object {Tile01} object {Tile02} object {Tile03} } //==================================================================================== // Tiled floor declarations: // ------------------------ #ifndef (Xstart) #local Xstart = -11; #end #ifndef (Zstart) #local Zstart = -5; #end #ifndef (Xn) #local Xn = 5; #end // number of times the tile group is to be reproduced along the x-axis #ifndef (Zn) #local Zn = 4; #end // number of times the tile group is to be reproduced along the z-axis #ifndef (FloorBorder) #local FloorBorder = 0.5; #end // width of the border around the floor #ifndef (FloorScale) #local FloorScale = 1; #end #local Xend = Xstart + Xn * (2 * (TileWidth + BorderWidth)); #local Zend = Zstart + Zn * (HalfTileAxis + TileHeight + (3 * BorderAdd)); #local Z = Zstart + (HalfTileAxis + BorderAdd); #local Off = true; //==================================================================================== // Floor calculation: // ----------------- union { // The seams: box { , texture {Tex04} } // The floor border: box { , texture {Tex05} } // The tiles: union { #while (Z < Zend + 1) #if (Off = true) #local X = Xstart + TileWidth + BorderWidth; #local Off = false; #else #local X = Xstart; #local Off = true; #end // end of if Off #while (X < Xend + 1) object {TileGroup translate } #local X = X + 2*(TileWidth + BorderWidth); #end // end of while X #local Z = Z + TileHeight + HalfTileAxis + (3 * BorderAdd); #end // end of while Z // The box cutting the tiles to floor proportion: clipped_by { box { , } } bounded_by { clipped_by } }// end of union scale #if (Moray) scale <1, 1, -1> rotate <90, 0, 0> #end // end of if Moray } //end of union #end // end of macro //==================================================================================== // The floor: // --------- #if (Standalone) #include "TexturesExtra.inc" //#declare Tex01 = texture{CanPPol1 scale 0.1} //#declare Tex02 = texture{SGrayPol1 scale 0.1} //#declare Tex03 = texture{MohoganyPol1 scale 0.1} //#declare Tex04 = texture{ImpalaPol1 scale 0.1} //#declare Tex05 = texture{IndiaBPol1 scale 0.1} #declare Xstart = -11; #declare Zstart = -5; #declare Xn = 7; // number of times the tile group is to be reproduced along the x-axis #declare Zn = 4; // number of times the tile group is to be reproduced along the z-axis #declare FloorBorder = 0.5; // width of the border around the floor #declare FloorScale = 1; object { TileFloor () translate 6.5*z } #declare Tex01 = texture{CanPPol1 scale 0.1} #declare Tex02 = texture{SGrayPol1 scale 0.1} #declare Tex03 = texture{MohoganyPol1 scale 0.1} #declare Tex04 = texture{IndiaBPol1 scale 0.1} #declare Tex05 = texture{ImpalaPol1 scale 0.1} object { TileFloor () translate -6.5*z } #end // end of if Standalone