repositories
/
SugarCubes.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
commented out DanKaminksy.pde
[SugarCubes.git]
/
ArjunBanker.pde
diff --git
a/ArjunBanker.pde
b/ArjunBanker.pde
index dcd5faec4f3a5660c6bd969fcfc7209c1bd846b1..e4f1ec984acfad474f23a489c445084a8cd8fc44 100644
(file)
--- a/
ArjunBanker.pde
+++ b/
ArjunBanker.pde
@@
-5,18
+5,18
@@
class TelevisionStatic extends SCPattern {
BasicParameter hueParameter = new BasicParameter("HUE", 1.0);
SinLFO direction = new SinLFO(0, 10, 3000);
BasicParameter hueParameter = new BasicParameter("HUE", 1.0);
SinLFO direction = new SinLFO(0, 10, 3000);
- public TelevisionStatic(
GLucose glucose
) {
- super(
glucose
);
+ public TelevisionStatic(
LX lx
) {
+ super(
lx
);
addModulator(direction).trigger();
addParameter(brightParameter);
addParameter(saturationParameter);
addParameter(hueParameter);
}
addModulator(direction).trigger();
addParameter(brightParameter);
addParameter(saturationParameter);
addParameter(hueParameter);
}
- void run(
int
deltaMs) {
+ void run(
double
deltaMs) {
boolean d = direction.getValuef() > 5.0;
boolean d = direction.getValuef() > 5.0;
- for (Point p : model.points) {
- colors[p.index] =
color
((lx.getBaseHuef() + random(hueParameter.getValuef() * 360))%360, random(saturationParameter.getValuef() * 100), random(brightParameter.getValuef() * 100));
+ for (
LX
Point p : model.points) {
+ colors[p.index] =
lx.hsb
((lx.getBaseHuef() + random(hueParameter.getValuef() * 360))%360, random(saturationParameter.getValuef() * 100), random(brightParameter.getValuef() * 100));
}
}
}
}
}
}
@@
-28,8
+28,8
@@
class AbstractPainting extends SCPattern {
SinLFO colorMod = new SinLFO(0, 360, 5000);
SinLFO brightMod = new SinLFO(0, model.zMax, 2000);
SinLFO colorMod = new SinLFO(0, 360, 5000);
SinLFO brightMod = new SinLFO(0, model.zMax, 2000);
- public AbstractPainting(
GLucose glucose
) {
- super(
glucose
);
+ public AbstractPainting(
LX lx
) {
+ super(
lx
);
addModulator(colorMod).trigger();
addModulator(brightMod).trigger();
addModulator(colorMod).trigger();
addModulator(brightMod).trigger();
@@
-37,10
+37,10
@@
class AbstractPainting extends SCPattern {
img.loadPixels();
}
img.loadPixels();
}
- void run(
int
deltaMs) {
- for (Point p : model.points) {
+ void run(
double
deltaMs) {
+ for (
LX
Point p : model.points) {
color c = img.get((int)((p.x / model.xMax) * img.width), img.height - (int)((p.y / model.yMax) * img.height));
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.f
z));
+ colors[p.index] =
lx.hsb(hue(c) + colorMod.getValuef()%360, saturation(c), brightness(c) - ((p.z - brightMod.getValuef())/p.
z));
}
}
}
}
}
}
@@
-52,30
+52,30
@@
class Spirality extends SCPattern {
float rad = 0;
int direction = 1;
float rad = 0;
int direction = 1;
- Spirality(
GLucose glucose
) {
- super(
glucose
);
+ Spirality(
LX lx
) {
+ super(
lx
);
addParameter(r);
addParameter(r);
- for (Point p : model.points) {
- colors[p.index] =
color
(0, 0, 0);
+ for (
LX
Point p : model.points) {
+ colors[p.index] =
lx.hsb
(0, 0, 0);
}
}
}
}
- public void run(
int
deltaMs) {
+ public void run(
double
deltaMs) {
angle += deltaMs * 0.007;
rad += deltaMs * .025 * direction;
float x = model.xMax / 2 + cos(angle) * rad;
float y = model.yMax / 2 + sin(angle) * rad;
angle += deltaMs * 0.007;
rad += deltaMs * .025 * direction;
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.f
y);
+ for (
LX
Point p : model.points) {
+ float b = dist(x,y,p.
x,p.
y);
if (b < 90) {
colors[p.index] = blendColor(
colors[p.index],
if (b < 90) {
colors[p.index] = blendColor(
colors[p.index],
-
color
(lx.getBaseHuef() + 25, 10, map(b, 0, 10, 100, 0)),
+
lx.hsb
(lx.getBaseHuef() + 25, 10, map(b, 0, 10, 100, 0)),
ADD);
} else {
colors[p.index] = blendColor(
colors[p.index],
ADD);
} else {
colors[p.index] = blendColor(
colors[p.index],
-
color
(25, 10, map(b, 0, 10, 0, 15)),
+
lx.hsb
(25, 10, map(b, 0, 10, 0, 15)),
SUBTRACT);
}
}
SUBTRACT);
}
}