From: Mark Slee Date: Sun, 13 Oct 2013 22:41:27 +0000 (-0700) Subject: Deprecate fx/fy/fz fully, they're gone now X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=190d91c2948b274a2dbaf4ec07450b4ebf2feece;p=SugarCubes.git Deprecate fx/fy/fz fully, they're gone now --- diff --git a/ArjunBanker.pde b/ArjunBanker.pde index 6af635a..12ce5b6 100644 --- a/ArjunBanker.pde +++ b/ArjunBanker.pde @@ -40,7 +40,7 @@ class AbstractPainting extends SCPattern { void run(double deltaMs) { for (Point p : model.points) { color c = img.get((int)((p.x / model.xMax) * img.width), img.height - (int)((p.y / model.yMax) * img.height)); - colors[p.index] = color(hue(c) + colorMod.getValuef()%360, saturation(c), brightness(c) - ((p.fz - brightMod.getValuef())/p.fz)); + colors[p.index] = color(hue(c) + colorMod.getValuef()%360, saturation(c), brightness(c) - ((p.z - brightMod.getValuef())/p.z)); } } } @@ -66,7 +66,7 @@ class Spirality extends SCPattern { float x = model.xMax / 2 + cos(angle) * rad; float y = model.yMax / 2 + sin(angle) * rad; for (Point p : model.points) { - float b = dist(x,y,p.fx,p.fy); + float b = dist(x,y,p.x,p.y); if (b < 90) { colors[p.index] = blendColor( colors[p.index], diff --git a/DanUtil.pde b/DanUtil.pde index 4ce685a..7eca742 100644 --- a/DanUtil.pde +++ b/DanUtil.pde @@ -67,10 +67,10 @@ public class DParam extends BasicParameter { //---------------------------------------------------------------------------------------------------------------------------------- public class xyz { float x,y,z; xyz() {x=y=z=0;} - xyz(Point p ) {x=p.fx ; y=p.fy; z=p.fz;} + xyz(Point p ) {x=p.x ; y=p.y; z=p.z;} xyz(xyz p ) {set(p); } xyz(float _x,float _y,float _z) {x=_x ; y=_y ; z=_z ;} - void set(Point p ) {x=p.fx ; y=p.fy; z=p.fz;} + void set(Point p ) {x=p.x ; y=p.y; z=p.z;} void set(xyz p ) {x=p.x ; y=p.y ; z=p.z ;} void set(float _x,float _y,float _z) {x=_x ; y=_y ; z=_z ;} @@ -344,9 +344,9 @@ public class DPat extends SCPattern 100 * b * DG._Level() ); -// colors[p.index] = color(0,0, p.fx >= modmin.x && p.fy >= modmin.y && p.fz >= modmin.z && -// p.fx <= modmin.x+mMax.x && p.fy <= modmin.y+mMax.y && p.fz <= modmin.z+mMax.z ? 100 : 0); +// colors[p.index] = color(0,0, p.x >= modmin.x && p.y >= modmin.y && p.z >= modmin.z && +// p.x <= modmin.x+mMax.x && p.y <= modmin.y+mMax.y && p.z <= modmin.z+mMax.z ? 100 : 0); } } } -//---------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file +//---------------------------------------------------------------------------------------------------------------------------------- diff --git a/MarkSlee.pde b/MarkSlee.pde index d501786..b910576 100644 --- a/MarkSlee.pde +++ b/MarkSlee.pde @@ -437,7 +437,7 @@ class SpaceTime extends SCPattern { int i = 0; for (Point p : strip.points) { colors[p.index] = color( - (lx.getBaseHuef() + 360 - p.fx*.2 + p.fy * .3) % 360, + (lx.getBaseHuef() + 360 - p.x*.2 + p.y * .3) % 360, constrain(.4 * min(abs(s - sVal1), abs(s - sVal2)), 20, 100), max(0, 100 - fVal*abs(i - pVal*(strip.metrics.numPoints - 1))) ); @@ -485,9 +485,9 @@ class Swarm extends SCPattern { for (Strip strip : model.strips ) { int i = 0; for (Point p : strip.points) { - float fV = max(-1, 1 - dist(p.fx/2., p.fy, fX.getValuef()/2., fY.getValuef()) / 64.); + float fV = max(-1, 1 - dist(p.x/2., p.y, fX.getValuef()/2., fY.getValuef()) / 64.); colors[p.index] = color( - (lx.getBaseHuef() + 0.3 * abs(p.fx - hOffX.getValuef())) % 360, + (lx.getBaseHuef() + 0.3 * abs(p.x - hOffX.getValuef())) % 360, constrain(80 + 40 * fV, 0, 100), constrain(100 - (30 - fV * falloff.getValuef()) * modDist(i + (s*63)%61, offset.getValuef() * strip.metrics.numPoints, strip.metrics.numPoints), 0, 100) ); @@ -512,7 +512,7 @@ class SwipeTransition extends SCTransition { float bleedf = 10 + bleed.getValuef() * 200.; float xPos = (float) (-bleedf + progress * (model.xMax + bleedf)); for (Point p : model.points) { - float d = (p.fx - xPos) / bleedf; + float d = (p.x - xPos) / bleedf; if (d < 0) { colors[p.index] = c2[p.index]; } else if (d > 1) { @@ -628,17 +628,17 @@ class BassPod extends SCPattern { float bassLevel = eq.getAverageLevel(0, 5); for (Point p : model.points) { - int avgIndex = (int) constrain(1 + abs(p.fx-model.xMax/2.)/(model.xMax/2.)*(eq.numBands-5), 0, eq.numBands-5); + int avgIndex = (int) constrain(1 + abs(p.x-model.xMax/2.)/(model.xMax/2.)*(eq.numBands-5), 0, eq.numBands-5); float value = 0; for (int i = avgIndex; i < avgIndex + 5; ++i) { value += eq.getLevel(i); } value /= 5.; - float b = constrain(8 * (value*model.yMax - abs(p.fy-model.yMax/2.)), 0, 100); + float b = constrain(8 * (value*model.yMax - abs(p.y-model.yMax/2.)), 0, 100); colors[p.index] = color( - (lx.getBaseHuef() + abs(p.fy - model.cy) + abs(p.fx - model.cx)) % 360, - constrain(bassLevel*240 - .6*dist(p.fx, p.fy, model.cx, model.cy), 0, 100), + (lx.getBaseHuef() + abs(p.y - model.cy) + abs(p.x - model.cx)) % 360, + constrain(bassLevel*240 - .6*dist(p.x, p.y, model.cx, model.cy), 0, 100), b ); } @@ -679,7 +679,7 @@ class CubeEQ extends SCPattern { float clrConst = 1.1 + clr.getValuef(); for (Point p : model.points) { - float avgIndex = constrain(2 + p.fx / model.xMax * (eq.numBands-4), 0, eq.numBands-4); + float avgIndex = constrain(2 + p.x / model.xMax * (eq.numBands-4), 0, eq.numBands-4); int avgFloor = (int) avgIndex; float leftVal = eq.getLevel(avgFloor); @@ -695,9 +695,9 @@ class CubeEQ extends SCPattern { float value = lerp(smoothValue, chunkyValue, blockiness.getValuef()); - float b = constrain(edgeConst * (value*model.yMax - p.fy), 0, 100); + float b = constrain(edgeConst * (value*model.yMax - p.y), 0, 100); colors[p.index] = color( - (480 + lx.getBaseHuef() - min(clrConst*p.fy, 120)) % 360, + (480 + lx.getBaseHuef() - min(clrConst*p.y, 120)) % 360, 100, b ); @@ -736,7 +736,7 @@ class BoomEffect extends SCEffect { for (Point p : model.points) { colors[p.index] = blendColor( colors[p.index], - color(huev, satv, constrain(brightv - falloffv*abs(boom.getValuef() - dist(p.fx, 2*p.fy, 3*p.fz, model.xMax/2, model.yMax, model.zMax*1.5)), 0, 100)), + color(huev, satv, constrain(brightv - falloffv*abs(boom.getValuef() - dist(p.x, 2*p.y, 3*p.z, model.xMax/2, model.yMax, model.zMax*1.5)), 0, 100)), ADD); } } @@ -912,19 +912,19 @@ class CrossSections extends SCPattern { for (Point p : model.points) { color c = 0; c = blendColor(c, color( - (lx.getBaseHuef() + p.fx/10 + p.fy/3) % 360, - constrain(140 - 1.1*abs(p.fx - model.xMax/2.), 0, 100), - max(0, xlv - xwv*abs(p.fx - xv)) + (lx.getBaseHuef() + p.x/10 + p.y/3) % 360, + constrain(140 - 1.1*abs(p.x - model.xMax/2.), 0, 100), + max(0, xlv - xwv*abs(p.x - xv)) ), ADD); c = blendColor(c, color( - (lx.getBaseHuef() + 80 + p.fy/10) % 360, - constrain(140 - 2.2*abs(p.fy - model.yMax/2.), 0, 100), - max(0, ylv - ywv*abs(p.fy - yv)) + (lx.getBaseHuef() + 80 + p.y/10) % 360, + constrain(140 - 2.2*abs(p.y - model.yMax/2.), 0, 100), + max(0, ylv - ywv*abs(p.y - yv)) ), ADD); c = blendColor(c, color( - (lx.getBaseHuef() + 160 + p.fz / 10 + p.fy/2) % 360, - constrain(140 - 2.2*abs(p.fz - model.zMax/2.), 0, 100), - max(0, zlv - zwv*abs(p.fz - zv)) + (lx.getBaseHuef() + 160 + p.z / 10 + p.y/2) % 360, + constrain(140 - 2.2*abs(p.z - model.zMax/2.), 0, 100), + max(0, zlv - zwv*abs(p.z - zv)) ), ADD); colors[p.index] = c; } @@ -958,8 +958,8 @@ class Blinders extends SCPattern { float mv = m[si % m.length].getValuef(); for (Point p : strip.points) { colors[p.index] = color( - (hv + p.fz + p.fy*hs.getValuef()) % 360, - min(100, abs(p.fx - s.getValuef())/2.), + (hv + p.z + p.y*hs.getValuef()) % 360, + min(100, abs(p.x - s.getValuef())/2.), max(0, 100 - mv/2. - mv * abs(i - (strip.metrics.length-1)/2.)) ); ++i; @@ -994,8 +994,8 @@ class Psychedelia extends SCPattern { for (Strip strip : model.strips) { for (Point p : strip.points) { colors[p.index] = color( - (huev + i*constrain(cv, 0, 2) + p.fz/2. + p.fx/4.) % 360, - min(100, abs(p.fy-sv)), + (huev + i*constrain(cv, 0, 2) + p.z/2. + p.x/4.) % 360, + min(100, abs(p.y-sv)), max(0, 100 - 50*abs((i%NUM) - mv)) ); } @@ -1058,12 +1058,12 @@ class AskewPlanes extends SCPattern { float d = MAX_FLOAT; for (Plane plane : planes) { if (plane.denom != 0) { - d = min(d, abs(plane.av*(p.fx-model.cx) + plane.bv*(p.fy-model.cy) + plane.cv) / plane.denom); + d = min(d, abs(plane.av*(p.x-model.cx) + plane.bv*(p.y-model.cy) + plane.cv) / plane.denom); } } colors[p.index] = color( - (huev + abs(p.fx-model.cx)*.3 + p.fy*.8) % 360, - max(0, 100 - .8*abs(p.fx - model.cx)), + (huev + abs(p.x-model.cx)*.3 + p.y*.8) % 360, + max(0, 100 - .8*abs(p.x - model.cx)), constrain(140 - 10.*d, 0, 100) ); } @@ -1093,9 +1093,9 @@ class ShiftingPlane extends SCPattern { float dv = d.getValuef(); float denom = sqrt(av*av + bv*bv + cv*cv); for (Point p : model.points) { - float d = abs(av*(p.fx-model.cx) + bv*(p.fy-model.cy) + cv*(p.fz-model.cz) + dv) / denom; + float d = abs(av*(p.x-model.cx) + bv*(p.y-model.cy) + cv*(p.z-model.cz) + dv) / denom; colors[p.index] = color( - (hv + abs(p.fx-model.cx)*.6 + abs(p.fy-model.cy)*.9 + abs(p.fz - model.cz)) % 360, + (hv + abs(p.x-model.cx)*.6 + abs(p.y-model.cy)*.9 + abs(p.z - model.cz)) % 360, constrain(110 - d*6, 0, 100), constrain(130 - 7*d, 0, 100) ); @@ -1166,12 +1166,12 @@ class Traktor extends SCPattern { colors[p.index] = color( (360 + lx.getBaseHuef() + .8*abs(p.x-model.cx)) % 360, 100, - constrain(9 * (bass[pos]*model.cy - abs(p.fy - model.cy)), 0, 100) + constrain(9 * (bass[pos]*model.cy - abs(p.y - model.cy)), 0, 100) ); colors[p.index] = blendColor(colors[p.index], color( (400 + lx.getBaseHuef() + .5*abs(p.x-model.cx)) % 360, 60, - constrain(5 * (treble[pos]*.6*model.cy - abs(p.fy - model.cy)), 0, 100) + constrain(5 * (treble[pos]*.6*model.cy - abs(p.y - model.cy)), 0, 100) ), ADD); } diff --git a/TestPatterns.pde b/TestPatterns.pde index 2f04698..4c78995 100644 --- a/TestPatterns.pde +++ b/TestPatterns.pde @@ -140,7 +140,7 @@ class TestXPattern extends TestPattern { // You can use abs() to determine the distance between two // values. The further away this point is from an exact // point, the more we decrease its brightness - float bv = max(0, 100 - abs(p.fx - xPos.getValuef())); + float bv = max(0, 100 - abs(p.x - xPos.getValuef())); colors[p.index] = color(hv, 100, bv); } } @@ -158,7 +158,7 @@ class TestYPattern extends TestPattern { public void run(double deltaMs) { float hv = lx.getBaseHuef(); for (Point p : model.points) { - float bv = max(0, 100 - abs(p.fy - yPos.getValuef())); + float bv = max(0, 100 - abs(p.y - yPos.getValuef())); colors[p.index] = color(hv, 100, bv); } } @@ -176,7 +176,7 @@ class TestZPattern extends TestPattern { public void run(double deltaMs) { float hv = lx.getBaseHuef(); for (Point p : model.points) { - float bv = max(0, 100 - abs(p.fz - zPos.getValuef())); + float bv = max(0, 100 - abs(p.z - zPos.getValuef())); colors[p.index] = color(hv, 100, bv); } } diff --git a/TimBavaro.pde b/TimBavaro.pde index 4da4b6e..bbbaac3 100644 --- a/TimBavaro.pde +++ b/TimBavaro.pde @@ -125,7 +125,7 @@ class Vector3 { } float distanceTo(Point p) { - return distanceTo(p.fx, p.fy, p.fz); + return distanceTo(p.x, p.y, p.z); } void add(Vector3 other, float multiplier) { @@ -249,12 +249,12 @@ class TimRaindrops extends SCPattern { for (Point p : model.points) { color c = blendColor( - color(210, 20, (float)Math.max(0, 1 - Math.pow((model.yMax - p.fy) / 10, 2)) * 50), - color(220, 60, (float)Math.max(0, 1 - Math.pow((p.fy - model.yMin) / 10, 2)) * 100), + color(210, 20, (float)Math.max(0, 1 - Math.pow((model.yMax - p.y) / 10, 2)) * 50), + color(220, 60, (float)Math.max(0, 1 - Math.pow((p.y - model.yMin) / 10, 2)) * 100), ADD); for (Raindrop raindrop : raindrops) { - if (p.fx >= (raindrop.p.x - raindrop.radius) && p.fx <= (raindrop.p.x + raindrop.radius) && - p.fy >= (raindrop.p.y - raindrop.radius) && p.fy <= (raindrop.p.y + raindrop.radius)) { + if (p.x >= (raindrop.p.x - raindrop.radius) && p.x <= (raindrop.p.x + raindrop.radius) && + p.y >= (raindrop.p.y - raindrop.radius) && p.y <= (raindrop.p.y + raindrop.radius)) { float d = raindrop.p.distanceTo(p) / raindrop.radius; // float value = (float)Math.max(0, 1 - Math.pow(Math.min(0, d - raindrop.radius) / 5, 2)); if (d < 1) { @@ -464,9 +464,9 @@ class TimPlanes extends SCPattern { color c = 0; for (Plane plane : planes) { - normalizedPoint.x = p.fx - plane.center.x; - normalizedPoint.y = p.fy - plane.center.y; - normalizedPoint.z = p.fz - plane.center.z; + normalizedPoint.x = p.x - plane.center.x; + normalizedPoint.y = p.y - plane.center.y; + normalizedPoint.z = p.z - plane.center.z; float v = plane.rotation.rotatedY(normalizedPoint); float d = abs(v); @@ -636,7 +636,7 @@ class TimPinwheels extends SCPattern { int value = 0; for (Pinwheel pw : pinwheels) { - value += (pw.isOnBlade(p.fx, p.fy - p.fz * zSlope) ? 1 : 0); + value += (pw.isOnBlade(p.x, p.y - p.z * zSlope) ? 1 : 0); } if (value == 1) { values[i] = 1; @@ -746,7 +746,7 @@ class TimTrace extends SCPattern { for (Strip s : model.strips) { Vector3 v = new Vector3(); for (Point p : s.points) { - v.add(p.fx, p.fy, p.fz); + v.add(p.x, p.y, p.z); } v.divide(s.points.size()); stripToCenter.put(s, v); @@ -778,7 +778,7 @@ class TimTrace extends SCPattern { List nearbyStrips = stripToNearbyStrips.get(s); for (Point p : s.points) { - Vector3 v = new Vector3(p.fx, p.fy, p.fz); + Vector3 v = new Vector3(p.x, p.y, p.z); List neighbors = new ArrayList(); @@ -787,7 +787,7 @@ class TimTrace extends SCPattern { float closestPointDistance = 100000; for (Point nsp : nearbyStrip.points) { - float distance = v.distanceTo(nsp.fx, nsp.fy, nsp.fz); + float distance = v.distanceTo(nsp.x, nsp.y, nsp.z); if (closestPoint == null || distance < closestPointDistance) { closestPoint = nsp; closestPointDistance = distance; diff --git a/TobySegaran.pde b/TobySegaran.pde index 32b6d82..0523129 100644 --- a/TobySegaran.pde +++ b/TobySegaran.pde @@ -25,10 +25,10 @@ class GlitchPlasma extends SCPattern { public void run(double deltaMs) { for (Point p : model.points) { - float hv = sin(dist(p.fx + pos, p.fy, 128.0, 128.0) / 8.0) - + sin(dist(p.fx, p.fy, 64.0, 64.0) / 8.0) - + sin(dist(p.fx, p.fy + pos / 7, 192.0, 64.0) / 7.0) - + sin(dist(p.fx, p.fz + pos, 192.0, 100.0) / 8.0); + float hv = sin(dist(p.x + pos, p.y, 128.0, 128.0) / 8.0) + + sin(dist(p.x, p.y, 64.0, 64.0) / 8.0) + + sin(dist(p.x, p.y + pos / 7, 192.0, 64.0) / 7.0) + + sin(dist(p.x, p.z + pos, 192.0, 100.0) / 8.0); float bv = 100; colors[p.index] = color((hv+2)*50, satu, bv); } @@ -82,8 +82,8 @@ class FireEffect extends SCPattern { } for (Point p : model.points) { - int x = max(0,(int(p.fx)+int(p.fz))%xm); - int y = constrain(ym-int(p.fy),0,ym-1); + int x = max(0,(int(p.x)+int(p.z))%xm); + int y = constrain(ym-int(p.y),0,ym-1); colors[p.index] = flameColor(intensity[x][y]); } } @@ -116,7 +116,7 @@ class StripBounce extends SCPattern { for (Strip strip : model.strips) { for (int i=0;iavgSize) seq=avgSize-seq; seq=constrain(seq,0,avgSize-1); - float br=max(0, lightVals[seq]-p.fy); + float br=max(0, lightVals[seq]-p.y); colors[p.index] = color((dis*avgSize*65)/model.xMax,90,br); } } diff --git a/_Internals.pde b/_Internals.pde index 45a9363..f634497 100644 --- a/_Internals.pde +++ b/_Internals.pde @@ -252,7 +252,7 @@ void draw() { beginShape(POINTS); for (Point p : glucose.model.points) { stroke(colors[p.index]); - vertex(p.fx, p.fy, p.fz); + vertex(p.x, p.y, p.z); } endShape(); diff --git a/code/GLucose.jar b/code/GLucose.jar index 9e48133..ec0a705 100755 Binary files a/code/GLucose.jar and b/code/GLucose.jar differ diff --git a/code/HeronLX.jar b/code/HeronLX.jar index 430832e..15c009f 100755 Binary files a/code/HeronLX.jar and b/code/HeronLX.jar differ