#version 3.7; #include "colors.inc" #include "functions.inc" #include "rad_def.inc" #include "math.inc" #include "textures.inc" #include "stars.inc" #include "skies.inc" #declare myMode = 0; // 0: Animation, 1...n Shots #if(final_frame) #declare myClock = frame_number/final_frame; #else #declare myClock = 0.5; #end #declare smoothClock = (sin(myClock*pi-pi/2)+1)/2; //#warning concat("Frame: ",str(frame_number,3,3)) #declare myRadius = 19; #declare Rnd_1 = seed (1150); #declare eyeHeight = 1.80; #declare distanceCam = 4 + smoothClock*6; #declare cameraRotationClock = smoothClock + 1/24; #declare myRadiusM = myRadius-1; //#declare cameraLocation = <0,eyeHeight,-myRadiusM+myClock*2*myRadiusM>; #declare cameraLocation = <0,eyeHeight,0>; #declare cameraTarget = <0,eyeHeight,1000>; global_settings { assumed_gamma 1.0 ambient_light rgb<0.5,0.5,0.5>*0 max_trace_level 100 //radiosity { Rad_Settings(Radiosity_OutdoorHQ,off,off) } } light_source { <0,3,0> 1*0 } #declare BoxCount=0; #declare BoxNumber=20; #while (BoxCount < BoxNumber) #declare BoxSize = 2.2; box { <-BoxSize,0,-1+0.1>, rotate 360/BoxNumber*BoxCount * y translate pigment { rgb<0.1,0.1,0.1> } //pigment { rgb<0.2,0.2,0.2> } finish { ambient 0.2 diffuse 0.8 reflection {0.01 metallic}} } box { <-BoxSize+0.3,0.3,-1+0.5>, rotate 360/BoxNumber*BoxCount * y translate pigment {Red} finish { ambient 0 diffuse 0 reflection 1.0 } } #declare lightHeight = BoxSize * 4; light_source { <0,0.5,0> 0.15 looks_like { sphere { <0,0,0>,0.9 pigment {White filter 0.7 } finish { ambient 0.1 diffuse 1 } } } //fade_distance 0.1 translate } #declare BoxCount=BoxCount+1; #end // --- the macro ------------------------------------------------------------- #macro hex2rgb (hexString) #macro hex2dec (theHexValue) (asc(theHexValue)>64?asc(theHexValue)-55:asc(theHexValue)-48) #end <16*hex2dec(substr(hexString,1,1))+hex2dec(substr(hexString,2,1)), 16*hex2dec(substr(hexString,3,1))+hex2dec(substr(hexString,4,1)), 16*hex2dec(substr(hexString,5,1))+hex2dec(substr(hexString,6,1))>/255 #end #declare iRing=0; #declare nRings = 6; #declare fullAngle = 20; #while (iRing, <0,objHeight,0>, objRadius translate texture { pigment { #switch(iRing) #case (0) color hex2rgb("FF0000") #break #case (1) color hex2rgb("FFFF00") #break #case (2) color hex2rgb("00FF00") #break #case (3) color hex2rgb("00FFFF") #break #case (4) color hex2rgb("0000FF") #break #case (5) color hex2rgb("000000") #break #end } finish { phong 1 reflection .5 } } } */ sphere { <0,0,0>, objRadius translate texture { pigment { #switch(iRing) #case (0) color hex2rgb("FF0000") #break #case (1) color hex2rgb("FFFF00") #break #case (2) color hex2rgb("00FF00") #break #case (3) color hex2rgb("00FFFF") #break #case (4) color hex2rgb("0000FF") #break #case (5) color hex2rgb("000000") #break #end } finish { phong 1 reflection .5 } } } #end #declare iRing=iRing+1; #end /* Floor by http://www.lowjam.com/artwork.html */ #declare theight=0.025; #declare tedge=0.05; #declare atile=union { box { ,<1-tedge,theight,1-tedge> } triangle { <0,0,0>,, } triangle { <0,0,0>,,<0,0,1> } triangle { <0,0,0>,,<1-tedge,theight,tedge> } triangle { <0,0,0>,<1-tedge,theight,tedge>,<1,0,0> } triangle { <1,0,1>,<1-tedge,theight,1-tedge>,<1-tedge,theight,tedge> } triangle { <1,0,1>,<1-tedge,theight,tedge>,<1,0,0> } triangle { <1,0,1>,<1-tedge,theight,1-tedge>, } triangle { <1,0,1>,<0,0,1>, } } /* Lay down tile floor */ #declare I=-50; #while (I<50) #declare J=-50; #while (J < 50) object { atile translate <(I*2)-2,0,(J*2)-2> texture { pigment { color 0.3 } } finish { reflection 0.2 } } object { atile translate <(I*2)-1,0,(J*2)-1> texture { pigment { color 0.3 } } finish { reflection 0.2 } } object { atile translate <(I*2)-1,0,(J*2)-2> texture { pigment { color 0.5 } } finish { reflection 0.2 } } object { atile translate <(I*2)-2,0,(J*2)-1> texture { pigment { color 0.5 } } finish { reflection 0.2 } } #declare J=J+1; #end #declare I=I+1; #end // sky --------------------------------------------------------------- plane{<0,1,0>,1 hollow // texture{ pigment {color rgb<0.1,0.3,0.75>*0.7} #if (version = 3.7 ) finish {emission 1 diffuse 0} #else finish { ambient 1 diffuse 0} #end } // end texture 1 texture{ pigment{ bozo turbulence 0.75 octaves 6 omega 0.7 lambda 2 color_map { [0.0 color rgb <0.95, 0.95, 0.95> ] [0.05 color rgb <1, 1, 1>*1.25 ] [0.15 color rgb <0.85, 0.85, 0.85> ] [0.55 color rgbt <1, 1, 1, 1>*1 ] [1.0 color rgbt <1, 1, 1, 1>*1 ] } // end color_map translate< 3, 0,-1> scale <0.3, 0.4, 0.2>*3 } // end pigment #if (version = 3.7 ) finish {emission 1 diffuse 0} #else finish { ambient 1 diffuse 0} #end } // end texture 2 scale 10000 } //------------------------------------------------------------- // ground fog at the horizon ----------------------------------------- fog{ fog_type 2 distance 1000 color rgb<1,1,1>*0.9 fog_offset 0.1 fog_alt 20 turbulence 1.8 } //--------------------------------------------------------------- // ODS - Top/Bottom #declare odsIPD = 0.065; // Interpupillary distance #declare odsLocationX = 0; #declare odsLocationY = eyeHeight; #declare odsLocationZ = 0; #declare odsHandedness = -1; // "-1" for left-handed or "1" for right-handed #declare odsAngle = 0; // Rotation, clockwise, in degree. camera { user_defined location { function { odsLocationX + cos(((x+0.5+odsAngle/360)) * 2 * pi - pi)*odsIPD/2*select(-y,-1,+1) } function { odsLocationY } function { odsLocationZ + sin(((x+0.5+odsAngle/360)) * 2 * pi - pi)*odsIPD/2*select(-y,-1,+1) * odsHandedness } } direction { function { sin(((x+0.5+odsAngle/360)) * 2 * pi - pi) * cos(pi / 2 -select(y, 1-2*(y+0.5), 1-2*y) * pi) } function { sin(pi / 2 - select(y, 1-2*(y+0.5), 1-2*y) * pi) } function { -cos(((x+0.5+odsAngle/360)) * 2 * pi - pi) * cos(pi / 2 -select(y, 1-2*(y+0.5), 1-2*y) * pi) * odsHandedness } } }