// Persistence of Vision Raytracer 2.0 #ifdef (haus_inc) #else #declare haus_inc=1; #include "colors.inc" // Standard colors library #include "shapes.inc" // Commonly used object shapes #include "textures.inc" // LOTS of neat textures. Lots of NEW textures. #include "stones.inc" #include "metals.inc" #include "golds.inc" #include "woods.inc" #declare PI=3.151492654; #declare ziegelfarbe=<0.7,0.7,0.7>; #declare holzfassade=0; camera { location 2*<30*cos(2*PI*clock), 20, 30*sin(2*PI*clock)> // location <0, 80, 0> // location <80, 30, 15> // location <-50,20,-50> // Burg look_at <0, 2, 0> // look_at <3, 7, -3> // Kloster look_at <6, 5, 4> // Burg right <4/3, 0, 0> angle 20 } background { colour rgb 1 } // light_source {<20, 3, 1.5> colour rgb <1, 1, 1>} light_source {50*<1, 2, 1> colour rgb <1.5, 1.5, 1.5>} light_source {50*<-1, 2, -1> colour rgb <1.5, 1.5, 1.5>} #declare fenster = object { box { <0,0,-0.1>, <0.8,1,0.3> translate <0,0.7,0> texture { pigment { color rgb 0.3 } } } } #declare fensterrahmen = object { union { box { <0,0,0>, <0.8,0.1,0.1> translate <0,0.7,0.05> } box { <0,0,0>, <0.8,0.1,0.1> translate <0,1.6,0.05> } box { <0,0,0>, <0.8,0.1,0.1> translate <0,1.3,0.05> } box { <0,0,0>, <0.1,0.9,0.1> translate <0,0.7,0.05> } box { <0,0,0>, <0.1,0.9,0.1> translate <0.7,0.7,0.05> } box { <0,0,0>, <0.1,0.9,0.1> translate <0.35,0.7,0.1> } } texture { T_Wood10 scale 1 rotate y*45 } // box { <0,0.8,-0.1>, <0.8,1.8,0.3> texture { pigment { color rgb 0.3 } } } } #declare tuer = object { box { <0,0,-0.1>, <0.9,1.8,0.21> translate <0,0.02,0> texture { pigment { color rgb 0.3 } } } } #declare tuerrahmen = object { union { box { <0,0,0>, <0.9,0.1,0.1> translate <0,1.72,0.05> } // box { <0,0,0>, <0.9,0.1,0.1> translate <0,1.6,0.05> } box { <0,0,0>, <0.1,1.7,0.1> translate <0,0.02,0.05> } box { <0,0,0>, <0.1,1.7,0.1> translate <0.8,0.02,0.05> } box { <0.1,0,0>, <0.8,1.7,0.02> translate <0,0.02,0.1> } } texture { T_Wood10 scale 1 rotate x*90 } } // zum Abschneiden der Dachneigung vom Haus #macro dachschraege(l,h,b,gh) #local a=atan2d(gh,b/2); #local bs=b/2 / cosd(a); object { union { box { <-0.3,0,-0.3>, texture { pigment { rgb 0.3 } } rotate -x*a } box { <-0.3,0,0.3>, texture { pigment { rgb 0.3 } } rotate x*a translate <0,0,b> } } translate <0,h,0> } #end #declare strohdach = texture { pigment { wood turbulence 0.05 scale 0.1 color_map { [0.10 color rgb <1,1,0> ] [0.50 color rgb <0,0,0> ] [1.00 color rgb <1,1,0> ] } } translate <-2,0,0> } #declare ziegeldach = texture { pigment { brick <0.6,0.3,0>, <1,0.3,0> brick_size 0.2 mortar 0.02 } rotate x*90 } #declare dachtexture=ziegeldach; // #declare dachtexture=strohdach; #declare dachueberstand=0.2; #macro dach(l,h,b,gh) #local a=atan2d(gh,b/2); #local bs=b/2 / cosd(a); object { union { box { <-dachueberstand,0,-0.2>, texture { dachtexture } rotate -x*a } // sphere { 0.1 texture { pigment { rgb <1,1,0> } } } box { <-dachueberstand,0,0.2>, texture { dachtexture } rotate x*a translate <0,0,b> } } translate <0,h,0> } #end #declare nurmauern=0; #declare turm=0; #declare rundum=0; #declare holzfassade=1; #declare hohefenster=0; #declare ziegelfarbe=<0.7,0.3,0.3>; #declare zinnen=0; #declare zwischenzinnen=0; #macro haus(l,h,b, gh) #local numl = floor((l+0.4)/0.8/2); #local edgel = (l-numl*0.8)/(numl+0.33); #if (turm | rundum) #local numb = floor((b+0.4)/0.8/2); #local edgeb = (b-numb*0.8)/(numb+0.33); #else #local numb = floor((b-0.2)/(0.8+0.2)); #local edgeb = (b-numb*0.8)/(numb+0.33); #end #local stockh = 1.8; #if (hohefenster) #local stock = 1; #else #local stock = floor(h/stockh); #local stockh = h/stock; #end union { difference { union { difference { box { 0, } box { <0.2,-0.1,0.2>, } // texture { pigment { color 0.7 } } } texture { pigment { Irregular_Bricks_Ptrn (0.1, 1, 0.15, 0.5) color_map { [0.01, rgb <0.9,0.9,0.7> ] [0.01, rgb ziegelfarbe ] } } normal { Irregular_Bricks_Ptrn (0.1, 1, 0.15, 0.5) 2 } scale 0.3 rotate -y*45 } } // Holzfassade vorne und hinten #if (holzfassade) box { <-0.05,h,0>, <0.05,h+gh,b> texture { T_Wood10 scale 1 rotate x*90 } } box { , texture { T_Wood10 scale 1 rotate x*90 } } #end } dachschraege(l,h,b, gh) #if (turm) object { dachschraege(b,h,l, gh) rotate 90*y translate <0,0,b> } #end #if (nurmauern) #if (zinnen) #if (zwischenzinnen=0) #local zwischenzinnen=1.5*zinnen; #end #local numzl=floor(l/(zinnen+zwischenzinnen)); #local zwischenzinnen=(l-numzl*zinnen)/numzl; #local f=0; #while (f translate } object { fenster scale translate } #local f=f+1; #end #local numzb=floor(b/(zinnen+zwischenzinnen)); #local zwischenzinnen=(b-numzl*zinnen)/numzb; #local f=0; #while (f translate rotate y*90} object { fenster scale translate rotate y*90} #local f=f+1; #end #end #else union { #local st=0; #while (st } object { fenster translate } #local f=f+1; #end #local f=0; #local tp=floor(numb/2); #while (f rotate y*90 #if (hohefenster) scale <1,stockh/h,1> #end } // Tuere 10 cm breiter wie Fenster #else object { fenster translate rotate y*90 } #if (turm | rundum) object { fenster translate rotate y*90 } #end #end #local f=f+1; #end #local st=st+1; #end #if (hohefenster) scale <1,h/stockh,1> #end } #end } #if (nurmauern) #else union { #local st=0; #while (st } object { fensterrahmen translate } #local f=f+1; #end #local f=0; #local tp=floor(numb/2); #while (f rotate y*90 #if (hohefenster) scale <1,stockh/h,1> #end } // Tuere 10 cm breiter wie Fenster #else object { fensterrahmen translate rotate y*90 } #if (turm | rundum) object { fensterrahmen translate rotate y*90 } #end #end #local f=f+1; #end #local st=st+1; #end #if (hohefenster) scale <1,h/stockh,1> #end } #if (turm) difference { dach(l,h,b, gh) object { dachschraege(b,h,l, gh) rotate 90*y translate <0,0.05,b> } } difference { object { dach(b,h,l, gh) rotate 90*y translate <0,0,b> } object { dachschraege(l,h,b, gh) translate <0,0.05,0> } } #else dach(l,h,b, gh) #end #end } #end #macro runderturm(b,h, gh) #local umfang=b*PI; #local numf=floor(umfang/(0.8+0.2)); #local stockh = 1.8; #if (hohefenster) #local stock = 1; #else #local stock = floor(h/stockh); #local stockh = h/stock; #end #if (zinnen>0) #if (zwischenzinnen=0) #local zwischenzinnen=1.5*zinnen; #end #local numz=floor(umfang/(zwischenzinnen+zinnen)); #end union { difference { cylinder { <0,0,0>, <0,h,0>, b/2 } cylinder { <0,0,0>, <0,h+0.1,0>, b/2-0.2 } #if (nurmauern) #if (zinnen) #local f=0; #while (f translate <-zinnen/2,0,-b/2> rotate y*(f*360/numz) } #local f=f+1; #end #end #else union { #local st=0; #while (st rotate y*(f*360/numf) } #local f=f+1; #end #local st=st+1; #end #if (hohefenster) scale <1,h/stockh,1> #end } #end texture { pigment { Irregular_Bricks_Ptrn (0.1, 1, 0.15, 0.5) color_map { [0.01, rgb <0.9,0.9,0.7> ] [0.01, rgb ziegelfarbe ] } } normal { Irregular_Bricks_Ptrn (0.1, 1, 0.15, 0.5) 2 } scale 0.3 rotate -y*45*0 } } #if (nurmauern) #else union { #local st=0; #while (st rotate y*(f*360/numf) } #local f=f+1; #end #local st=st+1; #end #if (hohefenster) scale <1,h/stockh,1> #end cone { <0,h,0>, b/2+dachueberstand <0,h+gh,0>, 0 texture { dachtexture } } } #end } #end #if (0) #declare ziegelfarbe=<0.7,0.7,0.7>; #declare dachtexture=ziegeldach; // #declare dachtexture=strohdach; #declare holzfassade=0; // ------------ Kirche und Kloster ------------ #if (0) // Kirche #declare hohefenster=1; haus(10,6,4, 3) object { haus(1,2.5,2, 1.5) translate <-1,0,1> } // Kirchtürme #declare hohefenster=0; #declare turm=1; #declare nurmauern=1; union { haus(2,5,2, 3) #declare nurmauern=0; object { haus(2,4,2, 3) translate <0,5,0> } translate <9.5,0,-1> } #declare nurmauern=1; union { haus(2,5,2, 3) #declare nurmauern=0; object { haus(2,4,2, 3) translate <0,5,0> } translate <9.5,0,3> } #end #if (0) // Klosterbauten #declare hohefenster=0; #declare turm=1; // Ecken object { haus(3.2,3.6,3.2, 1.5) translate <0.4,0,-7.6> } object { haus(3.2,3.6,3.2, 1.5) translate <6.4,0,-7.6> } // Langhäuser #declare turm=0; #declare dachueberstand=0; object { haus(6,3.6,3, 1.5) rotate y*90 translate <0.5,0,0> } object { haus(6,3.6,3, 1.5) rotate y*180 translate <2+6,0,-4.5> } object { haus(6,3.6,3, 1.5) rotate y*90 translate <0.5+6,0,0> } #end // ------------ Turm ------------ #if (0) // viereckiger Turm #declare hohefenster=0; #declare turm=1; #declare nurmauern=1; union { object { haus(2.5,5,2.5, 1) translate <-1.25,0,-1.25> } object { haus(3,0,3, 3) scale <1,-1,1> translate <-1.5,5,-1.5> } #declare nurmauern=0; object { haus(3,2,3, 1) translate <-1.5,5,-1.5> } } #end // ------------ Burg und runde Türme ------------ #if (1) // Burg - zuerst Mauern #local th=3; #declare bb=8; #declare bl=12; #declare zinnen=0; #declare nurmauern=1; #declare turm=1; difference { haus(bl,th,bb,0) union { // Burgtor ausschneiden cylinder { <0,1.8,-0.1> <0,1.8,0.3> 0.75 } box { <-0.75,0,-0.1> <0.75,1.8,0.3> } texture { pigment { rgb 0.5 } } translate } } #declare zinnen=0.2; #declare zwischenzinnen=0.6; object { haus(bl+0.4,1.5,bb+0.4,2) translate <-0.2,th,-0.2> } object { haus(bl+0.2,0.3,bb+0.2,0) translate <-0.1,th-0.3,-0.1> } // dann Gebäude // Bergfried #declare zinnen=0; union { object { haus(2,4,2, 2) } #declare zinnen=0.2; #declare zwischenzinnen=1; object { haus( 2, 2.5, 2, 1) translate <0,4,0>} object { haus( 2, 2.5, 2, 1) translate <0,6.5,0>} object { haus(2.5, 0, 2.5, 1) scale <1,-2,1> translate <-0.25,9,-0.25>} object { haus(2.5, 2, 2.5, 0) translate <-0.25,9,-0.25>} // box { <0.1,-0.1,0.1> <2.4,0,2.4> texture { T_Wood10 scale 1 rotate y*45 } translate <-0.25,10.5,-0.25> } // // Zinnen // object { haus(2.5, 1.5, 2.5, 1) translate <-0.25,10.5,-0.25> } // Dach #declare nurmauern=0; object { haus(2.5, 0, 2.5, 1) translate <-0.25,11,-0.25> } translate } #declare zinnen=0; union { // Palas // zuerst noch "nurmauern" für untere, äußere Mauern #declare nurmauern=1; object { haus(bb, 3.7, bl/9,1.5) translate <0,0,0> } object { haus(bb/5, 3.7, bl/3,2) translate <4/5*bb,0,0> } #declare turm=0; #declare nurmauern=0; object { haus(bb,6,bl/3,2) } rotate -y*90 translate } // Stalldach box { <0,0,0> <5,0.1,-2> texture { strohdach } rotate -x*30 translate <0.2,2.6,bb> } // Brunnen union { #declare nurmauern=1; #declare zinnen=01.5*PI/4-0.1; #declare zwischenzinnen=0.1; runderturm(1.5,1.65, 1) #declare nurmauern=0; #declare dachueberstand=0; object { runderturm(1.5,0.1, 0.5) translate <0,1.65,0> } translate <7,0,bb-2> } #if (1) // runder Turm mit Schießscharten und Dach union { #local th=5; #declare zinnen=0; #declare nurmauern=1; runderturm(2,th, 2) #declare zinnen=0.2; #declare zwischenzinnen=0.6; object { runderturm(2.5,2, 2) translate <0,th,0> } #declare nurmauern=0; #declare dachueberstand=0.2; object { runderturm(2.5,0.1, 2) translate <0,th+2,0> } #declare dachueberstand=0; object { runderturm(2.5,0.1, th/2) scale <1,-1,1> translate <0,th,0> } translate } #end #if (1) // runder Turm mit zentralem Turm und Zinnen union { #local th=7; #declare zinnen=0; #declare nurmauern=1; runderturm(2,th, 2) #declare zinnen=0.2; #declare zwischenzinnen=0.6; object { runderturm(3,1.2, 2) translate <0,th,0> } #declare nurmauern=0; #declare dachueberstand=0; object { runderturm(3,0.1, th/2) scale <1,-1,1> translate <0,th,0> } #declare dachueberstand=0.2; object { runderturm(2,2, 2) translate <0,th,0> } translate <0,0,bb> } #end #if (1) // runde Türme an Palas union { #local th=4; #declare zinnen=0; #declare nurmauern=1; runderturm(2,th, 2) #declare nurmauern=0; #declare dachueberstand=0.2; object { runderturm(2,4.1, 2) translate <0,th,0> } translate } union { #local th=4; #declare zinnen=0; #declare nurmauern=1; runderturm(2,th, 2) #declare nurmauern=0; #declare dachueberstand=0.2; object { runderturm(2,2.1, 2) translate <0,th,0> } translate } #end #if (1) // runder Turm mit Schießscharten union { #local th=4.5; #declare zinnen=0; #declare nurmauern=1; runderturm(3,th, 2) #declare zinnen=0.2; #declare zwischenzinnen=0.6; object { runderturm(3.5,1.5, 2) translate <0,th,0> } #declare nurmauern=0; // object { runderturm(3.5,0.1, 2) translate <0,th+2,0> } #declare dachueberstand=0; object { runderturm(3.5,0.1, th/2) scale <1,-1,1> translate <0,th,0> } rotate y*45 translate <0,0,0> } #end #if (1) // Tortürme union { #local th=4; #declare zinnen=0; #declare nurmauern=1; object { runderturm(1.5,th,2) translate <-1.5,0,0> } object { runderturm(1.5,th,2) translate < 1.5,0,0> } object { runderturm(1.75,0.3, 2) scale <1,-1,1> translate <-1.5,th,0> } object { runderturm(1.75,0.3, 2) scale <1,-1,1> translate < 1.5,th,0> } #declare zinnen=0.2; #declare zwischenzinnen=0.3; object { runderturm(2,1.2, 2) translate <-1.5,th,0> } object { runderturm(2,1.2, 2) translate < 1.5,th,0> } // Zugbrücke box { <-0.75,-0.02,0> <0.75,0.02,-2> texture { T_Wood10 scale 1 rotate y*0*45 } } translate } #end #end // Ende Burg #end // if (0) für Gebäude #end // if (haus_inc)