// Talbar.pov // All textures are assigned at the end, where the objects are collected. The // only exception are the ropes which is colored ahead of time, as the little // things (including the Bloecke) get transformed a lot and there's no need to // do this separately for the texture. The rope texture would look stupid, if // it weren't transformed. The ship has a length of about 3.4 units. // Parameter: BeamAngle - angle between beam and cross-section. // Parameter: Clinker - clinker hull when true, takes truly long to render #include "colors.inc" #include "transforms.inc" // --- Textures --- #macro WoodTexture(a,b) pigment { wood turbulence 0.05 color_map { [0 rgb a] [1 rgb b] } } rotate 80*y scale <.75, .2, .75> finish { ambient 1 diffuse 1 } #end #declare T_WoodDark = texture { WoodTexture(<0.15, 0.10, 0.08>, <0.20, 0.12, 0.10>) } #declare T_WoodLight = texture { WoodTexture(<0.25, 0.18, 0.12>, <0.20, 0.15, 0.10>) } #declare T_Rope = texture { pigment{ spiral1 2 color_map { [0.4 color DarkTan] [1 color Gray35] } scale .02 rotate 90*y } } #declare T_Sail = pigment { Tan } // --- Objects --- #ifndef (BeamAngle) #declare BeamAngle = 90*pi/180; #end #declare RumpfBasis = object { intersection { superellipsoid { <.5, 1> scale <1.65, .70, .54> translate -.05*z } superellipsoid { <.5, 1> scale <1.65, .70, .54> translate .05*z } } } #declare Kiel = intersection { object { RumpfBasis scale <1.025, 1.05, 1> } plane { z, .025 } plane { -z, .025 } object { RumpfBasis inverse } clipped_by { sphere { 0, 10 inverse translate 9.85*y } } } #declare Reling = intersection { object { RumpfBasis scale 1.01 } object { RumpfBasis inverse scale .99 } object { RumpfBasis scale <1.05, 1, 2> translate .24*y } object { RumpfBasis inverse scale <1.05, 1, 2> translate .26*y } } #declare Rumpf = union { #ifdef (Clinker) #local i = -1; #while(i < 5) #local i = i + 1; intersection { object { RumpfBasis scale 1 - .02*i*z } object { RumpfBasis inverse scale 1 - .04*i*z } object { RumpfBasis scale <1.05, 1, 2> translate (.20 - i*.04)*y } object { RumpfBasis inverse scale <1.05, 1, 2> translate (.25 - i*.04)*y } } #end #else object { RumpfBasis } clipped_by { object { RumpfBasis inverse } scale <1.05, 1, 2> translate .25*y } #end } #declare Deck = intersection { #local Floor = -.475; #ifdef (Clinker) union { #local i = -1; #while(i < 5) #local i = i + 1; intersection { object { RumpfBasis scale 1 - .02*i*z } object { RumpfBasis scale <1.05, 1, 2> translate (.20 - i*.04)*y } object { RumpfBasis inverse scale <1.05, 1, 2> translate (.25 - i*.04)*y } } #end } #else object { RumpfBasis } #end plane { y, Floor } box { <-.5, Floor - .1, -.12>, <-.75, Floor + .1, .12> inverse } } #declare Luke = union { box { <-.5, Floor - .001, -.12>, <-.75, Floor + .001, .12> } box { <-.48, Floor - .01, -.10>, <-.77, Floor + .01, -.14> } box { <-.73, Floor - .01, -.14>, <-.77, Floor + .01, .14> } box { <-.77, Floor - .01, .10>, <-.48, Floor + .01, .14> } box { <-.48, Floor - .01, .14>, <-.52, Floor + .01, -.14> } } #declare Baum = union { cylinder { -.875*x, .875*x, 0.02 } sphere { 0, .02 scale 1 - .5*x translate .875*x } sphere { 0, .02 scale 1 - .5*x translate -.875*x } translate (1.6 + Floor)*y rotate -BeamAngle*180/pi*y translate -.12*x -.045* } #declare Belege = union { torus { .02 .0075 } torus { .02 .0075 translate .007*y } torus { .02 .0075 translate -.007*y } texture { T_Rope rotate 90*y } } #declare Mast = union { cylinder { 0, 2.4*y, .025 } sphere { 0, .025 scale 1 - .5*y translate 2.4*y } object { Belege scale 1.2 translate 1.6*y } translate <-.12, Floor, 0> } #declare SegelBelege = union { #local i = -1; #while (i < 8) #local i = i + 1; object { Belege rotate 90*z translate <(i*.125 - .5625 + .0625)*1.65, 1.6 + Floor, 0> } #end } #declare Segel = union { #local i = -1; #while (i < 7) #local i = i + 1; sphere { 0, .333 scale 3 - 2*x clipped_by { box { <-.0625, -.3, 0>, <.0625, .5, 100> } } translate <(i*.125 - .5 + .0625), (1.6 + Floor)/1.65 - .5, -.85> scale 1.65 - .65*z } #end object { SegelBelege } rotate -BeamAngle*180/pi*y translate -.12*x -.045* } #declare Pfosten = union { #local i = 0; #while (i < 2) #local j = -1; #while (j < 2) object { box { 0, <.04, .24, .04> } translate (.23+j*.24)*x translate (.09-i*.22)*z } #local j = j + 1; #end #local i = i + 1; #end translate <.585, Floor, 0> } #declare Kabine = union { difference { prism { 0, .5, 6, <0, 0>, <.25, 0>, <.37, .12>, <.25, .24>, <0, .24>, <0, 0> } box { <0, .25, .08> <.2, .6, .16> } rotate 90*z translate .5*x -.12*z } mesh { triangle { <-.04, .21, -.16>, <-.04, .37, 0>, <.54, .37, 0> } triangle { <.54, .37, 0>, <.54, .21, -.16>, <-.04, .21, -.16> } triangle { <-.04, .21, .16>, <-.04, .37, 0>, <.54, .37, 0> } triangle { <.54, .37, 0>, <.54, .21, .16>, <-.04, .21, .16> } } translate <.585, Floor, 0> } #declare RuderTeil = union { cylinder { 0, x, .06 } sphere { 0, .06 } sphere { x, .06 } scale <.5, 1.1, 1/3> } #declare Ruder = union { union { cylinder { 0, .6*x, .01 } sphere { 0, .01 } translate -.5*x } cylinder { 0, .1*z, .01 translate -.48*x } sphere { 0, .008 translate -.48*x +.1*z } intersection { object { RuderTeil translate +.02*y +.01*z } object { RuderTeil translate +.02*y -.01*z } object { RuderTeil translate -.02*y +.01*z } object { RuderTeil translate -.02*y -.01*z } } scale .8 } #declare DoppelRuder = union { object { Ruder rotate 180*x rotate -45*z translate <1.1, -.5, .35> } object { Ruder rotate -45*z translate <1.1, -.5, -.35> } } #declare Vorstag = union { sphere_sweep { linear_spline 2, <-.12, 2.2 + Floor, 0>, .0075, <-1.65, -.22, 0>, .0075 texture { T_Rope Reorient_Trans(x, <-2, 2 + Floor, 0>) } } object { Belege scale 1.25 - .25*y translate <-.12, 2.18 + Floor, 0> } object { Belege scale 1.5 - .5*y translate <-1.65, -.18, 0> } } #macro LaufendesGut(a,b,c,d) #macro Sweep(e,f,g) sphere_sweep { cubic_spline 5, 2*f-M .0075, f .0075, .5*(f+g) .0075, g .0075, 2*g-M .0075 translate e } #end union { #local a1 = vnormalize(c-a); #local c1 = vnormalize((d-a)-vdot(d-a,a1)*a1); #local b1 = vnormalize(vcross(a1,c1)); #local M = b+.25*(a-c); Sweep(0*c1,a,b) #local M = b+.25*(c-a); Sweep(-.015*c1,b,c) #local M = b+.25*(d-a); Sweep(.015*c1,b,d) cylinder { -.0075*y, .0075*y, .045 scale 1 - .5*z Shear_Trans(a1,b1,c1) translate b texture { T_WoodDark } } texture { T_Rope Shear_Trans(a1,b1,c1) } } #end #declare Brassen = union { #macro BaumEnd(a) a*.835*cos(BeamAngle)-.045*sin(BeamAngle) - .12, 1.6 + Floor, a*.835*sin(BeamAngle)+.045*cos(BeamAngle) #end #local i = -3; #while (i < 0) #local i = i + 2; #local a = ; #local b = <1.075, Floor + .05, i*.28>; #local c = <1.175, Floor + .05, i*.26>; LaufendesGut(a, .5*a + .5*b, b, c) #end } #declare Schoten = union { #macro SegelEnd(a) a*.82*cos(BeamAngle)-.13*sin(BeamAngle) - .12, 1.6 - .5*1.65 + Floor - .49, a*.82*sin(BeamAngle)+.13*cos(BeamAngle) #end #local i = -3; #while (i < 0) #local i = i + 2; #local a = ; #local b = <1.075, Floor + .05, i*.28>; #local c = <1.175, Floor + .05, i*.26>; LaufendesGut(a, .5*a + .5*b, b, c) #end } #declare Beschlag = intersection { object { RumpfBasis } plane { y, Floor +.05 inverse } plane { y, Floor +.06 } union { intersection { plane { -x, -.1 } plane { x, .45 } } intersection { plane { -x, -1 } plane { x, 1.25 } } } object { RumpfBasis scale .925 + .075*x inverse } } #declare Wanten = union { #local j = -3; #while (j < 0) #local j = j + 2; #local i = -1; #while (i < 2) #local i = i + 1; #local a = <-.12, 2.1 + Floor - i*.05, 0>; #local b = <.135 + .1*i, Floor + .05, -.33*j>; #local c = <.165 + .1*i, Floor + .05, -.33*j>; object { LaufendesGut(a, .3*a+.7*b, b, c) } object { Belege scale 1.25 - .25*y translate <-.12, 2.025 + Floor - i*.05, 0> } #end #end } #declare Talbar = union { object { Rumpf texture { T_WoodDark } } object { Mast texture { T_WoodDark } } object { Kabine texture { T_WoodDark } } object { Pfosten texture { T_WoodLight } } object { DoppelRuder texture { T_WoodLight } } object { Luke texture { T_WoodLight } } object { Reling texture { T_WoodLight } } object { Baum texture { T_WoodDark } } object { Vorstag } object { Brassen } object { Schoten } object { Beschlag texture { T_WoodLight } } object { Wanten } object { Kiel texture { T_WoodLight } } object { Deck texture { T_WoodDark } } object { Segel texture { T_Sail } } }