sinesphere cool
[SugarCubes.git] / AlexGreen.pde
index 6cc869f52848e4d1ec9e272234b746b8ac344285..69e69bc59d70326d8f1734bec83d5ef4b9586eba 100644 (file)
@@ -35,7 +35,7 @@ class SineSphere extends SCPattern {
    //addParameter(bounceamp = new BasicParameter("Amp", .5));
    //addParameter(bouncerate = new BasicParameter("Rate", .5));  //ybounce.modulateDurationBy(bouncerate);
    addParameter(widthparameter = new BasicParameter("Width", .1));
-   addParameter(huespread = new BasicParameter("Hue", .2));
+   addParameter(huespread = new BasicParameter("Hue", .5, 10));
    
    addModulator( vx = new SinLFO(-4000, 10000, 100000)).trigger() ;
    //addModulator(xbounce = new SinLFO(model.xMax/3, 2*model.yMax/3, 2000)).trigger(); 
@@ -77,20 +77,18 @@ float distfromcirclecenter(float px, float py, float pz, float f1x, float f1y, f
  //void updatespherey(deltaMs, )
 
  float quadrant(PVector q) {
-   float qtheta = atan2(  (q.x-f1xcenter) , (-q.y - f1ycenter) ); 
-      return map(qtheta, -PI/2, PI/2, 120, 240);
+   float qtheta = atan2(  (q.x-f1xcenter) , (q.z - f1zcenter) ); 
+   //println( "qtheta  " + qtheta);
+
+    return map(qtheta, -PI/2, PI/2, 140, 240);
   //if (q.x > f1xcenter ) {return 140 ;}
     //else  {return 250;}  
-  //if ()
-
-
-
  }
  color spheryvalue (PVector p, float f1xcenter, float f1ycenter, float f1zcenter) 
  {  circlecenter = new PVector(f1xcenter, f1ycenter, f1zcenter);
 //switch(sShpape.cur() ) {}  
    return lx.hsb(constrain( huespread.getValuef()*5*quadrant(p), 0, 360) ,
-    PVector.dist(p,circlecenter) 
+    80
     max(0, 100 - 100*widthparameter.getValuef()*abs(PVector.dist(p, circlecenter)
       - vibration.getValuef() ) ) ); 
  }
@@ -202,7 +200,8 @@ final Sphery[] spherys;
     {   color c = 0;
       PVector P = new PVector(p.x, p.y, p.z);
         c = blendColor(c, spherys[3].spheryvalue(P, .3*model.xMax, .7*model.yMax, .6*model.zMax),ADD);
-        colors[p.index] = lx.hsb(lx.h(c), lx.s(c), lx.b(c));
+         
+        colors[p.index] = blendColor(colors[p.index], c , ADD);
 
     }