-
Notifications
You must be signed in to change notification settings - Fork 0
/
spiral.scd
41 lines (41 loc) · 1.22 KB
/
spiral.scd
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
(
var width= 1350, height= 700;
var win= Window("spiral", Window.screenBounds).front.fullScreen;
var usr= UserView(win, Rect(0, 0, width, height));
usr.background= Color.black;
usr.animate= true;
usr.drawFunc= {
var theta= sin(usr.frame*0.001)*2pi*4;
Pen.fillColor= Color.white;
Pen.translate(width*0.5, height*0.5);
height.do{|y|
10.do{|i|
Pen.rotate(theta*0.001);
Pen.fillRect(Rect(sin(y*0.1+theta+(i*2))*100, y, 2, 2));
};
};
};
CmdPeriod.doOnce({win.close});
win.front;
)
///////////////////////////////////////////////////////////////
(
var width= 1350, height= 700;
var win= Window("spiral", Rect(0, 70, width, height), false);
var usr= UserView(win, Rect(0, 0, width, height));
usr.background= Color.black;
usr.animate= true;
usr.drawFunc= {
var theta= sin(usr.frame*0.001)*2pi*4;
Pen.fillColor= Color.white;
Pen.translate(width*0.5, height*0.5);
height.do{|y|
10.do{|i|
Pen.rotate(theta*0.001);
Pen.fillRect(Rect(sin(y*0.1+theta+(i*2))*100, y, 2, 2));
};
};
};
CmdPeriod.doOnce({win.close});
win.front;
)