repositories
/
SugarCubes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5bc6e24
)
Parameters and good defaults for Rings
author
Micah Elizabeth Scott
<micah@scanlime.org>
Sun, 23 Feb 2014 00:37:38 +0000
(16:37 -0800)
committer
Micah Elizabeth Scott
<micah@scanlime.org>
Sun, 23 Feb 2014 00:37:38 +0000
(16:37 -0800)
MicahScott.pde
patch
|
blob
|
blame
|
history
diff --git
a/MicahScott.pde
b/MicahScott.pde
index 916bf68a66b34d10d8d27d8eb57881ef0eab6f35..ec3de3c163bbe2d7e0508cbe5c2b4e62e15d2171 100644
(file)
--- a/
MicahScott.pde
+++ b/
MicahScott.pde
@@
-2,36
+2,49
@@
class Rings extends SCPattern {
float dx, dy, dz;
class Rings extends SCPattern {
float dx, dy, dz;
- float angleParam,
z,
hue, satParam, spacingParam;
+ float angleParam, hue, satParam, spacingParam;
float dzParam, centerParam;
float dzParam, centerParam;
+ BasicParameter pSpeed1 = new BasicParameter("SPD1", 0.5);
+ BasicParameter pSpeed2 = new BasicParameter("SPD2", 0.5);
+ BasicParameter pRGB = new BasicParameter("RGB", 0.1);
+ BasicParameter pScale = new BasicParameter("SCALE", 0.1);
+ BasicParameter pDepth = new BasicParameter("DEPTH", 0.25);
+ BasicParameter pBright = new BasicParameter("BRT", 0.46);
+ BasicParameter pGamma = new BasicParameter("GAMMA", 0.27);
+
public Rings(GLucose glucose) {
super(glucose);
public Rings(GLucose glucose) {
super(glucose);
+ addParameter(pSpeed1);
+ addParameter(pSpeed2);
+ addParameter(pScale);
+ addParameter(pDepth);
+ addParameter(pRGB);
+ addParameter(pBright);
+ addParameter(pGamma);
}
public void run(double deltaMs) {
}
public void run(double deltaMs) {
- float noiseScale = 0.02;
- float speed = 0.002;
- float zspeed = 0.04;
- float scale = 1.0;
+ float xyspeed = pSpeed1.getValuef() * 0.004;
+ float zspeed = pSpeed1.getValuef() * 0.08;
+ float scale = pScale.getValuef() * 20.0;
- angleParam += (deltaMs * 0.001) % (2*PI);
+ float angleSpeed = pSpeed1.getValuef() * 0.002;
+ angleParam = (float)((angleParam + angleSpeed * deltaMs) % (2*PI));
float angle = sin(angleParam);
float angle = sin(angleParam);
- z += deltaMs * 0.0008;
- hue += (deltaMs * 0.036) % 360;
-
- satParam += deltaMs * 0.000122;
- spacingParam += deltaMs * 0.000124;
+ hue += (deltaMs * pRGB.getValuef() * 0.3) % 360;
+ satParam += deltaMs * pRGB.getValuef() * 0.002;
+ spacingParam += deltaMs * pSpeed2.getValuef() * 0.0005;
dzParam += deltaMs * 0.000014;
dzParam += deltaMs * 0.000014;
- centerParam += deltaMs *
0.00012
5;
+ centerParam += deltaMs *
pSpeed2.getValuef() * 0.000
5;
float saturation = 100 * constrain(pow(1.9 * noise(satParam), 2.5), 0, 1);
float spacing = noise(spacingParam) * 50;
float saturation = 100 * constrain(pow(1.9 * noise(satParam), 2.5), 0, 1);
float spacing = noise(spacingParam) * 50;
- dx += cos(angle) * speed;
- dy += sin(angle) * speed;
+ dx += cos(angle) *
xy
speed;
+ dy += sin(angle) *
xy
speed;
dz += (pow(noise(dzParam), 1.8) - 0.5) * zspeed;
float centerx = map(noise(centerParam, 100), 0, 1, -0.1, 1.1);
dz += (pow(noise(dzParam), 1.8) - 0.5) * zspeed;
float centerx = map(noise(centerParam, 100), 0, 1, -0.1, 1.1);
@@
-41,6
+54,9
@@
class Rings extends SCPattern {
float coordMin = min(model.xMin, min(model.yMin, model.zMin));
float coordMax = max(model.xMax, max(model.yMax, model.zMax));
float coordMin = min(model.xMin, min(model.yMin, model.zMin));
float coordMax = max(model.xMax, max(model.yMax, model.zMax));
+ float br = pBright.getValuef() * 3.0;
+ float gamma = pGamma.getValuef() * 20.0;
+
for (LXPoint p : model.points) {
// Scale while preserving aspect ratio
for (LXPoint p : model.points) {
// Scale while preserving aspect ratio
@@
-52,14
+68,15
@@
class Rings extends SCPattern {
float pulse = (sin(dz + dist * spacing) - 0.3) * 0.6;
noiseDetail(4);
float pulse = (sin(dz + dist * spacing) - 0.3) * 0.6;
noiseDetail(4);
- float n = map(noise(dx + x*scale + pulse, dy + y*scale, dz + z*scale), 0, 1, -0.65, 1);
+ float n = map(noise(dx + x*scale + pulse, dy + y*scale, dz + z*scale) - pDepth.getValuef(), 0, 1,
+ 0, 2.0);
float m = map(noise(dx + x*scale, dy + y*scale, dz + z*scale), 0, 1, 0, 300);
noiseDetail(1);
colors[p.index] = lx.hsb(
(hue + m) % 360.0,
saturation,
float m = map(noise(dx + x*scale, dy + y*scale, dz + z*scale), 0, 1, 0, 300);
noiseDetail(1);
colors[p.index] = lx.hsb(
(hue + m) % 360.0,
saturation,
- 100 * constrain(pow(
3.0 * n, 3.5
), 0, 1.0)
+ 100 * constrain(pow(
br * n, gamma
), 0, 1.0)
);
}
}
);
}
}