// Prince in a Forest - single file scene (corrected) // Fix: belt texture syntax (no nested texture blocks) #version 3.7; global_settings { assumed_gamma 1.0 max_trace_level 8 } #include "colors.inc" #include "textures.inc" background { color rgb <0.70, 0.85, 1.00> } // sky // ---------- Camera ---------- camera { location <0, 3.2, -10> look_at <0, 1.6, 0> angle 38 } // ---------- Lights ---------- light_source { <8, 14, -12> color rgb <1.00, 0.95, 0.85> area_light <2,0,0>, <0,0,2>, 5, 5 adaptive 1 jitter } light_source { <-10, 8, -2> color rgb <0.55, 0.65, 0.90> } // ---------- Atmosphere ---------- fog { distance 30 color rgb <0.70, 0.85, 1.00> fog_type 2 fog_offset 0.2 fog_alt 1.0 turbulence 0.0 } // ---------- Ground ---------- plane { y, 0 texture { pigment { bozo color_map { [0.0 color rgb <0.10, 0.28, 0.10>] [0.6 color rgb <0.14, 0.34, 0.12>] [1.0 color rgb <0.20, 0.40, 0.16>] } scale 1.5 } finish { diffuse 0.9 specular 0.05 roughness 0.08 } } } // ---------- Helper textures ---------- #declare BarkTex = texture { pigment { wood color_map { [0.0 color rgb <0.30, 0.18, 0.10>] [0.6 color rgb <0.22, 0.13, 0.08>] [1.0 color rgb <0.35, 0.22, 0.12>] } turbulence 0.2 scale 0.35 } normal { bumps 0.35 scale 0.08 } finish { diffuse 0.85 specular 0.05 roughness 0.1 } } #declare LeafTex = texture { pigment { bozo color_map { [0.0 color rgb <0.12, 0.30, 0.10>] [0.5 color rgb <0.10, 0.38, 0.12>] [1.0 color rgb <0.18, 0.45, 0.16>] } scale 0.6 } finish { diffuse 0.9 specular 0.02 } } // ---------- Tree macro ---------- #macro Tree(Pos, TrunkH, TrunkR, CrownR) union { // trunk cylinder { <0,0,0>, <0,TrunkH,0>, TrunkR texture { BarkTex } } // crown (3 overlapping spheres) sphere { <0, TrunkH + CrownR*0.45, 0>, CrownR texture { LeafTex } } sphere { < CrownR*0.55, TrunkH + CrownR*0.30, 0>, CrownR*0.85 texture { LeafTex } } sphere { <-CrownR*0.55, TrunkH + CrownR*0.30, 0>, CrownR*0.85 texture { LeafTex } } // slight variation (deterministic) rotate <0, rand(seed(1))*20, 0> translate Pos } #end // ---------- Forest placement ---------- Tree(<-6,0, 2>, 4.8, 0.35, 1.8) Tree(<-3,0, 4>, 5.4, 0.40, 2.0) Tree(< 5,0, 3>, 5.1, 0.38, 2.0) Tree(< 7,0, 0>, 4.6, 0.33, 1.7) Tree(< 2,0, 6>, 5.8, 0.42, 2.2) Tree(<-7,0, -1>, 5.0, 0.36, 1.9) // ---------- Prince materials ---------- #declare SkinTex = texture { pigment { color rgb <0.92, 0.78, 0.67> } finish { diffuse 0.85 specular 0.12 roughness 0.05 } } #declare HairTex = texture { pigment { color rgb <0.20, 0.12, 0.06> } finish { diffuse 0.9 specular 0.05 roughness 0.08 } } #declare TunicTex = texture { pigment { color rgb <0.15, 0.30, 0.65> } finish { diffuse 0.9 specular 0.06 roughness 0.08 } } #declare CapeTex = texture { pigment { color rgb <0.65, 0.12, 0.10> } finish { diffuse 0.9 specular 0.05 roughness 0.1 } } #declare BootTex = texture { pigment { color rgb <0.08, 0.08, 0.09> } finish { diffuse 0.7 specular 0.2 roughness 0.03 } } #declare GoldTex = texture { pigment { color rgb <0.95, 0.78, 0.22> } finish { diffuse 0.35 specular 0.65 roughness 0.02 reflection 0.08 } } #declare BeltTex = texture { pigment { color rgb <0.35,0.22,0.10> } finish { diffuse 0.8 specular 0.15 roughness 0.05 } } // ---------- Prince model ---------- #declare Prince = union { // Body core sizes #declare LegLen = 0.95; #declare TorsoH = 1.05; #declare NeckH = 0.12; #declare HeadR = 0.33; // Boots (fit precisely at ground) box { <-0.18, 0.00, -0.22>, < 0.18, 0.18, 0.22> texture { BootTex } translate <-0.22, 0, 0> } box { <-0.18, 0.00, -0.22>, < 0.18, 0.18, 0.22> texture { BootTex } translate < 0.22, 0, 0> } // Legs (start on boot top at y=0.18) cylinder { <-0.22, 0.18, 0>, <-0.22, 0.18+LegLen, 0>, 0.14 texture { TunicTex } } cylinder { < 0.22, 0.18, 0>, < 0.22, 0.18+LegLen, 0>, 0.14 texture { TunicTex } } // Torso (sits exactly on legs top) cylinder { <0, 0.18+LegLen, 0>, <0, 0.18+LegLen+TorsoH, 0>, 0.36 texture { TunicTex } } // Belt (around waist) - FIXED TEXTURE SYNTAX torus { 0.38, 0.05 rotate <90,0,0> translate <0, 0.18+LegLen+0.18, 0> texture { BeltTex } } // Arms (attached at upper torso) #declare ShoulderY = 0.18+LegLen+TorsoH-0.18; cylinder { <-0.48, ShoulderY, 0>, <-0.85, ShoulderY-0.35, 0.08>, 0.10 texture { TunicTex } } cylinder { < 0.48, ShoulderY, 0>, < 0.85, ShoulderY-0.35, 0.08>, 0.10 texture { TunicTex } } // Hands sphere { <-0.90, ShoulderY-0.40, 0.10>, 0.11 texture { SkinTex } } sphere { < 0.90, ShoulderY-0.40, 0.10>, 0.11 texture { SkinTex } } // Neck (fits between torso and head) cylinder { <0, 0.18+LegLen+TorsoH, 0>, <0, 0.18+LegLen+TorsoH+NeckH, 0>, 0.13 texture { SkinTex } } // Head sphere { <0, 0.18+LegLen+TorsoH+NeckH+HeadR, 0>, HeadR texture { SkinTex } } // Hair (cap) difference { sphere { <0, 0.18+LegLen+TorsoH+NeckH+HeadR*1.03, 0>, HeadR*1.02 } plane { y, 0.18+LegLen+TorsoH+NeckH+HeadR*1.02 } // cut lower half texture { HairTex } } // Cape (simple drape as a box + cylinder blend behind torso) union { box { <-0.45, 0.18+LegLen+0.15, -0.12>, <0.45, 0.18+LegLen+TorsoH+0.05, -0.85> } cylinder { <0, 0.18+LegLen+TorsoH, -0.20>, <0, 0.18+LegLen+0.20, -0.85>, 0.25 } texture { CapeTex } } // Crown (ring + points) placed on head top union { torus { 0.20, 0.035 rotate <90,0,0> translate <0, 0.18+LegLen+TorsoH+NeckH+HeadR*1.72, 0> } cone { <0.18, 0.18+LegLen+TorsoH+NeckH+HeadR*1.58, 0>, 0.03, <0.18, 0.18+LegLen+TorsoH+NeckH+HeadR*1.90, 0>, 0.00 } cone { <-0.18, 0.18+LegLen+TorsoH+NeckH+HeadR*1.58, 0>, 0.03, <-0.18, 0.18+LegLen+TorsoH+NeckH+HeadR*1.90, 0>, 0.00 } cone { <0, 0.18+LegLen+TorsoH+NeckH+HeadR*1.58, 0.18>, 0.03, <0, 0.18+LegLen+TorsoH+NeckH+HeadR*1.90, 0.18>, 0.00 } cone { <0, 0.18+LegLen+TorsoH+NeckH+HeadR*1.58, -0.18>, 0.03, <0, 0.18+LegLen+TorsoH+NeckH+HeadR*1.90, -0.18>, 0.00 } texture { GoldTex } } // Pose: slight confident tilt rotate <0, -8, 0> translate <0, 0, 0> } object { Prince } // ---------- Simple forest props (rocks) ---------- #declare RockTex = texture { pigment { color rgb <0.35,0.35,0.37> } normal { bumps 0.6 scale 0.15 } finish { diffuse 0.9 specular 0.05 roughness 0.1 } } sphere { <-1.6, 0.30, 1.2>, 0.35 texture { RockTex } } sphere { < 1.8, 0.22, 1.0>, 0.28 texture { RockTex } } sphere { < 0.9, 0.18, 2.0>, 0.22 texture { RockTex } }