Rigify: store advanced options in armature instead of window manager.
[blender-addons.git] / render_povray / templates_pov / abyss.pov
blob690d773750ea577f3067b813540268843d89e711
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 //--------------------------------------------
13 // -w320 -h120
14 // -w640 -h240 +a0.1
15 // -w768 -h288 +a0.1
16 // -w1024 -h384 +a0.1
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
22 #version 3.6;
24 global_settings{ assumed_gamma 1.0 max_trace_level 15 }
26 #declare AreaOK=false;
27 //#declare AreaOK=true;
29 #include "colors.inc"
30 #include "functions.inc"
31 //============================================
32 // General
33 //============================================
34 //--------------------------------------------
35 // Camera
36 //--------------------------------------------
37 #declare PdV=<-20, -20, -400>;
38 camera{
39 location PdV
40 angle 65 // direction z*2
41 up y
42 right x*image_width/image_height // keep proportions with any aspect ratio //right 8*x/3
43 look_at <-20, 30, 0>
46 //--------------------------------------------
47 // reorientation macro
48 //--------------------------------------------
49 #macro mOrient(P1,P2)
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>
54 #end
56 //--------------------------------------------
57 // colors
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 //--------------------------------------------
65 // lights
66 //--------------------------------------------
67 light_source {<-10, 1000, -10> color colWater2*10
68 #if (AreaOK)
69 area_light x*200,z*200, 3,3 adaptive 1 jitter orient
70 #end
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 //--------------------------------------------
77 // mine textures
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 //--------------------------------------------
89 // sub textures
90 //--------------------------------------------
91 #declare txtSkin=texture{
92 pigment{
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}
101 #declare trb=0.0001;
102 #declare pigLettre=pigment{bozo color_map{[0 White*1.3][1 White*0.5]}}
103 #declare txtLettre=texture{ // submarine name
104 pigment {
105 object {
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}
111 rotate y*90
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 {
125 pigment {
127 cells
128 color_map {
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]
132 scale <100,.125,1>
135 scale 3
136 finish {ambient 0 diffuse 0.3 specular 0.05 roughness 0.1}
139 #declare txtSubTop=
141 texture{txtSubBase}
142 texture {
143 pigment {
144 cells
145 color_map {
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>]
149 scale <100,0.75,1>
151 scale 3.5
152 finish {ambient 0 diffuse 0.3 specular 0.05 roughness 0.1}
155 texture {
156 pigment {
157 cells
158 color_map {
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>]
162 scale <100,0.45,1>
164 scale 2.5
165 finish {ambient 0 diffuse 0.3 specular 0.05 roughness 0.1}
168 texture{txtSkin}
170 #declare txtSubBottom=
172 texture{txtSubBase}
174 texture {
175 pigment {
176 cells
177 color_map {
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>]
181 scale <100,.75,1>
183 scale 5
184 finish {ambient 0 diffuse 0.3 specular 0.05 roughness 0.1}
187 texture {
188 pigment {
189 cells
190 color_map {
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>]
194 scale <100,0.25,1>
196 scale 5
197 translate 1
198 finish {ambient 0 diffuse 0.3 specular 0.05 roughness 0.1}
201 texture{txtLettre}
202 texture{txtSkin}
205 //============================================
206 // Mine
207 //============================================
208 //--------------------------------------------
209 // Spikes
210 //--------------------------------------------
212 #declare Spike = union{
213 #declare rSpike1=0.08;
214 #declare rSpike2=rSpike1*0.3;
215 #declare ySpike=0.4;
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
220 translate y
227 //--------------------------------------------
228 // Mine body
229 //--------------------------------------------
230 #declare rd=seed(0);
231 #declare MineBody=union {
232 isosurface {
233 function{x*x+y*y+z*z-1 +f_noise3d(x*10,y*10,z*10)*0.05}
234 max_gradient 2.492
235 contained_by{sphere{0,1}}
238 #declare i=0;
239 #while (i<360)
240 #declare j=0;
241 #while (j<180)
242 object{Spike rotate z*(i+rand(rd)*2) rotate y*(j+rand(rd)*2)}
243 #declare j=j+45;
244 #end
245 #declare i=i+45;
246 #end
248 object{Spike rotate 90*y}
249 object{Spike rotate -90*y}
250 rotate 360*rand(rd)
254 //--------------------------------------------
255 // Mine cable and decorative collar
256 //--------------------------------------------
257 #declare rFil=0.03;
258 #declare yFil=100;
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>}}
262 max_gradient 2.552
263 scale <1,-1,1>*3 translate -y
267 #declare MineCollar=lathe{
268 cubic_spline
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>
273 translate -y*0.363
276 //--------------------------------------------
277 // Mine
278 //--------------------------------------------
279 #declare Mine=union{
280 object{MineBody}
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}
285 object{MineCable}
286 texture{txtMine}
291 //============================================
292 // Submarine
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 //--------------------------------------------
302 // Main parts
303 //--------------------------------------------
304 #declare Part1=blob{ // bottom front
305 threshold 0.6
306 sphere{0,1,1}
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
313 threshold 0.6
314 sphere{0,1,1}
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
319 threshold 0.6
320 sphere{0,1,1}
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
325 threshold 0.6
326 sphere{0,1,1}
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 //--------------------------------------------
338 // Top
339 //--------------------------------------------
340 #declare HalfSubTop=union{
341 difference{
342 object{Part2} // top front
343 plane{y,0}
344 plane{z,0 inverse}
345 plane{x,0 inverse}
346 scale <SX,SYtop,SZfront>
348 difference{
349 object{Part4} // top rear
350 plane{y,0}
351 plane{z,0}
352 plane{x,0 inverse}
353 scale <SX,SYtop,SZrear>
356 #declare SubTop=union{
357 object{HalfSubTop}
358 object{HalfSubTop scale <-1,1,1>}
359 texture{txtSubTop}
361 //--------------------------------------------
362 // Bottom
363 //--------------------------------------------
364 #declare HalfSubBottom=union{
365 difference{
366 object{Part1} // bottom front
367 plane{y,0 inverse}
368 plane{z,0 inverse}
369 plane{x,0 inverse}
370 scale <SX,SYbot,SZfront>
372 difference{
373 object{Part3} // bottom rear
374 plane{y,0 inverse}
375 plane{z,0}
376 plane{x,0 inverse}
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{
390 #declare rB1=0.02;
391 #declare rB2=0.04;
392 #declare yB=1;
393 #declare rB3=yB*6;
394 #declare rB4=3;
395 #declare zB=20;
396 #declare zB2=8;
397 #declare i=0;
398 #while (i<zB)
399 cylinder{0,y*yB,rB1 translate z*i}
400 #declare i=i+zB/12;
401 #end
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}
405 union{
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}
408 translate y*(yB-rB3)
410 union{
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>}
413 #while (i<180)
414 cylinder{0,y*yB,rB1 translate -z*rB4 rotate y*i}
415 #declare i=i+180/14;
416 #end
417 scale <0.4,1,1>
418 translate z*(rB4+zB)
420 union{
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}
423 translate y*(yB-rB3)
424 scale <1,1,-1>
425 translate z*(zB+rB4*2)
432 //--------------------------------------------
433 // guns
434 //--------------------------------------------
435 #declare Guns0=union{
436 superellipsoid{<0.3,0.3> translate z scale <0.8,1,4>}
437 union{
438 cone{0,0.4,z*12,0.3}
439 union{
440 cone{0,0.3,z*1.5,0.5}
441 difference{
442 sphere{0,0.5}
443 cylinder{-z,z,0.3}
444 translate z*1.5
446 translate z*12
448 translate z*8
450 translate -z*3
453 #declare Wheel=blob{
454 threshold 0.6
455 sphere{0,1.3,1 scale <1,1.2,1>}
456 cylinder{0,-y*3,0.8,1}
457 #declare Teta=0;
458 #while (Teta<360)
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;
474 #end
476 #declare Guns1=union{
477 object{Guns0}
478 object{Wheel rotate y*10 scale 0.7 rotate z*90 translate -x*1.5}
481 #declare Eye=union{
482 torus{4.5,0.5}
483 difference{
484 sphere{0,4.3}
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}
494 scale <1,0.7,1>
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}
507 cylinder{-x,x,1.5}
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}
518 union{
519 torus{0.5,0.1}
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 }
524 union{
525 cylinder{0,9*x,0.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>
545 union{
546 torus{0.5,0.1}
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 }
551 union{
552 cylinder{0,9*x,0.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>
572 union{
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>}
578 cylinder{x,x*3,1}
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>}
582 translate <15,4.5,0>
584 #declare Teta=0;
585 #while (Teta<360)
586 union{
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}
593 rotate x*Teta
595 #declare Teta=Teta+20;
596 #end
598 translate x
600 #declare GunSupport=union{
601 superellipsoid{<0.6,0.6> translate y scale <0.3,3,1> translate -z*2}
602 union{
603 union{
604 superellipsoid{<0.7,0.7> translate y scale <1.5,3.8,1>}
605 #declare i=0;
606 #while (i<6)
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>}
610 #declare i=i+0.7;
611 #end
612 rotate -x*10 translate z*0.6
615 cylinder{y*4,y*9,0.6}
616 sphere{0,1 scale <4,1,4>}
619 #declare Guns=union{
620 union{
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>}
625 rotate x*-20
626 translate y*10
628 object{GunSupport}
631 #declare GunsBack=union{
632 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>}
637 rotate x*-5
638 translate y*10
640 object{GunSupport}
643 //--------------------------------------------
644 // snorkels and vertical thingies
645 //--------------------------------------------
646 #declare Snorkel1=union{
647 cone{0,0.3,y*2,0.25}
648 cone{y*2,0.25,y*3,0.1}
649 union{
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}}
652 translate y*3
654 scale <0.8,1,0.8>
656 #declare Snorkel2=blob{
657 threshold 0.6
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}
661 scale <0.8,1,0.8>
663 #declare Snorkel3=union{
664 blob{
665 threshold 0.6
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>}
670 union{
671 cylinder{0,y*4,0.03}
672 sphere{0,0.1 translate y*4}
673 translate <-0.1,0,0.5>
675 scale <0.8,1,0.8>
678 //--------------------------------------------
679 // lots of decorative stuff
680 //--------------------------------------------
681 #declare nDeco=13;
682 #declare Deco=array[nDeco]
683 #declare Deco[0]=union{
684 cylinder{0,y*2,0.2}
685 torus{1,0.2 rotate x*90 translate y*3}
686 scale 0.5
688 #declare Deco[1]=cone{-y*0.5,0.2,y*4,0.1}
689 #declare Deco[2]=blob{
690 threshold 0.6
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}
694 translate y*0.7
695 scale 1
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{
711 #declare i=0;
712 #while (i<9)
713 object{Deco[3] scale 0.8 rotate z*90 translate y*i*0.8}
714 #declare i=i+1;
715 #end
718 #declare Decos=union{
719 #declare rd=seed(4);
720 #declare Start0=-40;
721 #declare End0=40;
722 #declare nstep=200;
723 #declare i=0;
724 #declare k=0;
725 #while (i<1)
726 #declare j=i;
727 #declare Start=<-rand(rd)*5*(mod(k,2)*2-1),1,(1-j)*Start0+j*End0>;
728 #declare Dir=y;
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)}
735 #end
736 #end
737 #declare k=k+1;
738 #declare i=i+1/nstep;
739 #end
743 #declare Submarine=union{
744 union{
745 object{SubTop}
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>}
751 union{
752 object{Snorkel1 translate z*3}
753 object{Snorkel2}
754 object{Snorkel3 translate -z*2}
755 scale 2*<1,1.1,1>
756 translate <0,10,50>
758 object{Balustrade scale 2.5 translate <-4,2,5>}
759 object{Balustrade scale 2.5 translate <-4,2,5> scale <-1,1,1>}
760 union{
761 object{Balustrade scale 2 translate <-3,2,5>}
762 object{Balustrade scale 2 translate <-3,2,5> scale <-1,1,1>}
763 rotate y*180
764 translate z*100
766 texture{txtSub0}
767 scale <1,1.3,1>
769 object{SubBottom}
774 //============================================
775 // Final
776 //============================================
777 #declare posSub=<19,5,0>;
778 #declare rotSub=-15;
780 //--------------------------------------------
781 // mines
782 //--------------------------------------------
783 union{
784 light_group{
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>
788 global_lights on
790 light_group{
791 object{Mine rotate -y*10 scale 8 }
792 light_source{<-10,-20,-40> color rgb -2 shadowless}
793 translate <-75, 25, -165>
794 global_lights on
796 object{Mine rotate y*125 scale 5 translate <105, -5, -155>}
797 translate y*-8
799 union{
800 #declare rd=seed(0);
801 #declare i=0;
802 #while (i<20)
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>}
809 #declare i=i+1;
810 #end
811 rotate y*rotSub translate posSub
812 translate -z*150
813 translate x*30
815 //--------------------------------------------
816 // submarine and media
817 //--------------------------------------------
818 union{
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}}
822 interior{
823 media{
824 scattering {5,0.00034 eccentricity 0.7 extinction 0.8}
825 absorption <255-23,255-171,255-239>*0.0005/255
826 intervals 3
827 method 3
832 scale 4
833 rotate y*rotSub translate posSub