// nivik.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" // Import of the lifeboat #include "pinda.pov" #declare Rettungsboot = union { object { Rumpf texture { T_WoodDark } } object { Reling texture { T_WoodLight } } object { Kiel texture { T_WoodLight } } object { Deck texture { T_WoodLight } } scale .225 translate .3*x - .2*y } // --- 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>) normal { bumps 1 scale .02 } } #declare T_WoodLight = texture { WoodTexture(<0.25, 0.18, 0.12>, <0.20, 0.15, 0.10>) normal { bumps 1 scale .02 } } #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 { <.7, 1> scale <1.65, .7, .54> translate -.1*z } superellipsoid { <.7, 1> scale <1.65, .7, .54> translate .1*z } } } #declare Kiel = intersection { object { RumpfBasis scale <1.025, 1.05, 1> } plane { z, .025 } plane { -z, .025 } object { RumpfBasis scale <.985, .95, 1> inverse } sphere { 0, 10 inverse translate 9.95*y } } #declare Reling = intersection { object { RumpfBasis scale 1.01 } object { RumpfBasis inverse scale .99 } object { RumpfBasis scale <1.05, 1, 2> translate .34*y } object { RumpfBasis inverse scale <1.05, 1, 2> translate .36*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 - .05*i*z } object { RumpfBasis scale <1.05, 1, 2> translate (.25 - i*.05)*y } object { RumpfBasis inverse scale <1.05, 1, 2> translate (.35 - i*.05)*y } } #end #else object { RumpfBasis } clipped_by { object { RumpfBasis inverse } scale <1.05, 1, 2> translate .35*y } #end } #declare Deck = intersection { #local Floor = -.375; #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 { <-.7, Floor - .1, -.12>, <-.95, Floor + .1, .12> inverse } box { <.7, Floor - .1, -.12>, <.95, Floor + .1, .12> inverse } } #declare Luken = union { #local i = -3; #while (i != 1) #local i = i + 2; box { , } box { , } box { , } box { , } box { , } #end } #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 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.8 + Floor)*y rotate -BeamAngle*180/pi*y translate -.12*x -.045* } #declare Mast = union { cylinder { 0, 2.6*y, .025 } sphere { 0, .025 scale 1 - .5*y translate 2.6*y } object { Belege scale 1.2 translate 1.8*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.8 + 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.8 + Floor)/1.65 - .5, -.85> scale 1.65 - .65*z translate -.2*y + .015 *z scale 1 + .15*y } #end object { SegelBelege } rotate -BeamAngle*180/pi*y translate -.12*x -.045* } #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, .8*x, .01 } sphere { 0, .01 } translate -.5*x scale <.6, 1, 1> } intersection { object { RuderTeil translate +.02*y +.01*z scale 1-.5*y } object { RuderTeil translate +.02*y -.01*z scale 1-.5*y } object { RuderTeil translate -.02*y +.01*z } object { RuderTeil translate -.02*y -.01*z } scale <.6, 1.25, 1> } cylinder { 0, .1*z, .01 translate -.28*x } sphere { 0, .008 translate -.28*x +.1*z } rotate 180*x rotate -60*z translate <1.2, -.35, .3> } #declare Vorstag = union { sphere_sweep { linear_spline 2, <-.12, 2.1 + Floor, 0>, .0075, <-1.6, -.22, 0>, .0075 texture { T_Rope Reorient_Trans(x, <-2, 2 + Floor, 0>) } } object { Belege scale 1.25 - .25*y translate <-.12, 2.08 + Floor, 0> } object { Belege scale 1.5 - .5*y translate <-1.585, -.18, 0> } } #declare Achterstag = union { #local i = -3; #while (i < 0) #local i = i + 2; sphere_sweep { linear_spline 2, <-.12, 2.35 + Floor, 0>, .0075, <1.175, Floor + .05, i*.225>, .0075 texture { T_Rope Reorient_Trans(x, <-2, 2 + Floor, 0>) } } #end object { Belege scale 1.25 - .25*y translate <-.12, 2.33 + Floor, 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.8 + Floor, a*.835*sin(BeamAngle)+.045*cos(BeamAngle) #end #local i = -3; #while (i < 0) #local i = i + 2; #local a = ; #local b = <1.1, Floor + .05, i*.235>; #local c = <1.375, Floor, i*.12>; LaufendesGut(a, .9*a + .1*b, b, c) #end } #declare Schoten = union { #macro SegelEnd(a) a*.82*cos(BeamAngle)-.145*sin(BeamAngle) - .12, 1.6 - .5*1.65 + Floor - .5, a*.82*sin(BeamAngle)+.145*cos(BeamAngle) #end #local i = -3; #while (i < 0) #local i = i + 2; #local a = ; #local b = <1.08, Floor + .06, i*.25>; #local c = <1.13, Floor + .06, i*.23>; LaufendesGut(a, .9*a + .1*b, b, c) #end } #declare Beschlag = intersection { object { RumpfBasis } plane { y, Floor +.05 inverse } plane { y, Floor +.06 } union { intersection { plane { -x, .05 } plane { x, .3 } } intersection { plane { -x, -.95 } plane { x, 1.2 } } } 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 < 1) #local i = i + 1; sphere_sweep { linear_spline 2, <-.12, 2.04 + Floor - i*.05, 0>, .0075, <.25*i, Floor + .05, -.36*j>, .0075 texture { T_Rope Reorient_Trans(x, <-2, 2 + Floor, 0>) } } object { Belege scale 1.25 - .25*y translate <-.12, 1.925 + Floor - i*.05, 0> } #end #end } #declare Ausguck = difference { box { <-.02, -.03, -.02>, <.02, .03, .02> } box { <-.019, -.029, -.019>, <.019, .031, .019> } scale 2.2 translate 1.8*y - .16*x } #declare AusguckPfosten = union { #local balken1 = box { <-.022, -.032, -.022>, <-.017, .038, -.017> } #local balken2 = box { <-.022, -.032, -.022>, <-.017, -.027, .022> } #local balken3 = box { <-.022, -.033, -.022>, <-.017, .033, -.017> rotate -30*x translate <0, .01, .018> } #local i = -1; #while (i < 4) #local i = i + 1; object { balken1 rotate 90*i*y } object { balken2 rotate 90*i*y } object { balken2 rotate 90*i*y translate .06*y} object { balken3 rotate 90*i*y } #end scale 2.2 translate 1.8*y - .16*x } #declare CastleBase = prism { linear_sweep linear_spline -1, 1, 5, <-1,-1>, <-1,1>, <1,1.25>, <1,-1.25>, <-1,-1> } #declare CastleFrame = intersection { union { intersection { object { CastleBase scale 1.05 } object { CastleBase inverse scale .9 + .2*y } object { CastleBase inverse scale .9 + .2*x } box { <-.1, -.95, -2>, <-.9, .95, 2> inverse } box { <.1, -.95, -2>, <.9, .95, 2> inverse } } intersection { object { CastleBase scale 1.05 } object { CastleBase inverse scale .9 + .2*y } object { CastleBase inverse scale <1.1, 1.1, .9> } box { <-.1, -1.1, -2>, <-.9, 1.1, 2> inverse } box { <.1, -1.1, -2>, <.9, 1.1, 2> inverse } scale 1 - .8*y translate 1.2*y } intersection { object { CastleBase scale 1.05 } object { CastleBase inverse scale 1.1 - .2*z } object { CastleBase inverse scale 1.1 - .2*x } translate -2*y } union { #macro PBoard(a,b) <-.05, a, -.05> <.05, b, .1> #end box { PBoard(-1.1, 1.1) rotate 30*x translate x-.65*z } box { PBoard(-1, 1) rotate 25*x translate -x-.55*z } box { PBoard(-.95, 1) rotate -25*x translate -x+.55*z } #local Board = box { PBoard(-1.1, 1.1) rotate 90*y }; object { Board rotate 25*z rotate -7.2*y translate 1.19*z + .475*x } object { Board rotate 25*z rotate 7.2*y translate -1.19*z + .475*x } object { Board rotate -25*z rotate -7.2*y translate 1.07*z - .49*x } object { Board rotate -25*z rotate 7.2*y translate -1.07*z - .49*x } object { Board rotate 7.2*z translate <1.1, -2, 0> } object { Board rotate 7.2*z translate <1.1, -2, 1.1> } union { #local i = 1; #while (i < 3) #local i = i + .5; box { <-.05, -.05, 0>, <.05, .05, 1.1> translate x - i*y } #end rotate 7.2*z translate -.15*x } } #local i = -3; #while (i < 1) #local i = i + 2; box { , } #local j = -3; #while (j < 1) #local j = j + 2; box { PBoard(-.7 + .1*j, .75) rotate j*i*45*x translate <-j, -1.5, -j*i*.575 - .025> } object { Board rotate j*25*z rotate j*i*7.2*y scale 1 - .5*y translate } #end #end } box { <.85, -.9, .1>, <1.1, 2, 1.15> inverse } } #declare CastleWalls = union { intersection { object { CastleBase } object { CastleBase inverse scale .95 + .1*y } box { <.85, -.9, .1>, <1.1, 2, 1.15> inverse } } object { CastleBase scale 1 - .95*y translate -y } } #declare ForeCastle = union { object { CastleFrame scale .1 translate -1.15*x - .1*y texture { T_WoodDark } } object { CastleWalls scale .1 translate -1.15*x - .1*y texture { T_WoodLight } } } #declare AftCastle = union { object { CastleFrame scale .1 rotate 180*y translate 1.18*x - .1*y texture { T_WoodDark } } object { CastleWalls scale .1 rotate 180*y translate 1.18*x - .1*y texture { T_WoodLight } } } #declare GeborgeneSegel = union { sphere { 0, 1 scale <.16, .06, .06> translate <-.1, 1.37, .03> } sphere { 0, 1 scale <.16, .06, .06> translate <.1, 1.37, .03> } sphere { 0, 1 scale <.16, .053, .053> translate <-.3, 1.377, .027> } sphere { 0, 1 scale <.16, .053, .053> translate <.3, 1.377, .027> } sphere { 0, 1 scale <.16, .047, .047> translate <-.5, 1.383, .023> } sphere { 0, 1 scale <.16, .047, .047> translate <.5, 1.383, .023> } sphere { 0, 1 scale <.16, .04, .04> translate <-.7, 1.39, .02> } sphere { 0, 1 scale <.16, .04, .04> translate <.7, 1.39, .02> } object { SegelBelege } rotate -BeamAngle*180/pi*y translate -.12*x -.045* texture { T_Sail } } #declare Nivik = union { object { Rumpf texture { T_WoodDark } } object { Mast texture { T_WoodDark } } object { Ruder texture { T_WoodLight } } object { Luken texture { T_WoodLight } } object { Reling texture { T_WoodLight } } object { Baum texture { T_WoodDark } } object { Vorstag } object { Achterstag } 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 } } object { GeborgeneSegel texture { T_Sail } } object { AusguckPfosten texture { T_WoodLight } } object { Ausguck texture { T_WoodDark } } object { ForeCastle } object { AftCastle } object { Rettungsboot } }