/********************************************************************************** Persistence of Vision Ray Tracer Scene Description File File name : DH_WoodFloor_2.pov Version : 3.6 Description : Macro for making a wooden board floor in version 2 the texture has been changed to a patterned one Date : October 2004; version 2: 31 March 2008 Author : Dan B. Hentschel Adapted : Thomas de Groot (03-2008) E-mail : Povray newsgroup Copyright (C) 2004. All rights reserved. **********************************************************************************/ #ifndef (Standalone) #declare Standalone = true; #end #include "rand.inc" #macro Woodmap1(r,g,b) [0.0, 0.1 color rgb <0.88*r, 0.60*g, 0.40*b> color rgb <0.88*r, 0.60*g, 0.40*b>] [0.1, 0.9 color rgb <0.88*r, 0.60*g, 0.40*b> color rgb <0.60*r, 0.30*g, 0.20*b>] [0.9, 1.0 color rgb <0.60*r, 0.30*g, 0.20*b> color rgb <0.60*r, 0.30*g, 0.20*b>] #end #macro Woodmap2(r,g,b) [0.0, 0.1 color rgbt <0.55*r, 0.32*g, 0.20*b, 0.100> color rgbt <0.55*r, 0.32*g, 0.20*b, 0.500>] [0.1, 0.2 color rgbt <0.55*r, 0.35*g, 0.20*b, 0.650> color rgbt <0.88*r, 0.60*g, 0.40*b, 0.975>] [0.2, 0.3 color rgbt <0.88*r, 0.60*g, 0.40*b, 0.975> color rgbt <0.60*r, 0.30*g, 0.20*b, 1.000>] [0.3, 0.4 color rgbt <0.60*r, 0.30*g, 0.20*b, 0.100> color rgbt <0.60*r, 0.30*g, 0.20*b, 0.500>] [0.4, 0.9 color rgbt <0.60*r, 0.30*g, 0.20*b, 0.650> color rgbt <0.88*r, 0.60*g, 0.40*b, 0.975>] [0.9, 1.0 color rgbt <0.88*r, 0.60*g, 0.40*b, 0.975> color rgbt <0.55*r, 0.32*g, 0.20*b, 1.000>] #end #declare Woodpig1 = pigment { wood turbulence 0.04 octaves 3 scale <0.05, .05, 1>*0.2 } #declare Woodnor1 = normal { wood turbulence 0.04 octaves 3 scale <0.05, .05, 1>*0.2 } #declare Woodpig2 = pigment { wood turbulence <0.1, 0.5, 1> octaves 5 lambda 3.25 scale <0.15, .5, 1>*0.2 rotate <5, 10, 5>*0.05 translate -x*2 } #declare Woodnor2 = normal { wood turbulence <0.1, 0.5, 1> octaves 5 lambda 3.25 scale <0.15, .5, 1>*0.2 rotate <5, 10, 5>*0.05 translate -x*2 } #declare floor_sd=seed(12); //========================================================================changed by TdG #macro wood_floor_texture(r,g,b,Tscale) #if (simple_blocks) pigment { color rgb <0.88*r, 0.60*g, 0.40*b> } #else #local tex_scale = (0.8 + rand(floor_sd)); #local tex_rotate = RRand(-0.5, 0.5, floor_sd); #local tex_translate = rand(floor_sd)*5; #local WM1 = color_map {Woodmap1(r,g,b)}; #local WM2 = color_map {Woodmap2(r,g,b)}; #local WoodLayer_dull = texture { pigment { Woodpig1 color_map { WM1 } } normal {Woodnor1} finish { specular 0.05 roughness 0.003 ambient 0 diffuse 0.4 } scale tex_scale rotate tex_rotate translate tex_translate } texture { pigment { Woodpig2 color_map { WM2 } } normal {Woodnor1} finish { specular 0.05 roughness 0.003 ambient 0 diffuse 0.4 } scale tex_scale rotate tex_rotate translate tex_translate } #local WoodLayer_shiny = texture { pigment { Woodpig1 color_map { WM1 } } normal {Woodnor2} finish { specular 0.9 roughness 0.005 ambient 0 diffuse 0.6 } scale tex_scale rotate tex_rotate translate tex_translate } texture { pigment { Woodpig2 color_map { WM2 } } normal {Woodnor2} finish { specular 0.9 roughness 0.005 ambient 0 diffuse 0.6 } scale tex_scale rotate tex_rotate translate tex_translate } #local Patterned_wood = material { texture { pigment_pattern { wood turbulence 0.04 octaves 3 scale <0.05, .05, 1>*0.1 pigment_map { [0.0 color rgb <0.0, 0.0, 0.0>] [1.0 color rgb <1.0, 1.0, 1.0>] } scale <0.2, 2.5, 0.2>*0.2 } texture_map { [0.0 WoodLayer_dull] [1.0 WoodLayer_shiny] } } } material {Patterned_wood scale Tscale} #end //of if #end //of macro #macro wood_floor(board_spacing, board_width, board_length, nails, floor_left, floor_right, floor_start, floor_end, Tscale) union { #local x_pos = floor_left; #while (x_pos < floor_right) #local rd = RRand(0, 99, floor_sd); #local rd2 = 0; #while (rd2 <= rd) #local rd = RRand(0, 99, floor_sd); #local floor_rd = seed(rd); #local rd2=rd2+1; #end #local first_board = RRand(board_length*0.1, board_length*1,floor_rd); #local z_pos = floor_start; #while (z_pos <= floor_end) #local board_lighten = rand(floor_sd)*0.3+0.85; #if (first_board | 0) box { wood_floor_texture( (rand(floor_sd)*0.1+0.95)*board_lighten, (rand(floor_sd)*0.1+0.95)*board_lighten, (rand(floor_sd)*0.1+0.95)*board_lighten, Tscale ) } #local z_pos = z_pos + first_board + board_spacing; #local first_board = 0; #else #if (z_pos+board_length>floor_end) box { wood_floor_texture( (rand(floor_sd)*0.1+0.95)*board_lighten, (rand(floor_sd)*0.1+0.95)*board_lighten, (rand(floor_sd)*0.1+0.95)*board_lighten, Tscale ) } #else box { wood_floor_texture( (rand(floor_sd)*0.1+0.95)*board_lighten, (rand(floor_sd)*0.1+0.95)*board_lighten, (rand(floor_sd)*0.1+0.95)*board_lighten, Tscale ) } #end //end of if z_pos+board_length #local z_pos = z_pos + board_length + board_spacing; #end //end of if first_board #end //end of while z_pos #local x_pos = x_pos + board_width + board_spacing; #end //end of while x_pos } #end //end of macro //========================================================================================= #if (Standalone) #include "rad_def.inc" global_settings { assumed_gamma 1.0 radiosity {Rad_Settings (Radiosity_OutdoorLight, off, off)} } plane { y, -0.5 pigment {rgb 0.2} } sphere {0, 1 pigment {rgb <0.733333, 0.733333, 1.00000>} scale 1000 hollow } light_source{<0,100,-100> color rgb 1} light_source{<0,10,100> color rgb 0.2 shadowless} camera{ location<0, 15, -30> look_at<0, 0, 0> up y right x*image_width/image_height } #declare do_board_floor = true; #declare simple_blocks = false; #declare left_wall = -25; #declare right_wall = 25; #declare back_wall = -25; #declare front_wall = 25; #declare Tscale = 0.9; #if (do_board_floor) object { wood_floor( 0.005, // board_spacing [0.005] 1.5, // board_width 8, // board_length 0, // nails (not implemented) left_wall, // floor_left right_wall, // floor_right back_wall, // floor_start front_wall, // floor_end Tscale // general scaling of final texture ) rotate 30*y } #else box { wood_floor_texture(1,1,1) } #end #end // end of Standalone //=========================================================================================