// Neat European-style castle in summer (fast iteration) - FULL corrected scene #version 3.7; // ---------- Global ---------- global_settings { assumed_gamma 1.0 max_trace_level 6 } background { color rgb <0.62, 0.82, 1.00> } // summer sky // ---------- Lights (warm + soft shadows) ---------- light_source { <120, 160, -120> color rgb <1.00, 0.92, 0.78>*1.25 area_light <22,0,0>, <0,0,22>, 7, 7 adaptive 1 jitter circular } light_source { <-80, 70, -40> color rgb <0.85, 0.90, 1.00>*0.35 area_light <14,0,0>, <0,0,14>, 5, 5 adaptive 1 jitter } // ---------- Camera ---------- camera { location <0, 18, -46> look_at <0, 8, 0> angle 38 } // ---------- Simple materials (no textures) ---------- #declare Stone = pigment { color rgb <0.78, 0.78, 0.75> }; #declare Roof = pigment { color rgb <0.45, 0.18, 0.16> }; #declare Wood = pigment { color rgb <0.30, 0.20, 0.12> }; #declare Grass = pigment { color rgb <0.20, 0.55, 0.22> }; #declare Court = pigment { color rgb <0.70, 0.68, 0.62> }; #declare Fin = finish { diffuse 0.85 ambient 0.0 specular 0.15 roughness 0.05 }; #declare FinSoft = finish { diffuse 0.90 ambient 0.0 specular 0.08 roughness 0.08 }; // ---------- Ground ---------- plane { y, 0 pigment { Grass } finish { FinSoft } } box { <-28, 0.01, -20>, <28, 0.08, 18> // courtyard slab pigment { Court } finish { FinSoft } } // ---------- Castle dimensions ---------- #declare WallH = 8.0; #declare WallT = 2.0; // ---------- Helper: battlement crenellations ---------- #macro CrenelsAlongX(X1, X2, Y1, Y2, ZPos, Step, BlockW) union { #local xi = X1; #while (xi < X2) box { , } #local xi = xi + Step; #end } #end #macro CrenelsAlongZ(Z1, Z2, Y1, Y2, XPos, Step, BlockW) union { #local zi = Z1; #while (zi < Z2) box { , } #local zi = zi + Step; #end } #end // ---------- Outer walls (rectangular) ---------- #declare Walls = union { // Front wall (with gate opening cut later) box { <-20, 0, -12>, < 20, WallH, -10> } // Back wall box { <-20, 0, 10>, < 20, WallH, 12> } // Left wall box { <-20, 0, -10>, <-18, WallH, 10> } // Right wall box { < 18, 0, -10>, < 20, WallH, 10> } pigment { Stone } finish { Fin } }; // Gate opening: centered on front wall #declare GateCut = union { // Main rectangular cut box { <-3.6, 0.0, -12.5>, < 3.6, 5.2, -9.4> } // Arch top cut (cylinder) to round it; axis along X cylinder { <-3.6, 5.2, -11.2>, <3.6, 5.2, -11.2>, 3.6 } }; difference { object { Walls } object { GateCut } } // Battlements on outer walls union { // Front crenels (avoid gate center by splitting) object { CrenelsAlongX(-20.0, -6.5, WallH, WallH+1.2, -12.0, 2.4, 1.3) } object { CrenelsAlongX( 6.0, 20.0, WallH, WallH+1.2, -12.0, 2.4, 1.3) } // Back crenels object { CrenelsAlongX(-20.0, 20.0, WallH, WallH+1.2, 10.0, 2.4, 1.3) } // Left crenels object { CrenelsAlongZ(-10.0, 10.0, WallH, WallH+1.2, -20.0, 2.4, 1.3) } // Right crenels object { CrenelsAlongZ(-10.0, 10.0, WallH, WallH+1.2, 18.0, 2.4, 1.3) } pigment { Stone } finish { Fin } } // ---------- Corner towers ---------- #macro CornerTower(Pos) union { // Tower body cylinder { Pos, Pos + <0,12,0>, 3.0 } // Slight base ring cylinder { Pos, Pos + <0,1.2,0>, 3.3 } // Small top platform under roof cylinder { Pos + <0,11.5,0>, Pos + <0,12.2,0>, 3.4 } // Crenels on tower top union { #local ang = 0; #while (ang < 360) box { <-0.45, 12.2, -3.65>, <0.45, 13.4, -2.95> rotate <0, ang, 0> translate Pos } #local ang = ang + 30; #end } pigment { Stone } finish { Fin } } #end object { CornerTower(<-19, 0, -11>) } object { CornerTower(< 19, 0, -11>) } object { CornerTower(<-19, 0, 11>) } object { CornerTower(< 19, 0, 11>) } // Roof cones for towers union { cone { <-19,12,-11>, 3.2, <-19,17,-11>, 0.0 } cone { < 19,12,-11>, 3.2, < 19,17,-11>, 0.0 } cone { <-19,12, 11>, 3.2, <-19,17, 11>, 0.0 } cone { < 19,12, 11>, 3.2, < 19,17, 11>, 0.0 } pigment { Roof } finish { Fin } } // ---------- Central keep ---------- union { box { <-7, 0, -4>, <7, 16, 4> } // keep body // Keep crenels union { #local xk = -7; #while (xk < 7) box { , } box { , } #local xk = xk + 2.0; #end #local zk = -4; #while (zk < 4) box { <-7, 16, zk>, <-5.8, 17.4, zk+1.1> } box { < 5.8, 16, zk>, < 7, 17.4, zk+1.1> } #local zk = zk + 2.0; #end } pigment { Stone } finish { Fin } translate <0,0,2> } // ---------- Gatehouse details (FIXED: ensure all vectors have '>') ---------- union { // Flanking gatehouse blocks (sit on front wall line) box { <-7.5, 0.0, -12.0>, <-4.5, 9.5, -8.8> } box { < 4.5, 0.0, -12.0>, < 7.5, 9.5, -8.8> } // Simple "portcullis" hint inside gate box { <-3.2, 0.2, -10.05>, <3.2, 4.9, -9.85> } pigment { Stone } finish { Fin } } union { // Wooden door panel pushed back a bit (optional, open look) box { <-3.0, 0.1, -9.85>, <3.0, 4.6, -9.65> } pigment { Wood } finish { FinSoft } } // ---------- Subtle atmospheric haze ---------- fog { distance 180 color rgb <0.75, 0.88, 1.0>*0.35 fog_type 2 fog_offset 0 fog_alt 18 turbulence 0.2 }