1 // This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
2 // To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a
3 // letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
5 // Persistence Of Vision raytracer sample file.
6 //============================================
7 // The field, new improved version October. 2001
8 // Copyright Gilles Tran 2001
9 // http://www.oyonale.com
10 //--------------------------------------------
11 // Render with a 2.67 ratio such as 320*120, 640*240, 1024*384, 1280*480
12 //--------------------------------------------
18 // Uncomment AreaOK=true below to turn on the area light
19 // This will blur the shadow under the submarine
20 // but the rendering time will extremely slow
24 global_settings{ assumed_gamma 1.0 max_trace_level 15 }
26 #
declare AreaOK
=false;
27 //#declare AreaOK=true;
30 #
include "functions.inc"
31 //============================================
33 //============================================
34 //--------------------------------------------
36 //--------------------------------------------
37 #
declare PdV
=<-20, -20, -400>;
40 angle 65 // direction z*2
42 right x*image_width
/image_height
// keep proportions with any aspect ratio //right 8*x/3
46 //--------------------------------------------
47 // reorientation macro
48 //--------------------------------------------
50 #local yV1
=vnormalize(P2
-P1
);
51 #local xV1
=vnormalize(vcross(yV1
,z));
52 #local zV1
=vcross(xV1
,yV1
);
53 matrix <xV1.
x,xV1.
y,xV1.
z,yV1.
x,yV1.
y,yV1.
z,zV1.
x,zV1.
y,zV1.
z,P1.
x,P1.
y,P1.
z>
56 //--------------------------------------------
58 //--------------------------------------------
59 #
declare colWater1
=rgb<0,79,159>/255;
60 #
declare colWater2
=rgb<7,146,217>/255;
61 #
declare colWater3
=rgb<82,239,238>/255;
62 #
declare colSub
=<7/255,146/255,217/255>;
64 //--------------------------------------------
66 //--------------------------------------------
67 light_source {<-10, 1000, -10> color colWater2
*10
69 area_light x*200,z*200, 3,3 adaptive 1 jitter orient
73 light_source {<-200, -1000, -300> color colWater2
*2 shadowless media_interaction
off}
74 light_source {PdV
color colWater2
*2 shadowless media_interaction
off}
76 //--------------------------------------------
78 //--------------------------------------------
79 #
declare txtMine
=texture {
80 pigment{color colWater3
*0.1}
81 finish{ambient 0 diffuse 0.4 specular 0.03 roughness 0.2 reflection 0.05}
83 #
declare txtCable
=texture {
84 pigment{color colWater3
*0.1}
85 finish{ambient 0 diffuse 0.1 specular 0.02 roughness 0.2}
88 //--------------------------------------------
90 //--------------------------------------------
91 #
declare txtSkin
=texture{
93 function
{min(1,max(0,y))}
94 turbulence 0.01 omega 1.5 lambda 5 poly_wave
1.5
95 color_map{[0 Clear
][0.25 rgbt<0,0,0,0.7>] [0.4 rgbt<0,0,0,0.3>]}
96 scale 38 translate -y*17
99 finish{ambient 0 diffuse 0.6 specular 0.1 roughness 1/10}
102 #
declare pigLettre
=pigment{bozo color_map{[0 White
*1.3][1 White
*0.5]}}
103 #
declare txtLettre
=texture{ // submarine name
106 text{ttf "cyrvetic.ttf" "PERSISTENCE" 10, 0.3*x
107 translate -z*0.5 scale <1,1,10>
109 pigment{color Clear
}, pigment{pigLettre
}
112 scale 1.5 translate <-10,-1,-25>
115 finish{ambient 0 diffuse 0.4}
119 #
declare txtSub0
=texture {
120 pigment{rgb colSub
*0.2}
121 finish {ambient 0 diffuse 0.3 specular 0.05 roughness 0.1}
123 // Thanks to Bob H. for the help regarding these textures
124 #
declare txtSubBase
=texture {
129 [.45 rgb <colSub.
x*0.1,colSub.
y*0.1,colSub.
z*0.1>]
130 [.55 rgb <colSub.
x,colSub.
y,colSub.
z>*0.8]
136 finish {ambient 0 diffuse 0.3 specular 0.05 roughness 0.1}
146 [.25 rgbf <colSub.
x*0.1,colSub.
y*0.1,colSub.
z*0.1,0>]
147 [.75 rgbf <colSub.
x,colSub.
y,colSub.
z,1>]
152 finish {ambient 0 diffuse 0.3 specular 0.05 roughness 0.1}
159 [.25 rgbf <colSub.
x*0.4,colSub.
y*0.4,colSub.
z*0.4,0>]
160 [.75 rgbf <colSub.
x,colSub.
y,colSub.
z,1>]
165 finish {ambient 0 diffuse 0.3 specular 0.05 roughness 0.1}
170 #
declare txtSubBottom
=
178 [.25 rgbf <colSub.
x*0.5,colSub.
y*0.5,colSub.
z*0.5,0>]
179 [.75 rgbf <colSub.
x,colSub.
y,colSub.
z,1>]
184 finish {ambient 0 diffuse 0.3 specular 0.05 roughness 0.1}
191 [0 rgbf <colSub.
x*0.5,colSub.
y*0.5,colSub.
z*0.5,.5>]
192 [1 rgbf <colSub.
x,colSub.
y,colSub.
z,1>]
198 finish {ambient 0 diffuse 0.3 specular 0.05 roughness 0.1}
205 //============================================
207 //============================================
208 //--------------------------------------------
210 //--------------------------------------------
212 #
declare Spike
= union{
213 #
declare rSpike1
=0.08;
214 #
declare rSpike2
=rSpike1
*0.3;
216 cone{0,rSpike1
,y*ySpike
,rSpike2
}
217 sphere{0,rSpike2
translate y*ySpike
}
218 sphere{0,rSpike1
*1.5 scale <1,0.3,1>}
219 #
declare i
=0;#
while (i
<360) sphere{0,0.015 scale <2,1,2> translate <rSpike1
*2.8,-0.04,0> rotate y*i
} #
declare i
=i
+30;#
end
227 //--------------------------------------------
229 //--------------------------------------------
231 #
declare MineBody
=union {
233 function
{x*x+y*y+z*z-1 +f_noise3d
(x*10,y*10,z*10)*0.05}
235 contained_by
{sphere{0,1}}
242 object{Spike
rotate z*(i
+rand(rd
)*2) rotate y*(j
+rand(rd
)*2)}
248 object{Spike
rotate 90*y}
249 object{Spike
rotate -90*y}
254 //--------------------------------------------
255 // Mine cable and decorative collar
256 //--------------------------------------------
259 #
declare MineCable
=isosurface
{
260 function
{f_helix1
(x,y,z,3,35,0.35*rFil
,0.55*rFil
,2,1,0)}
261 contained_by
{box {<-rFil
,0,-rFil
>,<rFil
,yFil
,rFil
>}}
263 scale <1,-1,1>*3 translate -y
267 #
declare MineCollar
=lathe{
270 <0.058,0.003>,<0.081,0.000>,<0.101,0.055>,<0.099,0.085>,<0.104,0.132>,<0.066,0.152>,
271 <0.095,0.169>,<0.089,0.194>,<0.144,0.227>,<0.143,0.281>,<0.145,0.307>,<0.109,0.325>,
272 <0.067,0.353>,<0.031,0.362>,<0.030,0.363>
276 //--------------------------------------------
278 //--------------------------------------------
281 sphere{0,1 scale <0.4,0.14,0.4> translate -y*0.91}
282 #
declare i
=0;#
while (i
<360) cylinder{0,-y*0.1,0.02 translate <0.35,-0.91,0> rotate y*i
} #
declare i
=i
+30;#
end
283 object{MineCollar
scale <1.2,2,1.2> translate -y*0.92}
284 object{MineCollar
translate -y*2}
291 //============================================
293 //============================================
294 #
declare Sc
=3; // general scaling parameter
295 #
declare SX
=6*Sc
; // x scaling
296 #
declare SYbot
=10*Sc
;// y scaling for the bottom
297 #
declare SYtop
=2*Sc
; // y scaling for the top
298 #
declare SZfront
=20*Sc
; // z scaling for the front
299 #
declare SZrear
=100*Sc
;// z scaling for the rear
301 //--------------------------------------------
303 //--------------------------------------------
304 #
declare Part1
=blob{ // bottom front
307 cylinder{-z*2,z,0.04,-1 translate <-0.2,-0.3,1> pigment{Black
}}
308 cylinder{-z*2,z,0.04,-1 translate <-0.17,-0.18,1> pigment{Black
}}
309 sphere{0,1,1 scale <0.1,0.45,1.05>}
310 sphere{0,1,1 scale <0.3,0.45,0.8>}
312 #
declare Part2
=blob{ // top front
315 sphere{0,1,1 scale <0.3,0.45,0.8>}
316 sphere{0,1,1 scale <0.2,1.2,1.05>}
318 #
declare Part3
=blob{ // bottom rear
321 cylinder{-x,0,1,1 scale <0.5,0.03,0.02> translate <0,-0.05,0.45>}
322 cylinder{-y,0,1,1 scale <0.03,0.2,0.02> translate <0,-0.05,0.45>}
324 #
declare Part4
=blob{ // top rear
327 cylinder{-y,y,2,2 scale <0.03,0.3,0.012> translate <0,0.5,0.45>}
328 sphere{0,1,1 scale <0.2,1.2,0.4>}
330 cylinder{-x,0,1,1 scale <0.2,0.2,0.04> rotate x*-10 translate <0,1.5,0.2>}
331 cylinder{0,y,0.2,2 scale <0.6,2.5,0.4>*0.7 translate <0,-0.05,0.16>}
332 cylinder{0,y,0.2,2 scale <0.4,2.5,0.4>*0.7 translate <0,-0.05,0.165>}
333 cylinder{0,y,0.2,2 scale <0.2,2.5,0.4>*0.7 translate <0,-0.05,0.17>}
337 //--------------------------------------------
339 //--------------------------------------------
340 #
declare HalfSubTop
=union{
342 object{Part2
} // top front
346 scale <SX
,SYtop
,SZfront
>
349 object{Part4
} // top rear
353 scale <SX
,SYtop
,SZrear
>
356 #
declare SubTop
=union{
358 object{HalfSubTop
scale <-1,1,1>}
361 //--------------------------------------------
363 //--------------------------------------------
364 #
declare HalfSubBottom
=union{
366 object{Part1
} // bottom front
370 scale <SX
,SYbot
,SZfront
>
373 object{Part3
} // bottom rear
377 scale <SX
,SYbot
,SZrear
>
381 #
declare SubBottom
=union{
382 object{HalfSubBottom
}
383 object{HalfSubBottom
scale <-1,1,1>}
384 texture{txtSubBottom
}
386 //--------------------------------------------
387 // Decorative elements
388 //--------------------------------------------
389 #
declare Balustrade
=union{
399 cylinder{0,y*yB
,rB1
translate z*i
}
402 cylinder{0,z*zB
,rB2
translate y*yB
}
403 cylinder{0,z*zB
,rB2
translate y*yB
*0.3}
404 cylinder{0,z*zB
,rB2
translate y*yB
*0.6}
406 difference{torus{rB3
,rB2
rotate z*90} plane{y,0} plane{z,0 inverse} plane{z,0 rotate x*-45}}
407 cylinder{0,-z*zB
*0.1,rB2
translate y*rB3
rotate x*-45}
411 difference{torus{rB4
,rB2
} plane{x,0 inverse} translate <0,yB
,0>}
412 difference{torus{rB4
,rB1
} plane{x,0 inverse} translate <0,yB
*0.5,0>}
414 cylinder{0,y*yB
,rB1
translate -z*rB4
rotate y*i
}
421 difference{torus{rB3
,rB2
rotate z*90} plane{y,0} plane{z,0 inverse} plane{z,0 rotate x*-65}}
422 cylinder{0,-z*zB
*0.1,rB2
translate y*rB3
rotate x*-65}
425 translate z*(zB
+rB4
*2)
432 //--------------------------------------------
434 //--------------------------------------------
435 #
declare Guns0
=union{
436 superellipsoid{<0.3,0.3> translate z scale <0.8,1,4>}
440 cone{0,0.3,z*1.5,0.5}
455 sphere{0,1.3,1 scale <1,1.2,1>}
456 cylinder{0,-y*3,0.8,1}
459 cylinder{0,x*3.4,0.4,1 rotate y*Teta
}
460 cylinder{0,y,0.4,1 translate x*3 rotate y*Teta
}
461 sphere{0,0.6,1 translate x*3 rotate y*Teta
}
462 sphere{0,0.4,1 translate x*3 rotate y*(Teta
+6)}
463 sphere{0,0.4,1 translate x*3 rotate y*(Teta
+12)}
464 sphere{0,0.4,1 translate x*3 rotate y*(Teta
+18)}
465 sphere{0,0.4,1 translate x*3 rotate y*(Teta
+24)}
466 sphere{0,0.4,1 translate x*3 rotate y*(Teta
+30)}
467 sphere{0,0.4,1 translate x*3 rotate y*(Teta
+36)}
468 sphere{0,0.4,1 translate x*3 rotate y*(Teta
+42)}
469 sphere{0,0.4,1 translate x*3 rotate y*(Teta
+48)}
470 sphere{0,0.4,1 translate x*3 rotate y*(Teta
+54)}
471 sphere{0,0.5,1 translate x*3 rotate y*(Teta
+60)}
472 sphere{0,0.5,1 translate x*3 rotate y*(Teta
+66)}
473 #
declare Teta
=Teta
+72;
476 #
declare Guns1
=union{
478 object{Wheel
rotate y*10 scale 0.7 rotate z*90 translate -x*1.5}
485 box{-5,5 scale <1,1,0.05>}
486 box{-5,5 scale <1,1,0.05> translate z}
487 box{-5,5 scale <1,1,0.05> translate z*2}
488 box{-5,5 scale <1,1,0.05> translate z*3}
489 box{-5,5 scale <1,1,0.05> translate z*4}
490 box{-5,5 scale <1,1,0.05> translate -z}
491 box{-5,5 scale <1,1,0.05> translate -z*2}
492 box{-5,5 scale <1,1,0.05> translate -z*3}
493 box{-5,5 scale <1,1,0.05> translate -z*4}
497 #
declare Ring1
=union{
498 cylinder{-0.2*x,0.2*x,1.2}
499 torus{1.1,0.1 rotate z*90 scale <2,1,1> translate -x*0.2}
500 torus{1.1,0.1 rotate z*90 scale <2,1,1> translate x*0.2}
502 #
declare Elbow1
=intersection{torus{2,1} plane{z,0 inverse} plane{x,0 inverse} }
505 #
declare Thingie
=union{
506 torus{1.5,0.3 rotate z*90 translate -x}
508 superellipsoid{<0.2,0.2> scale <1.5,2,2.5> translate x*2.5}
509 object{Eye
scale 1.5/7 rotate -x*90 translate <2.5,0,-2.5>}
510 object{Eye
scale 1.5/7 rotate -x*90 translate <2.5,0,-2.5> scale <1,1,-1>}
511 sphere{0,1.5 scale <0.5,1,1> translate x*4}
512 sphere{0,1.5 scale <0.5,1,1> translate x*16}
513 cylinder{x*4,x*16,1.2}
514 torus{1.9,0.1 rotate z*90 translate x*16.5}
515 cylinder{x*16.5,x*17.5,2}
516 torus{1.9,0.1 rotate z*90 translate x*17.5}
517 cylinder{x*17.5,x*23,1.5}
520 intersection{torus{2.5,0.5 rotate x*90} plane{y,0 inverse} plane{x,0} translate x*2.5}
521 torus{0.5,0.1 translate -x*2.5 rotate z*-30 translate x*2.5 }
522 torus{0.5,0.1 translate -x*2.5 rotate z*-60 translate x*2.5 }
523 torus{0.5,0.1 translate -x*2.5 rotate z*-90 translate x*2.5 }
526 cylinder{2*x,5*x,0.7}
527 torus{0.5,0.2 rotate z*90 translate x*2}
528 torus{0.7,0.2 scale <0.2,1,1> rotate z*90 translate x*2.3}
529 torus{0.7,0.2 scale <0.2,1,1> rotate z*90 translate x*2.6}
530 torus{0.7,0.2 scale <0.2,1,1> rotate z*90 translate x*2.9}
531 torus{0.7,0.2 scale <0.2,1,1> rotate z*90 translate x*3.2}
532 torus{0.7,0.2 scale <0.2,1,1> rotate z*90 translate x*3.5}
533 torus{0.7,0.2 scale <0.2,1,1> rotate z*90 translate x*3.8}
534 torus{0.7,0.2 scale <0.2,1,1> rotate z*90 translate x*4.1}
535 torus{0.7,0.2 scale <0.2,1,1> rotate z*90 translate x*4.4}
536 torus{0.7,0.2 scale <0.2,1,1> rotate z*90 translate x*4.7}
537 torus{0.5,0.2 rotate z*90 translate x*5}
538 torus{0.5,0.3 rotate z*90 translate x*8}
539 cone{0,0.7,x,0.9 translate x*8}
540 torus{0.9,0.2 rotate z*90 translate x*9}
541 translate <2.5,2.5,0>
543 translate <2.5,2,1.7>
547 intersection{torus{2.5,0.5 rotate x*90} plane{y,0 inverse} plane{x,0} translate x*2.5}
548 torus{0.5,0.1 translate -x*2.5 rotate z*-30 translate x*2.5 }
549 torus{0.5,0.1 translate -x*2.5 rotate z*-60 translate x*2.5 }
550 torus{0.5,0.1 translate -x*2.5 rotate z*-90 translate x*2.5 }
553 cylinder{3*x,6*x,0.7}
554 torus{0.5,0.2 rotate z*90 translate x*3}
555 torus{0.7,0.2 scale <0.2,1,1> rotate z*90 translate x*3.3}
556 torus{0.7,0.2 scale <0.2,1,1> rotate z*90 translate x*3.6}
557 torus{0.7,0.2 scale <0.2,1,1> rotate z*90 translate x*3.9}
558 torus{0.7,0.2 scale <0.2,1,1> rotate z*90 translate x*4.2}
559 torus{0.7,0.2 scale <0.2,1,1> rotate z*90 translate x*4.5}
560 torus{0.7,0.2 scale <0.2,1,1> rotate z*90 translate x*4.8}
561 torus{0.7,0.2 scale <0.2,1,1> rotate z*90 translate x*5.1}
562 torus{0.7,0.2 scale <0.2,1,1> rotate z*90 translate x*5.4}
563 torus{0.7,0.2 scale <0.2,1,1> rotate z*90 translate x*5.7}
564 torus{0.5,0.2 rotate z*90 translate x*6}
565 torus{0.5,0.3 rotate z*90 translate x*8}
566 cone{0,0.7,x,0.9 translate x*8}
567 torus{0.9,0.2 rotate z*90 translate x*9}
568 translate <2.5,2.5,0>
570 translate <2.5,2,-1.7>
573 superellipsoid{<0.2,0.2> scale <1,1.3,2.6>}
574 object{Eye
scale 1/7 rotate -x*90 translate z*-2.6}
575 object{Eye
scale 1/7 rotate -x*90 translate z*2.6}
576 object{Eye
scale 1/7 rotate y*90 translate <0,1.3,1.7>}
577 object{Eye
scale 1/7 rotate y*90 translate <0,1.3,-1.7>}
579 torus{1,0.2 rotate z*90 translate x*3}
580 intersection{torus{4.5,1 rotate x*90} plane{y,0 inverse} plane{x,0 inverse} scale <0.5,1,1> translate <3,-4.5,0>}
581 torus{1,0.3 scale <0.5,4,1> translate <3+2.25,-3,0>}
587 box{<0,-0.1,-0.05>,<12,0.1,0.05> translate <4,1.2,0>}
588 cylinder{-x,2*x,0.1 translate y*1.5}
589 sphere{0,0.2 translate <20,1.5,0>}
590 sphere{0,0.1 translate <16.8,2,0>}
591 sphere{0,0.1 translate <17.2,2,0> rotate x*10}
592 cylinder{x*20,x*23,0.18 translate y*1.5}
595 #
declare Teta
=Teta
+20;
600 #
declare GunSupport
=union{
601 superellipsoid{<0.6,0.6> translate y scale <0.3,3,1> translate -z*2}
604 superellipsoid{<0.7,0.7> translate y scale <1.5,3.8,1>}
607 sphere{0,0.2 translate <-1,i
+0.5,0.8>}
608 sphere{0,0.2 translate <0,i
+0.1,1>}
609 sphere{0,0.2 translate <1,i
+0.5,0.8>}
612 rotate -x*10 translate z*0.6
615 cylinder{y*4,y*9,0.6}
616 sphere{0,1 scale <4,1,4>}
621 object{Thingie
rotate y*180 scale 0.5 rotate y*-90 rotate z*45 translate <0,4,5>}
622 superellipsoid{<0.6,0.6> translate -z scale <0.6,1,3> translate -x*0.5}
623 object{Guns1
translate -x*1.7}
624 object{Guns1
translate -x*1.7 scale <-1,1,1>}
631 #
declare GunsBack
=union{
633 object{Thingie
rotate y*180 scale 0.5 rotate y*-90 rotate z*45 translate <0,4,5>}
634 superellipsoid{<0.6,0.6> translate -z scale <0.6,1,3> translate -x*0.5}
635 object{Guns1
translate -x*1.7}
636 object{Guns1
translate -x*1.7 scale <-1,1,1>}
643 //--------------------------------------------
644 // snorkels and vertical thingies
645 //--------------------------------------------
646 #
declare Snorkel1
=union{
648 cone{y*2,0.25,y*3,0.1}
650 difference{sphere{0,1 scale<0.3,0.2,0.3>}plane{y,0 inverse}}
651 difference{sphere{0,1 scale<0.3,0.6,0.3>}plane{y,0}}
656 #
declare Snorkel2
=blob{
658 cylinder{-y,y*4,0.2,1}
659 sphere{0,0.4,1 scale <1,1,2> translate y*3.5}
660 sphere{0,0.3,1 scale <3,1,1> translate y*2.5}
663 #
declare Snorkel3
=union{
666 cylinder{0,y*3.4,0.25,1 scale <1,1,3>}
667 cylinder{0,y*5,0.03,1 translate <0,0,-0.5>}
672 sphere{0,0.1 translate y*4}
673 translate <-0.1,0,0.5>
678 //--------------------------------------------
679 // lots of decorative stuff
680 //--------------------------------------------
682 #
declare Deco
=array
[nDeco
]
683 #
declare Deco
[0]=union{
685 torus{1,0.2 rotate x*90 translate y*3}
688 #
declare Deco
[1]=cone{-y*0.5,0.2,y*4,0.1}
689 #
declare Deco
[2]=blob{
691 cylinder{-x,x,0.25,1 scale <1,1,2>}
692 cylinder{0,-y,0.21,1 translate -x*0.8}
693 cylinder{0,-y,0.21,1 translate x*0.8}
697 #
declare Deco
[3]=object{Deco
[2] rotate y*90}
698 #
declare Deco
[4]=torus{1,0.2 rotate z*90}
699 #
declare Deco
[5]=object{Deco
[3] rotate y*90 scale <1,1.4,1>}
700 #
declare Deco
[6]=union{
701 cylinder{0,y*0.4,0.1}
702 sphere{0,1 scale <0.1,0.1,0.5> translate y*0.4}
704 #
declare Deco
[7]=difference{sphere{0,1} cylinder{-z,0,0.8} scale <2,0.5,2>translate -y*0.2}
705 #
declare Deco
[8]=difference{sphere{0,1} cylinder{-z,0,0.9} scale <2,0.5,4>translate -y*0.2}
706 #
declare Deco
[9]=cone{0,0.08,y*2,0.03 scale <1,1,2>}
707 #
declare Deco
[10]=sphere{0,1 scale <0.2,0.1,0.4>}
708 #
declare Deco
[11]=object{Deco
[4] scale 1.2}
709 #
declare Deco
[12]=object{Deco
[5] scale 1.3}
710 #
declare Ladder
=union{
713 object{Deco
[3] scale 0.8 rotate z*90 translate y*i
*0.8}
718 #
declare Decos
=union{
727 #
declare Start
=<-rand(rd
)*5*(mod(k
,2)*2-1),1,(1-j
)*Start0
+j
*End0
>;
729 #
declare Norm1
=<0,0,0>;
730 #
declare Inter
=trace
( SubTop
, Start
, Dir
, Norm1
);
731 #
if (vlength(Norm1
)!=0)
732 #
if (vlength(vcross(Norm1
,y))<0.9)
733 #
declare n
=int(rand(rd
)*nDeco
);
734 object{Deco
[n
] scale 0.4 mOrient
(Inter
,Inter
+Norm1
)}
738 #
declare i
=i
+1/nstep
;
743 #
declare Submarine
=union{
746 object{Decos
texture{txtSubTop
}}
747 object{Ladder
translate <-1.5,4,40>}
748 object{Ladder
translate <1.5,4,40>}
749 object{Guns
rotate y*180 scale 0.3 translate <0,4,30>}
750 object{GunsBack
scale 0.3 translate <0,4,70>}
752 object{Snorkel1
translate z*3}
754 object{Snorkel3
translate -z*2}
758 object{Balustrade
scale 2.5 translate <-4,2,5>}
759 object{Balustrade
scale 2.5 translate <-4,2,5> scale <-1,1,1>}
761 object{Balustrade
scale 2 translate <-3,2,5>}
762 object{Balustrade
scale 2 translate <-3,2,5> scale <-1,1,1>}
774 //============================================
776 //============================================
777 #
declare posSub
=<19,5,0>;
780 //--------------------------------------------
782 //--------------------------------------------
785 object{Mine
rotate y*80 scale 14 }
786 light_source{<-10,-20,-40> color rgb -4 shadowless} // negative light !!!
787 translate <-110, 41, -205>
791 object{Mine
rotate -y*10 scale 8 }
792 light_source{<-10,-20,-40> color rgb -2 shadowless}
793 translate <-75, 25, -165>
796 object{Mine
rotate y*125 scale 5 translate <105, -5, -155>}
804 object{Mine
rotate y*125 scale 3 translate <50+rand(rd
)*(200+i
*10),(0.5-rand(rd
))*60,i
*30>}
805 object{Mine
rotate y*150 scale 3 translate <-50-rand(rd
)*(200+i
*10),(0.5-rand(rd
))*60,i
*30>}
807 object{Mine
rotate y*10 scale 3 translate <50+rand(rd
)*(200+i
*10),(0.5-rand(rd
))*140+50+i
*10,i
*30>}
808 object{Mine
rotate y*37 scale 3 translate <-50-rand(rd
)*(200+i
*10),(0.5-rand(rd
))*140+50+i
*10,i
*30>}
811 rotate y*rotSub
translate posSub
815 //--------------------------------------------
816 // submarine and media
817 //--------------------------------------------
819 object{Submarine
scale 3/4 translate z*-10 translate y*10}
820 sphere{0,1 scale 410 hollow
821 texture{pigment{Clear
}finish{ambient 0 diffuse 0}}
824 scattering {5,0.00034 eccentricity 0.7 extinction
0.8}
825 absorption
<255-23,255-171,255-239>*0.0005/255
833 rotate y*rotSub
translate posSub