~ubuntu-branches/ubuntu/saucy/cuyo/saucy

« back to all changes in this revision

Viewing changes to datasrc/pics/slime2.pov

  • Committer: Bazaar Package Importer
  • Author(s): Angel Abad
  • Date: 2010-07-19 09:54:44 UTC
  • mfrom: (4.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100719095444-ecoegzo1vvvdwra9
Tags: 2.~-1.1.brl3-1ubuntu1
* Merge from debian unstable (LP: #607106). Remaining changes:
  - Don't register MimeType=application/x-executable in
    the .desktop file.
  - Remove UTF-8 in the .desktop file
  - 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
    Copyright 2005 by Mark Weyer
3
 
 
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.
8
 
 
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.
13
 
 
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
17
 
*/
18
 
 
19
 
#declare Breite=5;
20
 
#declare Hoehe=1;
21
 
 
22
 
#ifndef(Case)
23
 
  #declare Case=1;
24
 
  #declare Breite=8;
25
 
  #declare Hoehe=6;
26
 
#end
27
 
 
28
 
#ifndef(Time)
29
 
  #declare Time = 100;
30
 
#end
31
 
 
32
 
#declare Hintergrund=0;
33
 
 
34
 
 
35
 
#include "cuyopov.inc"
36
 
 
37
 
 
38
 
 
39
 
#if(Case=1)
40
 
  #declare Colour=<0,1,0>;
41
 
  #declare Stream = seed(2);
42
 
#end
43
 
 
44
 
#if(Case=2)
45
 
  #declare Colour=<1,0,0>;
46
 
  #declare Stream = seed(1);
47
 
#end
48
 
 
49
 
 
50
 
global_settings {
51
 
  max_trace_level 100
52
 
}
53
 
 
54
 
#declare Angle_deg = 0;
55
 
#declare Angle_rad = Angle_deg*pi/180;
56
 
#declare Height = 1/cos(Angle_rad);
57
 
 
58
 
#declare Blob_aux_func = function(a){pow(1-pow(a,2),2)}
59
 
 
60
 
#declare Main_num = 100;
61
 
#declare Main_rad = 1/4;
62
 
#declare Main_strength = 3;
63
 
#declare Main_thick = 1/4;
64
 
 
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)}
67
 
 
68
 
#macro Main_func(P)
69
 
  function (X,Y,Z) {
70
 
    1-Main_strength*(0
71
 
    #local XX=-3;
72
 
    #while (XX<4)
73
 
      #local YY=-1;
74
 
      #while (YY<2)
75
 
        #local i=0;
76
 
        #while (i<Main_num)
77
 
          #if (Blob_test(XX,YY,Main_pos[i][0],Main_pos[i][1],P))
78
 
            +Blob_func(
79
 
              X-XX-Main_pos[i][0],
80
 
              Y-YY-Main_pos[i][1],
81
 
              Z-Main_pos[i][2])
82
 
          #end
83
 
          #local i=i+1;
84
 
        #end
85
 
        #local YY=YY+1;
86
 
      #end
87
 
      #local XX=XX+1;
88
 
    #end
89
 
    )
90
 
  }
91
 
#end
92
 
 
93
 
#declare Main_pos = array[Main_num][3];
94
 
 
95
 
#local i=0;
96
 
#while (i<Main_num)
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;
100
 
  #local i=i+1;
101
 
#end
102
 
 
103
 
#macro Xor(A,B)
104
 
  ((A)&(!(B))) | ((B)&(!(A)))
105
 
#end
106
 
 
107
 
#macro Mod(A,B)
108
 
  (A)-floor((A)/(B))*(B)
109
 
#end
110
 
 
111
 
#macro Blob_pretest(X,Y,P)
112
 
  Xor(P,(Mod(X+Y+Y,5)=0))
113
 
#end
114
 
 
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))))
125
 
#end
126
 
 
127
 
#macro Bubble_rad1(T) (pow((T)+1,1/3)/5) #end
128
 
#macro Bubble_rad2(T) (Bubble_rad1(T)*0.9) #end
129
 
#macro Bubble_pos(T)
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
133
 
 
134
 
 
135
 
 
136
 
 
137
 
 
138
 
#macro Obj_Mod()
139
 
  Textur(texture {
140
 
    pigment {color <0,0,0,0,1>}
141
 
    finish {
142
 
      ambient 0
143
 
      specular 1/3
144
 
    }
145
 
  })
146
 
  interior_texture {
147
 
    pigment {color <0,0,0,0,1>}
148
 
    finish {ambient 0}
149
 
  }
150
 
  no_shadow
151
 
  hollow
152
 
  interior {
153
 
    media {
154
 
      scattering {1, rgb Colour*2}
155
 
    }
156
 
  }
157
 
#end
158
 
 
159
 
 
160
 
#macro Obj(P)
161
 
  blob {
162
 
    #local X=-3;
163
 
    #while (X<4)
164
 
      #local Y=-1;
165
 
      #while (Y<2)
166
 
        #if (Blob_pretest(X,Y,P))
167
 
          #local i=0;
168
 
          #while (i<Main_num)
169
 
            #if (Blob_test(X,Y,Main_pos[i][0],Main_pos[i][1],P))
170
 
              sphere {
171
 
                <Main_pos[i][0]+X,Main_pos[i][1]+Y*Height,Main_pos[i][2]>
172
 
                Main_rad
173
 
                Main_strength
174
 
              }
175
 
            #end
176
 
            #local i=i+1;
177
 
          #end
178
 
          sphere {
179
 
            <X,Y*Height,0>+Bubble_pos(Time)
180
 
            Bubble_rad1(Time),
181
 
            -Bubble_strength1(Time)
182
 
          }
183
 
          sphere {
184
 
            <X,Y*Height,0>+Bubble_pos(Time)
185
 
            Bubble_rad2(Time)
186
 
            Bubble_strength2(Time)
187
 
          }
188
 
        #end
189
 
        #local Y=Y+1;
190
 
      #end
191
 
      #local X=X+1;
192
 
    #end
193
 
    threshold 1
194
 
    Obj_Mod()
195
 
    translate <-1/2,-Height/2,0>
196
 
    rotate Angle_deg*x
197
 
  }
198
 
#end
199
 
 
200
 
Obj(0)
201
 
Obj(1)
202
 
 
203