-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackground.pov
268 lines (231 loc) · 10.7 KB
/
background.pov
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
#version 3.7;
#include "functions.inc"
global_settings {
assumed_gamma 1.0
charset utf8
}
camera {
orthographic
right image_width * x
up -image_height * y
direction z
location <image_width/2, image_height/2, -200>
}
#default {
finish {
ambient rgb <1, 1, 1>
diffuse 0
brilliance 0
}
}
#declare p_background = pigment {
dents
noise_generator 2
scale 10
}
// dents
// noise_generator 2
// scale 20
// 0.0003721: 0.1130, 0.1909, 0.2919, 0.4074
// <-931.1459917230, -799.7643692644, -428.9891080773>, 0.6742238850547019
// dents
// noise_generator 2
// scale 15
// 0.0002985: 0.1120, 0.1916, 0.2937, 0.4067
// <8990.3548082631, 14269.2260653904, -817.4396003401>, 0.8000000000000000
// dents
// noise_generator 2
// scale 10
// 0.0000818: 0.1058, 0.1934, 0.3011, 0.4017
// <3185.6254086501, 1148.7529250484, 4368.7748457533>, 0.9275106025870326
/*
#declare S = seed(0);
#declare m = 1000*10;
#declare min_d = 0.001;
#for (i, 0, 10000000)
#declare p = <(rand(S) * 2 - 1) * m, (rand(S) * 2 - 1) * m, (rand(S) * 2 - 1) * m>;
#declare f = function {
pigment {
p_background
translate p
}
}
#declare c1 = f(-1.5, 0, 0).gray;
#declare c2 = f(-0.5, 0, 0).gray;
#declare c3 = f(0.5, 0, 0).gray;
#declare c4 = f(1.5, 0, 0).gray;
#undef f
#if (c1 < c2 & c2 < c3 & c3 < c4)
#declare d1 = c1 - 0.1;
#declare d2 = c2 - 0.2;
#declare d3 = c3 - 0.3;
#declare d4 = c4 - 0.4;
#declare d = d1 * d1 + d2 * d2 + d3 * d3 + d4 * d4;
#if (d < min_d)
#declare min_d = d;
#declare shift = p;
#debug concat(str(min_d, 0, 7), ": ", str(c1, 0, 4), ", ", str(c2, 0, 4), ", ", str(c3, 0, 4), ", ", str(c4, 0, 4), "\n")
#end
#end
#end
#debug concat("<", vstr(3, shift, ", ", 0, 10), ">\n")
*/
//#declare p = shift;
//#declare s = 1;
#declare p = <3185.6254086501, 1148.7529250484, 4368.7748457533>;
#declare s = 0.9275106025870326;
#declare c1 = eval_pigment(pigment { p_background translate p scale s}, <-1.5, 0, 0>).gray;
#declare c2 = eval_pigment(pigment { p_background translate p scale s}, <-0.5, 0, 0>).gray;
#declare c3 = eval_pigment(pigment { p_background translate p scale s}, <0.5, 0, 0>).gray;
#declare c4 = eval_pigment(pigment { p_background translate p scale s}, <1.5, 0, 0>).gray;
#declare d = (c1 - 0.1) * (c1 - 0.1) + (c2 - 0.2) * (c2 - 0.2) + (c3 - 0.3) * (c3 - 0.3) + (c4 - 0.4) * (c4 - 0.4);
#declare e = 0.0001;
#declare e2 = e * 2;
#for (i, 0, 1000)
#declare c1 = eval_pigment(pigment { p_background translate p scale s }, <-1.5 + e, 0, 0>).gray;
#declare c2 = eval_pigment(pigment { p_background translate p scale s }, <-0.5 + e, 0, 0>).gray;
#declare c3 = eval_pigment(pigment { p_background translate p scale s }, <0.5 + e, 0, 0>).gray;
#declare c4 = eval_pigment(pigment { p_background translate p scale s }, <1.5 + e, 0, 0>).gray;
#declare d_left = (c1 - 0.1) * (c1 - 0.1) + (c2 - 0.2) * (c2 - 0.2) + (c3 - 0.3) * (c3 - 0.3) + (c4 - 0.4) * (c4 - 0.4);
#declare c1 = eval_pigment(pigment { p_background translate p scale s }, <-1.5 - e, 0, 0>).gray;
#declare c2 = eval_pigment(pigment { p_background translate p scale s }, <-0.5 - e, 0, 0>).gray;
#declare c3 = eval_pigment(pigment { p_background translate p scale s }, <0.5 - e, 0, 0>).gray;
#declare c4 = eval_pigment(pigment { p_background translate p scale s }, <1.5 - e, 0, 0>).gray;
#declare d_right = (c1 - 0.1) * (c1 - 0.1) + (c2 - 0.2) * (c2 - 0.2) + (c3 - 0.3) * (c3 - 0.3) + (c4 - 0.4) * (c4 - 0.4);
#declare c1 = eval_pigment(pigment { p_background translate p scale s }, <-1.5, e, 0>).gray;
#declare c2 = eval_pigment(pigment { p_background translate p scale s }, <-0.5, e, 0>).gray;
#declare c3 = eval_pigment(pigment { p_background translate p scale s }, <0.5, e, 0>).gray;
#declare c4 = eval_pigment(pigment { p_background translate p scale s }, <1.5, e, 0>).gray;
#declare d_up = (c1 - 0.1) * (c1 - 0.1) + (c2 - 0.2) * (c2 - 0.2) + (c3 - 0.3) * (c3 - 0.3) + (c4 - 0.4) * (c4 - 0.4);
#declare c1 = eval_pigment(pigment { p_background translate p scale s }, <-1.5, -e, 0>).gray;
#declare c2 = eval_pigment(pigment { p_background translate p scale s }, <-0.5, -e, 0>).gray;
#declare c3 = eval_pigment(pigment { p_background translate p scale s }, <0.5, -e, 0>).gray;
#declare c4 = eval_pigment(pigment { p_background translate p scale s }, <1.5, -e, 0>).gray;
#declare d_down = (c1 - 0.1) * (c1 - 0.1) + (c2 - 0.2) * (c2 - 0.2) + (c3 - 0.3) * (c3 - 0.3) + (c4 - 0.4) * (c4 - 0.4);
#declare c1 = eval_pigment(pigment { p_background translate p scale s }, <-1.5, 0, e>).gray;
#declare c2 = eval_pigment(pigment { p_background translate p scale s }, <-0.5, 0, e>).gray;
#declare c3 = eval_pigment(pigment { p_background translate p scale s }, <0.5, 0, e>).gray;
#declare c4 = eval_pigment(pigment { p_background translate p scale s }, <1.5, 0, e>).gray;
#declare d_back = (c1 - 0.1) * (c1 - 0.1) + (c2 - 0.2) * (c2 - 0.2) + (c3 - 0.3) * (c3 - 0.3) + (c4 - 0.4) * (c4 - 0.4);
#declare c1 = eval_pigment(pigment { p_background translate p scale s }, <-1.5, 0, -e>).gray;
#declare c2 = eval_pigment(pigment { p_background translate p scale s }, <-0.5, 0, -e>).gray;
#declare c3 = eval_pigment(pigment { p_background translate p scale s }, <0.5, 0, -e>).gray;
#declare c4 = eval_pigment(pigment { p_background translate p scale s }, <1.5, 0, -e>).gray;
#declare d_forward = (c1 - 0.1) * (c1 - 0.1) + (c2 - 0.2) * (c2 - 0.2) + (c3 - 0.3) * (c3 - 0.3) + (c4 - 0.4) * (c4 - 0.4);
#declare c1 = eval_pigment(pigment { p_background translate p scale s - e }, <-1.5, 0, 0>).gray;
#declare c2 = eval_pigment(pigment { p_background translate p scale s - e }, <-0.5, 0, 0>).gray;
#declare c3 = eval_pigment(pigment { p_background translate p scale s - e }, <0.5, 0, 0>).gray;
#declare c4 = eval_pigment(pigment { p_background translate p scale s - e }, <1.5, 0, 0>).gray;
#declare d_shrink = (c1 - 0.1) * (c1 - 0.1) + (c2 - 0.2) * (c2 - 0.2) + (c3 - 0.3) * (c3 - 0.3) + (c4 - 0.4) * (c4 - 0.4);
#declare c1 = eval_pigment(pigment { p_background translate p scale s + e }, <-1.5, 0, 0>).gray;
#declare c2 = eval_pigment(pigment { p_background translate p scale s + e }, <-0.5, 0, 0>).gray;
#declare c3 = eval_pigment(pigment { p_background translate p scale s + e }, <0.5, 0, 0>).gray;
#declare c4 = eval_pigment(pigment { p_background translate p scale s + e }, <1.5, 0, 0>).gray;
#declare d_grow = (c1 - 0.1) * (c1 - 0.1) + (c2 - 0.2) * (c2 - 0.2) + (c3 - 0.3) * (c3 - 0.3) + (c4 - 0.4) * (c4 - 0.4);
#declare d1 = <(d - d_left), (d - d_up), (d - d_back) > / e;
#declare d2 = <(d_right - d), (d_down - d), (d_forward - d )> / e;
#declare s1 = (d - d_shrink) / e;
#declare s2 = (d_grow - d) / e;
#declare dd = (d2 - d1) / e;
#declare ss = (s2 - s1) / e;
//#declare ss = 0;
#declare squared = vdot(dd, dd) + ss * ss;;
#if (squared = 0)
#break
#end
#declare dstep = dd / squared;
#declare sstep = ss / squared;
#declare len = sqrt(squared);
#declare de = dd / len * e;
#declare se = ss / len * e;
#declare c1 = eval_pigment(pigment { p_background translate p scale s - se}, <-1.5, 0, 0> + de).gray;
#declare c2 = eval_pigment(pigment { p_background translate p scale s - se}, <-0.5, 0, 0> + de).gray;
#declare c3 = eval_pigment(pigment { p_background translate p scale s - se}, <0.5, 0, 0> + de).gray;
#declare c4 = eval_pigment(pigment { p_background translate p scale s - se}, <1.5, 0, 0> + de).gray;
#declare d_behind = (c1 - 0.1) * (c1 - 0.1) + (c2 - 0.2) * (c2 - 0.2) + (c3 - 0.3) * (c3 - 0.3) + (c4 - 0.4) * (c4 - 0.4);
#declare c1 = eval_pigment(pigment { p_background translate p scale s + se}, <-1.5, 0, 0> - de).gray;
#declare c2 = eval_pigment(pigment { p_background translate p scale s + se}, <-0.5, 0, 0> - de).gray;
#declare c3 = eval_pigment(pigment { p_background translate p scale s + se}, <0.5, 0, 0> - de).gray;
#declare c4 = eval_pigment(pigment { p_background translate p scale s + se}, <1.5, 0, 0> - de).gray;
#declare d_ahead = (c1 - 0.1) * (c1 - 0.1) + (c2 - 0.2) * (c2 - 0.2) + (c3 - 0.3) * (c3 - 0.3) + (c4 - 0.4) * (c4 - 0.4);
#declare dv = (d_ahead - d_behind) / e2;
#declare p = p - dv * dstep;
#declare s = max(min(s - dv * sstep, 1.25), 0.8);
#declare c1 = eval_pigment(pigment { p_background translate p scale s}, <-1.5, 0, 0>).gray;
#declare c2 = eval_pigment(pigment { p_background translate p scale s}, <-0.5, 0, 0>).gray;
#declare c3 = eval_pigment(pigment { p_background translate p scale s}, <0.5, 0, 0>).gray;
#declare c4 = eval_pigment(pigment { p_background translate p scale s}, <1.5, 0, 0>).gray;
#declare d = (c1 - 0.1) * (c1 - 0.1) + (c2 - 0.2) * (c2 - 0.2) + (c3 - 0.3) * (c3 - 0.3) + (c4 - 0.4) * (c4 - 0.4);
#end
#declare c1 = eval_pigment(pigment { p_background translate p scale s}, <-1.5, 0, 0>).gray;
#declare c2 = eval_pigment(pigment { p_background translate p scale s}, <-0.5, 0, 0>).gray;
#declare c3 = eval_pigment(pigment { p_background translate p scale s}, <0.5, 0, 0>).gray;
#declare c4 = eval_pigment(pigment { p_background translate p scale s}, <1.5, 0, 0>).gray;
#declare d = (c1 - 0.1) * (c1 - 0.1) + (c2 - 0.2) * (c2 - 0.2) + (c3 - 0.3) * (c3 - 0.3) + (c4 - 0.4) * (c4 - 0.4);
#debug concat(str(d, 0, 7), ": ", str(c1, 0, 4), ", ", str(c2, 0, 4), ", ", str(c3, 0, 4), ", ", str(c4, 0, 4), "\n")
#debug concat("<", vstr(3, p, ", ", 0, 10), ">, ", str(s, 0, 16), "\n")
#declare p_transformed = pigment {
p_background
translate p
scale s
}
#declare cm_top = color_map {
[0.0 color rgb < 3/15, 3/15, 3/15>]
[0.2 color rgb < 9/15, 3/15, 5/15>]
[0.4 color rgb <11/15, 3/15, 9/15>]
[0.6 color rgb < 9/15, 9/15, 11/15>]
[1.0 color rgb <13/15, 13/15, 15/15>]
}
#declare cm_background = color_map {
[0.0 color rgb <3/15, 6/15, 3/15>]
[0.1 color rgb <3/15, 3/15, 3/15>]
[0.2 color rgb <6/15, 3/15, 3/15>]
[0.3 color rgb <6/15, 7/15, 3/15>]
[0.4 color rgb <6/15, 7/15, 6/15>]
[0.5 color rgb <9/15, 9/15, 9/15>]
[0.6 color rgb <7/15, 6/15, 6/15>]
[0.7 color rgb <7/15, 6/15, 3/15>]
[0.8 color rgb <3/15, 6/15, 3/15>]
[0.9 color rgb <3/15, 3/15, 3/15>]
[1.0 color rgb <0/15, 0/15, 0/15>]
}
#declare cm_bottom = color_map {
[0.0 color rgb <3/15, 6/15, 6/15>]
[0.1 color rgb <3/15, 4/15, 4/15>]
[0.2 color rgb <3/15, 5/15, 5/15>]
[0.3 color rgb <5/15, 6/15, 6/15>]
[0.4 color rgb <7/15, 7/15, 8/15>]
[0.5 color rgb <9/15, 9/15, 9/15>]
[1.0 color rgb <6/15, 6/15, 6/15>]
}
/*
difference {
box { <0, 0, -198>, <320, 200, 198> }
box { <1, 1, -199>, <319, 199, 199> }
texture {
pigment { color rgb <1, 0, 0> }
}
}
*/
plane {
-z, 0
rotate (degrees(atan(sqrt(1/2))) - 90) * x
texture {
pigment {
pigment_pattern {
gradient y
scale 200
translate -100.5 * y
scale 5/4
}
pigment_map {
[0.0 p_transformed color_map { cm_top }]
[0.3 p_transformed color_map { cm_background }]
[0.5 p_transformed color_map { cm_background }]
[0.9 p_transformed color_map { cm_bottom }]
}
}
}
//rotate (degrees(atan(sqrt(1/2))) - 90) * x
translate <102, 100.5, 0>
}