X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=DanHorwitz.pde;h=3d72b5fddfd68c49beff96b763fc5a713c708284;hb=73687629fdcb02aa7c0a7c605319252da07f91d7;hp=6c46e69b415213113408ff16a07b740136a0db48;hpb=af83f61c0f331ebf802fa6b01fa37af834fb684f;p=SugarCubes.git diff --git a/DanHorwitz.pde b/DanHorwitz.pde index 6c46e69..3d72b5f 100755 --- a/DanHorwitz.pde +++ b/DanHorwitz.pde @@ -21,6 +21,7 @@ public class Pong extends DPat { void StartRun(double deltaMs) { cRad = mMax.x*pSize.Val()/6; } color CalcPoint(xyz p) { v.set(x.getValuef(), y.getValuef(), z.getValuef()); + v.z=0;p.z=0;// ignore z dimension switch(pChoose.Cur()) { case 0: vMir.set(mMax); vMir.subtract(p); return color(0,0,c1c(1 - min(v.distance(p), v.distance(vMir))*.5/cRad)); // balls @@ -162,7 +163,7 @@ public class Play extends DPat DParam pAmp, pRadius, pBounce; float t,amp,rad,bnc; - + float zTheta=0; ArrayList waves = new ArrayList(10); rAngle a1 = new rAngle(), a2 = new rAngle(), @@ -184,7 +185,7 @@ public class Play extends DPat pBounce = addParam("Bnc" , .2 ); pAmp = addParam("Amp" , .2 ); pTempoMult = addPick ("TMult" , 0 , 5 , new String[] {"1x", "2x", "4x", "8x", "16x", "Rand" } ); - pTimePattern= addPick ("TPat" , 6 , 7 , new String[] {"Bounce", "Sin", "Roll", "Quant", "Accel", "Deccel", "Slide", "Rand"} ); pShape = addPick ("Shape" , 2 , 15 , new String[] {"Line", "Tap", "V", "RandV", + pTimePattern= addPick ("TPat" , 6 , 7 , new String[] {"Bounce", "Sin", "Roll", "Quant", "Accel", "Deccel", "Slide", "Rand"} ); pShape = addPick ("Shape" , 3 , 15 , new String[] {"Line", "Tap", "V", "RandV", "Pyramid", "Wings", "W2", "Clock", "Triangle", "Quad", "Sphere", "Cone", "Noise", "Wave", "?", "?"} ); @@ -208,13 +209,15 @@ public class Play extends DPat } } + void StartPattern() { zTheta=0; } void StartRun(double deltaMs) { t = lx.tempo.rampf(); amp = pAmp.Val(); rad = pRadius.getValuef(); bnc = pBounce.getValuef(); + zTheta += deltaMs*(pSpin .Val()-.5)*.01; - Theta .set(pRotX.Val()*PI*2, pRotY.Val()*PI*2, pRotZ.Val()*PI*2); + Theta .set(pRotX.Val()*PI*2, pRotY.Val()*PI*2, pRotZ.Val()*PI*2 + zTheta); TSin .set(sin(Theta.x), sin(Theta.y), sin(Theta.z)); TCos .set(cos(Theta.x), cos(Theta.y), cos(Theta.z)); @@ -278,7 +281,7 @@ public class Play extends DPat float mp = min(Pn.x, Pn.z); float yt = map(t,0,1,.5-bnc/2,.5+bnc/2); - float r; + float r,d; switch (pShape.Cur()) { case 0: V.set(Pn.x, yt , Pn.z); break; // bouncing line @@ -295,30 +298,38 @@ public class Play extends DPat case 5: V.set(Pn.x, bnc*map((Pn.x-.5)*(Pn.x-.5),0,.25,0,t-.5)+.5, Pn.z); break; // wings case 6: V.set(Pn.x, bnc*map((mp -.5)*(mp -.5),0,.25,0,t-.5)+.5, Pn.z); break; // wings - - - case 7: return color(0,0, min( + case 7: d = min( distToSeg(Px.x, Px.y, a1.getX(70),a1.getY(70), mCtr.x, mCtr.y), - distToSeg(Px.x, Px.y, a2.getX(40),a2.getY(40), mCtr.x, mCtr.y)) .5?1:0)); // cone + case 11: + Px.z=mCtr.z; cMid.z=mCtr.z; + return color(0,0,c1c(1 - CalcCone(Px,cMid,mCtr) * 0.02 > .5?1:0)); // cone case 12: return color(100 + noise(Pn.x,Pn.y,Pn.z + (NoiseMove+50000)/1000.)*200, 85,c1c(Pn.y < noise(Pn.x + NoiseMove/2000.,Pn.z)*(1+amp)-amp/2.-.1 ? 1 : 0)); // noise @@ -330,7 +341,9 @@ public class Play extends DPat default: return color(0,0,0); } - return color(0,0,c1c(1 - V.distance(Pn)/rad)); + return color(0, + 150-c1c(1 - V.distance(Pn)/rad), + c1c(1 - V.distance(Pn)/rad)); } } //----------------------------------------------------------------------------------------------------------------------------------