/**********************************************************************************/ // Persistence of Vision Ray Tracer Scene Description File // File name : RandWall_mcr.pov // Version : 3.6 // Description : Macro for building a stone wall with random stones // Date : August/30/2003 // Update : November 2004 // Author : Thomas A. M. de Groot // E-mail : t.degroot@inter.nl.net // Copyright (C) 2004. All rights reserved. /**********************************************************************************/ #version 3.6; #ifndef (Standalone) #declare Standalone = true; #end // see after macro definition #include "rand.inc" global_settings { assumed_gamma 1.0 noise_generator 2 } default {texture {pigment { rgb <1,0,0> }}} //========================================================================================================= // Macro definition: #macro RandWall (TotLength, TotHeight, MinStoneHeight, MaxStoneHeight, StoneWidth, Space, Cdepth, Object1, Object2, Object3, Object4, StoneTex, Cement, Moray, Stream) #local Seed = seed (Stream); #local Y = RRand(MinStoneHeight, MaxStoneHeight, Seed); #local MinStoneLength = 3*Y; #local MaxStoneLength = 13*Y; #local StoneMin = 1; #local StoneMax = 5; #local L = 0; #local H = 0; #declare Wall = union { box {<0, 0, Cdepth>, material {Cement} } #while (H < TotHeight) #while (L < TotLength) #local StoneLength = RRand (MinStoneLength, MaxStoneLength, Seed); #local L1 = L + StoneLength + Space; //---------------------------------------------- selection of stone -------------------------------------- #local T = RRand(StoneMin, StoneMax, Seed); #local T = int(T); #switch (T) #case (1) #local Stone = object {Stone1} #break #case (2) #local Stone = object {Stone2} #break #case (3) #local Stone = object {Stone3} #break #case (4) #local Stone = object {Stone4} #end //-------------------------------------------------------------------------------------------------------- #if (L1 > TotLength) #local StoneLength = TotLength - L; object {Stone scale translate material {StoneTex translate rand(Seed)}} #else object {Stone scale translate material {StoneTex translate rand(Seed)}} #end //end if L1 #local L = L1; //#debug concat("Stone", str(T,1,0), " length ", str(StoneLength,0,2), " L ", str(L,0,2), " \n") #end //end while L #local H1 = H + Y + Space; #if (H1 > TotHeight) #local Y = TotHeight - H; #local L = 0; #else #local Y = RRand (MinStoneHeight, MaxStoneHeight, Seed); #local L = 0; #end //end if H1 #local H = H1; #end //end while H } //end Wall union // Transform for Moray. #if (Moray) #declare Wall = object {Wall scale <1,1,-1> rotate <90,0,0> } #end //end if Moray #end //end of macro //========================================================================================================= #if (Standalone) #include "colors.inc" #include "stones.inc" camera { location <0.0, 5, -30.0> direction 1*z right x*image_width/image_height look_at <0.0, 5, 0.0> } sky_sphere { pigment { gradient y color_map { [0.0 rgb <0.6,0.7,1.0>] [0.7 rgb <0.0,0.1,0.8>] } } } light_source { <0, 0, 0> // light's position (translated below) color rgb <1, 1, 1> // light's color translate <-30, 30, -30> } // ---------------------------------------- plane { y, 0 pigment { color rgb <0.7,0.5,0.3> } } // ---------------------------------------- #declare BrickStandalone = false; // this switches off the standalone feature of Bricks.pov #declare BrickTex = texture {T_Stone4} // texture for mesh2 object(s) #include "Bricks.pov" // this is the file with mesh2 bricks // the original stone should be a cube with its origin at the front lower left corner. // make necessary transformations here. #declare Stone0 = object {Irregular_brick scale <0.5, 2, 1>} // here, the same object is used 4x: #declare Stone1 = object {Stone0 translate 0.5} #declare Stone2 = object {Stone0 rotate 180*y translate 0.5} #declare Stone3 = object {Stone0 rotate 180*z translate 0.5} #declare Stone4 = object {Stone0 rotate <0,180,180> translate 0.5} // ---------------------------------------- // alternative, simple example: //#declare Stone0 = box {<0, 0, 0>,<1, 1, 1> } //#declare Stone1 = object {Stone0} //#declare Stone2 = object {Stone0} //#declare Stone3 = object {Stone0} //#declare Stone4 = object {Stone0} // ---------------------------------------- // in case you do not use mesh2 objects, you need this: #declare Tex1 = material {texture {T_Stone4}} // texture for the cement between the stones: #declare Tex2 = material {texture {T_Stone10}} #declare Length = 100; //usage: RandWall (Length, // TotLength: Total length of the wall 17.0, // TotHeight: Total height of the wall 0.5, // MinStoneHeight: Minimum stone height 1.8, // MaxStoneHeight: Maximum stone height 1.0, // StoneWidth: Width of the stone 0.1, // Space: Space between stones 0.1, // Cdepth: Cement depth Stone1, // Object: Type of stone Stone2, // Object: Type of stone Stone3, // Object: Type of stone Stone4, // Object: Type of stone Tex1, // StoneTex: Texture of the individual stones (not mesh2) Tex2, // Cement: Texture of the cement between the tones false, // Moray: Transformation for Moray yes or no 7432 // Stream: Random number seed ) object {Wall scale 1 rotate -0*y translate <-Length/2, 0, 0> } #declare TotHeight = 17.6; /* cylinder { <0, 0, -1>, <0, TotHeight+2, -1>, 0.1 } cylinder { <-100, TotHeight, -1>, <2, TotHeight, -1>, 0.1 } */ #end //end of Standalone