Basic knob driving
[SugarCubes.git] / BenMorrow.pde
index cf88145f061a5ddebf4846ae2bfb94521a6d59ce..8b2b4f55ef47f4bb30d2fe103235c8de2a39d823 100644 (file)
@@ -48,9 +48,105 @@ class GranimTestPattern extends GranimPattern
        GranimTestPattern(GLucose glucose)
        {
                super(glucose);
-               RedThreeGraphic myReds = new RedThreeGraphic();
-               addGraphic(myReds);
+               addGraphic("myReds",new RedsGraphic(100));
+               int[] dots = {0,128,0,128,0,128,0,128,0,128,0,128};
+               addGraphic("myOtherColors",new ColorDotsGraphic(dots));
+
+               getGraphicByName("myOtherColors").position=100;
+       }
+       int counter=0;
+       public void run(int deltaMs) 
+       {
+               clearALL();
+               super.run(deltaMs);
+               
+               if(counter % 3 ==0)
+               {
+                       Graphic reds = getGraphicByName("myReds");
+                       Graphic others = getGraphicByName("myOtherColors");
+                       reds.position = reds.position + 1 % 19000;
+                       others.position = others.position + 10 % 19000;
+               }
+       }
+       public void clearALL()
+       {
+               for(int i = 0; i < colors.length; i++)
+               {
+                       colors[i] = 0;
+               }
+       }
+
+
+}
+
+class GranimTestPattern2 extends GranimPattern
+{
+       GranimTestPattern2(GLucose glucose)
+       {
+               super(glucose);
+               /*for(int i = 0;i < 100; i++)
+               {
+                       Graphic g = addGraphic("myReds_"+i,new RedsGraphic(Math.round(Math.random() * 100)));
+
+               }*/
+               Graphic g = addGraphic("myRandoms",new RandomsGranim(50));
+               g.position = 200;
+               
+       }
+       int counter=0;
+       float count=0;
+       public void run(int deltaMs) 
+       {
+               clearALL();
+               super.run(deltaMs);
+               Graphic randomsGraphic = getGraphicByName("myRandoms");
+               randomsGraphic.position = Math.round(sin(count)*1000)+5000;
+               count+= 0.005;
+       }
+       public void clearALL()
+       {
+               for(Point p : model.points)
+               {
+                       colors[p.index] = 0;
+               }
+       }
+
+
+};
+
+class DriveableCrossSections extends CrossSections
+{
+       BasicParameter xd = new BasicParameter("XD", 1.0);
+       BasicParameter yd = new BasicParameter("YD", 1.0);
+       BasicParameter zd = new BasicParameter("ZD", 1.0);
+
+       DriveableCrossSections(GLucose glucose) {
+               super(glucose); 
        }
 
+       public void addParams()
+       {
+               addParameter(xd);
+           addParameter(yd);
+           addParameter(zd);
+           addParameter(xr);
+           addParameter(yr);
+           addParameter(zr);    
+           addParameter(xw);
+           addParameter(xl);
+           addParameter(yl);
+           addParameter(zl);
+               addParameter(yw);    
+           addParameter(zw);
+       }
+
+
+
+       public void updateXYZVals()
+       {
+               xv = xd.getValuef();
+           yv = yd.getValuef();
+           zv = zd.getValuef(); 
+       }
 
 }
\ No newline at end of file