// This work is licensed under the Creative Commons Attribution 3.0 Unported License. // To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ // or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, // California, 94041, USA. // Persistence Of Vision Raytracer sample file. // A tiling pattern demo scene by Samuel Benge // This version adds the possibility for the tiling of textures instead of colors (TdG January 2016) /****************************************************************************** * $File: //depot/povray/smp/distribution/scenes/textures/patterns/tiling.pov $ * $Revision: #2 $ * $Change: 5430 $ * $DateTime: 2011/03/21 10:42:00 $ * $Author: jholsenback $ *****************************************************************************/ #version 3.7; global_settings {assumed_gamma 1.0} background {rgb 1} camera {location <0,10,-10> look_at <0,0,0> right x*image_width/image_height} light_source {<0, 30, -30> color rgb 1} #include "colors.inc" #include "stones1.inc" #include "math.inc" #include "strings.inc" // see the documentaion for possible patterns and types #declare TilingPattern = 27; #declare TileTypes = 2; // select tiling of colors (yes) or of textures (no) #declare ColorMode = no; // change to yes to write the color_map to a text file #declare WriteMap = yes; // 0 = caulk off // 1 = caulk at every color // TileTypes = caulk at n TileTypes #declare CaulkAt = 1; #declare CaulkSize = 0.1; #declare CaulkColor = White; #declare CaulkTex = texture {pigment {White}}; #if (ColorMode) #declare ColorArray = array[12]{ Red, White, Green, Yellow, Blue, Cyan, IndianRed, Pink, DarkGreen, Turquoise, Violet, BlueViolet }; #if (WriteMap) #fopen MapFile "tilemap.txt" write #write (MapFile, "texture {\n pigment {\n tiling ",TilingPattern, "\n color_map {\n") #end plane{y, 0 texture{ pigment{ tiling TilingPattern color_map{ #declare V=0; #declare V2 = 0; #while(V]\n") #write (MapFile, " [", str((V2+incre)/TileTypes,5,4)," rgb <", vstr(3, ThisColor,", ", 0,4),">]\n") #end #declare V = V + 1; #declare V2 = V2 + incre; #end } } } } #if (WriteMap) #write (MapFile, " }\n }\n}\n") #fclose MapFile #end //-------------------------------------------------------------------------------------------------------------------------- #else #declare TexArray = array[12]{ "T_Stone1", "T_Stone2", "T_Stone3", "T_Stone4", "T_Stone5", "T_Stone6", "T_Stone7", "T_Stone8", "T_Stone9", "T_Stone10", "T_Stone11", "T_Stone12" }; //texture{Parse_String(TexArray[0])} #if (WriteMap) #fopen MapFile "tilemap.txt" write #write (MapFile, "texture {\n tiling ",TilingPattern, "\n texture_map {\n") #end plane {y, 0 texture{ tiling TilingPattern texture_map { #declare V=0; #declare V2 = 0; #while(V