1 class TowerParams extends SCPattern
3 BasicParameter t1 = new BasicParameter("T1", 0.0);
4 BasicParameter t2 = new BasicParameter("T2", 0.0);
5 BasicParameter t3 = new BasicParameter("T3", 0.0);
6 BasicParameter t4 = new BasicParameter("T4", 0.0);
7 BasicParameter t5 = new BasicParameter("T5", 0.0);
8 BasicParameter t6 = new BasicParameter("T6", 0.0);
9 BasicParameter t7 = new BasicParameter("T7", 0.0);
10 BasicParameter t8 = new BasicParameter("T8", 0.0);
11 BasicParameter t9 = new BasicParameter("T9", 0.0);
12 BasicParameter t10 = new BasicParameter("T10", 0.0);
13 BasicParameter t11 = new BasicParameter("T11", 0.0);
14 BasicParameter t12 = new BasicParameter("T12", 0.0);
15 BasicParameter t13 = new BasicParameter("T13", 0.0);
16 BasicParameter t14 = new BasicParameter("T14", 0.0);
17 BasicParameter t15 = new BasicParameter("T15", 0.0);
18 BasicParameter t16 = new BasicParameter("T16", 0.0);
20 ArrayList<BasicParameter> towerParams;
23 TowerParams(GLucose glucose) {
26 towerParams = new ArrayList<BasicParameter>();
43 for(BasicParameter p : towerParams)
47 towerSize = model.towers.size();
48 colorSpan = 255 / towerSize;
49 println("towers "+towerSize);
56 for(int i=0; i<towerSize ;i++)
58 t= model.towers.get(i);
59 for(Point p : t.points)
61 if(p.y<towerParams.get(i).getValuef()*200)
63 colors[p.index]=color(colorSpan*i,255,255);
70 public void clearALL()
72 for(Point p : model.points)
79 class Sandbox extends SCPattern
84 int pointrange= model.points.size();
85 int striprange= model.strips.size();
86 int facerange= model.faces.size();
87 int cuberange = model.cubes.size();
88 int towerrange = model.towers.size();
91 Sandbox(GLucose glucose) {
93 println("points "+pointrange);
94 println("strips "+striprange);
95 println("faces "+facerange);
96 println("cubes "+cuberange);
97 println("towers "+towerrange);
100 public void run(int deltaMs) {
106 c = (c + 1) % towerrange;
107 long col = color(Math.round(Math.random()*255),255,255) ;
114 public void doDraw(int c,long col)
116 Tower t= model.towers.get((int) c);
117 for(Point p : t.points)
119 colors[p.index] = (int) col;
124 class GranimTestPattern extends GranimPattern
126 GranimTestPattern(GLucose glucose)
129 addGraphic("myReds",new RedsGraphic(100));
130 int[] dots = {0,128,0,128,0,128,0,128,0,128,0,128};
131 addGraphic("myOtherColors",new ColorDotsGraphic(dots));
133 getGraphicByName("myOtherColors").position=100;
136 public void run(int deltaMs)
143 Graphic reds = getGraphicByName("myReds");
144 Graphic others = getGraphicByName("myOtherColors");
145 reds.position = reds.position + 1 % 19000;
146 others.position = others.position + 10 % 19000;
149 public void clearALL()
151 for(int i = 0; i < colors.length; i++)
160 class GranimTestPattern2 extends GranimPattern
162 GranimTestPattern2(GLucose glucose)
165 /*for(int i = 0;i < 100; i++)
167 Graphic g = addGraphic("myReds_"+i,new RedsGraphic(Math.round(Math.random() * 100)));
170 Graphic g = addGraphic("myRandoms",new RandomsGranim(50));
176 public void run(int deltaMs)
180 Graphic randomsGraphic = getGraphicByName("myRandoms");
181 randomsGraphic.position = Math.round(sin(count)*1000)+5000;
184 public void clearALL()
186 for(Point p : model.points)
195 class DriveableCrossSections extends CrossSections
202 DriveableCrossSections(GLucose glucose) {
206 public void addParams()
208 mode = new BasicParameter("Mode", 0.0);
209 xd = new BasicParameter("XD", 0.0);
210 yd = new BasicParameter("YD", 0.0);
211 zd = new BasicParameter("ZD", 0.0);
220 public void onParameterChanged(LXParameter p) {
232 void copyValuesToKnobs()
234 xd.setValue(x.getValue()/200);
235 yd.setValue(y.getValue()/115);
236 zd.setValue(z.getValue()/100);
239 void copyKnobsToValues()
241 x.setValue(xd.getValue()*200);
242 y.setValue(yd.getValue()*115);
243 z.setValue(zd.getValue()*100);
246 boolean interactive()
248 return Math.round(mode.getValuef())>0.5;
251 public void updateXYZVals()
255 xv = xd.getValuef()*200;
256 yv = yd.getValuef()*115;
257 zv = zd.getValuef()*100;
259 super.updateXYZVals();