// pinda.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, .7, .54> translate -.1*z } superellipsoid { <.5, 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 <.975, .95, 1> inverse } sphere { 0, 10 inverse translate 9.75*y } } #declare Reling = intersection { object { RumpfBasis scale 1.01 } object { RumpfBasis inverse scale .99 } object { RumpfBasis scale <1.1, 1, 2.5> translate .34*y } #local i = -1; #while (i < 4) #local i = i + 1; cylinder { -z, z, .02 inverse translate <-.65 + i*.5, -.255, 0> } #end union { #local i = -1; #while (i < 4) #local i = i + 1; object { RumpfBasis inverse scale <1.1, 1, 2.5> translate .36*y } cylinder { -z, z, .04 translate <-.65 + i*.5, -.255, 0> } #end } } #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.1, 1, 2.5> translate (.30 - i*.04)*y } object { RumpfBasis inverse scale <1.1, 1, 2.5> translate (.35 - i*.04)*y } } #end #else object { RumpfBasis } clipped_by { object { RumpfBasis inverse } scale <1.1, 1, 2.5> translate .35*y } #end } #declare Deck = intersection { #local Floor = -.32; #ifdef (Clinker) union { #local i = -2; #while(i < 5) #local i = i + 1; intersection { object { RumpfBasis scale 1 - .02*i*z } object { RumpfBasis scale <1.1, 1, 2.5> translate (.30 - i*.04)*y } object { RumpfBasis inverse scale <1.1, 1, 2.5> translate (.35 - i*.04)*y } } #end scale .99 } #else object { RumpfBasis scale .99 } #end plane { y, Floor } plane { y, Floor - .025 inverse } #local i = -1; #while (i < 7) #local i = i + 1; box { 0, 2 scale <1.1/6,1,1> inverse translate <-1.65 + 1.1/2*(i-1/6), Floor - 1, -1> } #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 SegelBelege = union { #local i = -1; #while (i < 8) #local i = i + 1; object { Belege rotate 90*z translate } #end } #declare Baum = union { cylinder { .01*z, 2*x, 0.02 translate -.35*x } cylinder { -.01*z, -2*x, 0.02 translate .35*x } sphere { .005*z, .02 scale 1 - .5*x } sphere { -.005*z, .02 scale 1 - .5*x } sphere { 3.3*x, .02 scale 1 - .5*x } sphere { -3.3*x, .02 scale 1 - .5*x } object { Belege scale 1 + .25*z rotate 90*z} object { Belege scale 1 + .25*z translate -.25*y rotate 90*z} object { Belege scale 1 + .25*z translate .25*y rotate 90*z} object { SegelBelege } rotate 35*z translate (1.3 + Floor)*y rotate -BeamAngle*180/pi*y translate -.26*x -.045* } #declare Mast = union { cylinder { 0, 1.8*y, .025 } sphere { 0, .025 scale 1 - .5*y translate 1.8*y } object { Belege Shear_Trans(<1, -1 , 0>, <0, 1, 0>, <0, 0, 1>) scale 1.2 translate 1.3*y } cylinder { -.05*y, -.15*y, .1 } sphere { 0, .1 scale 1 - .5*y translate -.025*y} translate <-.26, Floor, 0> } #declare Segel = union { sphere { 0, .1 clipped_by { plane { x, 0 } } } #local i = 0; #while (i < 7) #local i = i + 1; torus { i*.1, .1 rotate z*90 clipped_by { cylinder { -x, x, .1*i inverse } } clipped_by { plane { x, 0 } } translate i*.1*x } #end translate .1*x scale <3,3,1> Reorient_Trans(vnormalize(x + .333*z),x) rotate -35*z clipped_by { plane { y, 0 } } rotate 35*z clipped_by { plane { -y, 0 } } clipped_by { plane { -z-.333*x, 0 } } rotate -18*z rotate 7*x rotate -4*y rotate 17.5*z translate <-1.265, Floor + .4, -.05> rotate -BeamAngle*180/pi*y translate -.26*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 } object { RuderTeil translate +.02*y -.01*z } 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> } #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*1.2*cos(BeamAngle)-.045*sin(BeamAngle) - .26, 1.24 + .86*i+ + Floor, a*1.2*sin(BeamAngle)+.045*cos(BeamAngle) #end #local i = -3; #while (i < 0) #local i = i + 2; #local a = ; #local b = <.95 + .5*i, Floor, -.13 + i*.14>; #local c = <.95 + .5*i, Floor, -.15 + i*.14>; LaufendesGut(a, .5*a + .5*b, b, c) #end } #declare Schoten = union { #macro SegelEnd(a) a*1.25*cos(BeamAngle)-.075*sin(BeamAngle) - .26, .39 + Floor, a*1.25*sin(BeamAngle)+.075*cos(BeamAngle) #end cylinder { , <1.45, Floor - .01, .06>, 0.0075 } sphere { , .0075 } texture { T_Rope Reorient_Trans(x, - <1.45, Floor - .01, .06>) } } #declare Pinda = union { object { Rumpf texture { T_WoodDark } } object { Mast texture { T_WoodDark } } object { Ruder texture { T_WoodLight } } object { Reling texture { T_WoodLight } } object { Baum texture { T_WoodDark } } object { Brassen } object { Schoten } object { Kiel texture { T_WoodLight } } object { Deck texture { T_WoodLight } } object { Segel texture { T_Sail } } }