1 class Sandbox extends SCPattern
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();
13 Sandbox(GLucose glucose) {
15 println("points "+pointrange);
16 println("strips "+striprange);
17 println("faces "+facerange);
18 println("cubes "+cuberange);
19 println("towers "+towerrange);
22 public void run(int deltaMs) {
28 c = (c + 1) % towerrange;
29 long col = color(Math.round(Math.random()*255),255,255) ;
36 public void doDraw(int c,long col)
38 Tower t= model.towers.get((int) c);
39 for(Point p : t.points)
41 colors[p.index] = (int) col;
46 class GranimTestPattern extends GranimPattern
48 GranimTestPattern(GLucose glucose)
51 addGraphic("myReds",new RedsGraphic(100));
52 int[] dots = {0,128,0,128,0,128,0,128,0,128,0,128};
53 addGraphic("myOtherColors",new ColorDotsGraphic(dots));
55 getGraphicByName("myOtherColors").position=100;
58 public void run(int deltaMs)
65 Graphic reds = getGraphicByName("myReds");
66 Graphic others = getGraphicByName("myOtherColors");
67 reds.position = reds.position + 1 % 19000;
68 others.position = others.position + 10 % 19000;
71 public void clearALL()
73 for(int i = 0; i < colors.length; i++)
82 class GranimTestPattern2 extends GranimPattern
84 GranimTestPattern2(GLucose glucose)
87 /*for(int i = 0;i < 100; i++)
89 Graphic g = addGraphic("myReds_"+i,new RedsGraphic(Math.round(Math.random() * 100)));
92 Graphic g = addGraphic("myRandoms",new RandomsGranim(50));
98 public void run(int deltaMs)
102 Graphic randomsGraphic = getGraphicByName("myRandoms");
103 randomsGraphic.position = Math.round(sin(count)*1000)+5000;
106 public void clearALL()
108 for(Point p : model.points)
117 class DriveableCrossSections extends CrossSections
124 DriveableCrossSections(GLucose glucose) {
128 public void addParams()
130 mode = new BasicParameter("Mode", 0.0);
131 xd = new BasicParameter("XD", 0.0);
132 yd = new BasicParameter("YD", 0.0);
133 zd = new BasicParameter("ZD", 0.0);
149 public void onParameterChanged(LXParameter p) {
154 xd.setValue(x.getValue()/200);
155 yd.setValue(y.getValue()/200);
156 zd.setValue(z.getValue()/100);
161 boolean interactive()
163 return Math.round(mode.getValuef())>0.5;
166 public void updateXYZVals()
170 xv = xd.getValuef()*200;
171 yv = yd.getValuef()*200;
172 zv = zd.getValuef()*100;
174 super.updateXYZVals();