1 class TowerParams extends SCPattern
3 BasicParameter hueoff = new BasicParameter("Hueoff", 0.0);
4 BasicParameter hueSpan = new BasicParameter("HueRange", 0.0);
5 BasicParameter t1 = new BasicParameter("T1", 0.0);
6 BasicParameter t2 = new BasicParameter("T2", 0.0);
7 BasicParameter t3 = new BasicParameter("T3", 0.0);
8 BasicParameter t4 = new BasicParameter("T4", 0.0);
9 BasicParameter t5 = new BasicParameter("T5", 0.0);
10 BasicParameter t6 = new BasicParameter("T6", 0.0);
11 BasicParameter t7 = new BasicParameter("T7", 0.0);
12 BasicParameter t8 = new BasicParameter("T8", 0.0);
13 BasicParameter t9 = new BasicParameter("T9", 0.0);
14 BasicParameter t10 = new BasicParameter("T10", 0.0);
15 BasicParameter t11 = new BasicParameter("T11", 0.0);
16 BasicParameter t12 = new BasicParameter("T12", 0.0);
17 BasicParameter t13 = new BasicParameter("T13", 0.0);
18 BasicParameter t14 = new BasicParameter("T14", 0.0);
19 BasicParameter t15 = new BasicParameter("T15", 0.0);
20 BasicParameter t16 = new BasicParameter("T16", 0.0);
22 ArrayList<BasicParameter> towerParams;
25 TowerParams(GLucose glucose) {
28 towerParams = new ArrayList<BasicParameter>();
30 addParameter(hueSpan);
47 for(BasicParameter p : towerParams)
51 towerSize = model.towers.size();
52 colorSpan = 255 / towerSize;
53 println("towers "+towerSize);
60 for(int i=0; i<towerSize ;i++)
62 t= model.towers.get(i);
63 for(Point p : t.points)
65 if(p.y<towerParams.get(i).getValuef()*200)
67 colors[p.index]=color(255 * hueoff.getValuef()+colorSpan * hueSpan.getValuef() * i,255,255);
74 public void clearALL()
76 for(Point p : model.points)
83 class Sandbox extends SCPattern
88 int pointrange= model.points.size();
89 int striprange= model.strips.size();
90 int facerange= model.faces.size();
91 int cuberange = model.cubes.size();
92 int towerrange = model.towers.size();
95 Sandbox(GLucose glucose) {
97 println("points "+pointrange);
98 println("strips "+striprange);
99 println("faces "+facerange);
100 println("cubes "+cuberange);
101 println("towers "+towerrange);
104 public void run(int deltaMs) {
110 c = (c + 1) % towerrange;
111 long col = color(Math.round(Math.random()*255),255,255) ;
118 public void doDraw(int c,long col)
120 Tower t= model.towers.get((int) c);
121 for(Point p : t.points)
123 colors[p.index] = (int) col;
128 class GranimTestPattern extends GranimPattern
130 GranimTestPattern(GLucose glucose)
133 addGraphic("myReds",new RedsGraphic(100));
134 int[] dots = {0,128,0,128,0,128,0,128,0,128,0,128};
135 addGraphic("myOtherColors",new ColorDotsGraphic(dots));
137 getGraphicByName("myOtherColors").position=100;
140 public void run(int deltaMs)
147 Graphic reds = getGraphicByName("myReds");
148 Graphic others = getGraphicByName("myOtherColors");
149 reds.position = reds.position + 1 % 19000;
150 others.position = others.position + 10 % 19000;
153 public void clearALL()
155 for(int i = 0; i < colors.length; i++)
164 class GranimTestPattern2 extends GranimPattern
166 GranimTestPattern2(GLucose glucose)
169 /*for(int i = 0;i < 100; i++)
171 Graphic g = addGraphic("myReds_"+i,new RedsGraphic(Math.round(Math.random() * 100)));
174 Graphic g = addGraphic("myRandoms",new RandomsGranim(50));
180 public void run(int deltaMs)
184 Graphic randomsGraphic = getGraphicByName("myRandoms");
185 randomsGraphic.position = Math.round(sin(count)*1000)+5000;
188 public void clearALL()
190 for(Point p : model.points)
199 class DriveableCrossSections extends CrossSections
206 DriveableCrossSections(GLucose glucose) {
210 public void addParams()
212 mode = new BasicParameter("Mode", 0.0);
213 xd = new BasicParameter("XD", 0.0);
214 yd = new BasicParameter("YD", 0.0);
215 zd = new BasicParameter("ZD", 0.0);
224 public void onParameterChanged(LXParameter p) {
236 void copyValuesToKnobs()
238 xd.setValue(x.getValue()/200);
239 yd.setValue(y.getValue()/115);
240 zd.setValue(z.getValue()/100);
243 void copyKnobsToValues()
245 x.setValue(xd.getValue()*200);
246 y.setValue(yd.getValue()*115);
247 z.setValue(zd.getValue()*100);
250 boolean interactive()
252 return Math.round(mode.getValuef())>0.5;
255 public void updateXYZVals()
259 xv = xd.getValuef()*200;
260 yv = yd.getValuef()*115;
261 zv = zd.getValuef()*100;
263 super.updateXYZVals();