2
Copyright 2005 by Mark Weyer
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32
#declare Hintergrund=0;
35
#include "cuyopov.inc"
40
#declare Colour=<0,1,0>;
41
#declare Stream = seed(2);
45
#declare Colour=<1,0,0>;
46
#declare Stream = seed(1);
54
#declare Angle_deg = 0;
55
#declare Angle_rad = Angle_deg*pi/180;
56
#declare Height = 1/cos(Angle_rad);
58
#declare Blob_aux_func = function(a){pow(1-pow(a,2),2)}
60
#declare Main_num = 100;
61
#declare Main_rad = 1/4;
62
#declare Main_strength = 3;
63
#declare Main_thick = 1/4;
65
//#declare Blob_func = function(X,Y,Z){Blob_aux_func(min(1,sqrt(X*X+Y*Y+Z*Z)/Main_rad))}
66
#declare Blob_func = function(X,Y,Z){pow(max(0,1-(X*X+Y*Y+Z*Z)/(Main_rad*Main_rad)),2)}
77
#if (Blob_test(XX,YY,Main_pos[i][0],Main_pos[i][1],P))
93
#declare Main_pos = array[Main_num][3];
97
#declare Main_pos[i][0]=rand(Stream);
98
#declare Main_pos[i][1]=rand(Stream)*Height;
99
#declare Main_pos[i][2]=(rand(Stream)-1/2)*Main_thick;
104
((A)&(!(B))) | ((B)&(!(A)))
108
(A)-floor((A)/(B))*(B)
111
#macro Blob_pretest(X,Y,P)
112
Xor(P,(Mod(X+Y+Y,5)=0))
115
#macro Blob_test(X,Y,XX,YY,P)
116
(Blob_pretest(X,Y,P) &
117
(Blob_pretest(X-1,Y,P) | (XX>=Main_rad)) &
118
(Blob_pretest(X+1,Y,P) | (XX<=1-Main_rad)) &
119
(Blob_pretest(X,Y-1,P) | (YY>=Main_rad)) &
120
(Blob_pretest(X,Y+1,P) | (YY<=Height-Main_rad)) &
121
(Blob_pretest(X-1,Y-1,P) | (pow(XX,2)+pow(YY,2)>=pow(Main_rad,2))) &
122
(Blob_pretest(X-1,Y+1,P) | (pow(XX,2)+pow(Height-YY,2)>=pow(Main_rad,2))) &
123
(Blob_pretest(X+1,Y+1,P) | (pow(1-XX,2)+pow(Height-YY,2)>=pow(Main_rad,2))) &
124
(Blob_pretest(X+1,Y-1,P) | (pow(1-XX,2)+pow(YY,2)>=pow(Main_rad,2))))
127
#macro Bubble_rad1(T) (pow((T)+1,1/3)/5) #end
128
#macro Bubble_rad2(T) (Bubble_rad1(T)*0.9) #end
130
(<1/2,Height/2,Main_thick/2>+<0,0,-Bubble_rad1(T)>*((T)-2)/2) #end
131
#macro Bubble_strength1(T) 100 #end
132
#macro Bubble_strength2(T) (Bubble_strength1(T)*1.1) #end
140
pigment {color <0,0,0,0,1>}
147
pigment {color <0,0,0,0,1>}
154
scattering {1, rgb Colour*2}
166
#if (Blob_pretest(X,Y,P))
169
#if (Blob_test(X,Y,Main_pos[i][0],Main_pos[i][1],P))
171
<Main_pos[i][0]+X,Main_pos[i][1]+Y*Height,Main_pos[i][2]>
179
<X,Y*Height,0>+Bubble_pos(Time)
181
-Bubble_strength1(Time)
184
<X,Y*Height,0>+Bubble_pos(Time)
186
Bubble_strength2(Time)
195
translate <-1/2,-Height/2,0>