Commit | Line | Data |
---|---|---|
a68abe8c BM |
1 | class Sandbox extends SCPattern |
2 | { | |
fe0cb084 BM |
3 | int c=0; |
4 | int prevC=0; | |
5 | int huerange=255; | |
6 | int pointrange= model.points.size(); | |
7 | int striprange= model.strips.size(); | |
8 | int facerange= model.faces.size(); | |
9 | int cuberange = model.cubes.size(); | |
10 | int towerrange = model.towers.size(); | |
11 | int counter=0; | |
a68abe8c | 12 | |
47011215 | 13 | Sandbox(GLucose glucose) { |
a68abe8c | 14 | super(glucose); |
fe0cb084 BM |
15 | println("points "+pointrange); |
16 | println("strips "+striprange); | |
17 | println("faces "+facerange); | |
18 | println("cubes "+cuberange); | |
19 | println("towers "+towerrange); | |
a68abe8c | 20 | } |
fe0cb084 | 21 | |
a68abe8c | 22 | public void run(int deltaMs) { |
fe0cb084 BM |
23 | |
24 | ||
25 | if(counter % 10 ==0) | |
a68abe8c | 26 | { |
fe0cb084 BM |
27 | doDraw(c,0); |
28 | c = (c + 1) % towerrange; | |
29 | long col = color(Math.round(Math.random()*255),255,255) ; | |
30 | doDraw(c,col); | |
a68abe8c BM |
31 | } |
32 | counter++; | |
fe0cb084 BM |
33 | |
34 | } | |
35 | ||
36 | public void doDraw(int c,long col) | |
37 | { | |
38 | Tower t= model.towers.get((int) c); | |
39 | for(Point p : t.points) | |
40 | { | |
41 | colors[p.index] = (int) col; | |
42 | } | |
a68abe8c | 43 | } |
fe0cb084 BM |
44 | }; |
45 | ||
46 | class GranimTestPattern extends GranimPattern | |
47 | { | |
48 | GranimTestPattern(GLucose glucose) | |
49 | { | |
50 | super(glucose); | |
51 | RedThreeGraphic myReds = new RedThreeGraphic(); | |
52 | addGraphic(myReds); | |
53 | } | |
54 | ||
55 | ||
a68abe8c | 56 | } |