1// Insert menu illustration scene
2// Created June-August 2001 by Christoph Hormann
3// Updated to 3.7 by Friedrich A. Lohmueller, June-2012
4
5// ----- pattern texture attributes submenu -----
6
7// -w120 -h48 +a0.1 +am2 -j +r3
8
9#version 3.7;
10global_settings{ assumed_gamma 1.0 }
11
12#include "colors.inc"
13#include "shapes.inc"
14
15/*
16#declare Typ=1;     // waveform
17#declare Typ=2;     // frequency
18#declare Typ=3;     // phase
19#declare Typ=4;     // turbulence
20#declare Typ=5;     // turbulence warp
21#declare Typ=6;     // black_hole warp
22#declare Typ=7;     // repeat warp
23#declare Typ=8;     // mapping warp
24*/
25
26global_settings {
27 // assumed_gamma 1
28  max_trace_level 5
29}
30
31light_source {
32  <1.5, 2.5, 2.5>*10000
33  color rgb 1.0
34}
35
36camera {
37  #if (Typ=1)
38    location    <0, 20, 7.5>*4      // waveform
39  #else
40    location    <5, 20, 7.5>*4
41  #end
42  direction   y
43  sky         z
44  up          z
45  right x*image_width/image_height//right       (120/48)*x
46  look_at     <0, 0, -0.1>
47  angle       7
48}
49
50sky_sphere {
51  pigment {
52    gradient y
53    color_map {
54      [0.0 rgb <0.6,0.7,1.0>]
55      [1.0 rgb <0.2,0.2,0.8>]
56    }
57  }
58}
59
60// ----------------------------------------
61
62plane
63{
64  z, -1
65  texture
66  {
67    pigment { color rgb 1 }
68    finish {
69      diffuse 0.7
70      specular 0.4
71      roughness 0.01
72
73      reflection { 0.5 , 1.0
74        fresnel on
75        metallic 0.8
76      }
77      conserve_energy
78
79    }
80  }
81}
82
83
84// =============================================
85
86#if (Typ=1)       // waveform
87
88#declare Cnt=0;
89
90#while (Cnt < 5)
91
92  #local fn_grad=
93  function {
94    pigment {
95      gradient x
96      color_map { [0 rgb 0][1 rgb 1] }
97      #switch (Cnt)
98        #case (1)
99          triangle_wave
100          #break
101        #case (2)
102          scallop_wave
103          #break
104        #case (3)
105          sine_wave
106          #break
107        #case (4)
108          poly_wave 2
109          #break
110        #else
111          ramp_wave
112      #end
113
114      scale 1.2
115
116    }
117  }
118
119  #declare Tex1=
120  texture {
121    pigment {
122      function { fn_grad(x, y, z).gray }
123      color_map { [0 rgb 0][1 rgb 1] }
124    }
125    finish { ambient 0.2 specular 0.4 }
126  }
127
128  object {
129    isosurface {
130      function { z-fn_grad(x, y, 0).gray*0.5 }
131
132      max_gradient
133      #switch (Cnt)
134        #case (0) 1000 #break
135        #case (1) 0.4 #break
136        #case (2) 0.4 #break
137        #case (3) 0.4 #break
138        #case (4) 975 #break
139      #end
140      accuracy 0.001
141      contained_by { box { <-0.8, -1.2, -1.2> <0.8, 1.2, 1.2> } }
142    }
143
144    texture { Tex1 }
145    no_shadow
146    translate <-4.0+Cnt*2, 0, 0>
147  }
148
149  #undef fn_grad
150
151  #declare Cnt=Cnt+1;
152#end
153
154#end
155
156// =============================================
157
158#if ((Typ=2) | (Typ=3) | (Typ=4))
159
160#declare Cnt=0;
161
162#while (Cnt < 3)
163
164  #declare Tex1=
165  texture {
166    pigment {
167      crackle
168      triangle_wave
169
170      //-----------------
171
172      #if (Typ=2)
173        frequency (Cnt)+1
174        color_map { [0 color SteelBlue][1 rgb <1.2, 1.2, 1.4>] }
175      #end
176
177      //-----------------
178
179      #if (Typ=3)
180        phase Cnt*(1/4)
181        color_map { [0 color MediumSeaGreen][1 rgb <1.2, 1.2, 1.4>] }
182      #end
183      //-----------------
184
185      #if (Typ=4)
186        turbulence Cnt*(1/2)
187        color_map { [0 color Firebrick][1 rgb <1.2, 1.2, 1.4>] }
188      #end
189
190      //-----------------
191
192    }
193    finish { diffuse 1 brilliance 2 }
194
195  }
196
197  object {
198    Round_Box (<-1.2, -1.2, -1.2>, <1.2, 1.2, 1.2>, 0.1, 0)
199
200    texture { Tex1 }
201    no_shadow
202    translate <-3.4+Cnt*3.2, 0, 0>
203  }
204  #declare Cnt=Cnt+1;
205#end
206
207#end
208
209// =============================================
210
211#if ((Typ=5) | (Typ=6) | (Typ=7) | (Typ=8))
212
213#declare Cnt=0;
214
215#while (Cnt < 2)
216
217  #declare Tex1=
218  texture {
219    pigment {
220
221      //-----------------
222
223      #if (Typ=5)
224
225      marble
226      color_map { [0.3 color NavyBlue][0.7 rgb <1.2, 1.2, 1.4>] }
227
228      scale 1+Cnt*2
229      warp {
230        turbulence 0.7
231      }
232      scale 1/(1+Cnt*2)
233
234      #end
235
236      //-----------------
237
238      #if (Typ=6)
239
240      marble
241      color_map { [0.3 color Maroon][0.7 rgb <1.2, 1.2, 1.4>] }
242
243      scale 0.6
244      warp {
245        black_hole <0, 1.2, 0>, 2
246        strength 2.2
247        falloff 2.5
248
249        #if (Cnt=0)
250          inverse
251        #end
252      }
253
254      #end
255
256      //-----------------
257
258      #if (Typ=7)
259
260      wood
261      color_map { [0.3 color MediumSeaGreen][0.7 rgb <1.2, 1.2, 1.4>] }
262
263      rotate 90*x
264
265      scale 0.4
266      warp { repeat x }
267
268      #if (Cnt=0)
269        warp { repeat z }
270      #end
271
272      #end
273
274      //-----------------
275
276      #if (Typ=8)
277
278      checker
279      color Copper,
280      color rgb <1.2, 1.2, 1.4>
281
282      scale 0.5
283
284      #if (Cnt=0)
285        warp {
286          planar
287        }
288      #else
289        warp {
290          cylindrical
291        }
292      #end
293
294      #end
295
296      //-----------------
297
298    }
299    finish { diffuse 1 brilliance 2 }
300  }
301
302  object {
303    object { Round_Box (<-2, -1.2, -1.2>, <2, 1.2, 1.2>, 0.1, 0) }
304
305    texture { Tex1 }
306    no_shadow
307    translate <-2.5+Cnt*5, 0, 0>
308  }
309  #declare Cnt=Cnt+1;
310#end
311
312#end
313
314