repositories
/
SugarCubes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fd8a39b
)
[Helix] Soften edges
author
Shaheen Gandhi
<shaheen@fb.com>
Wed, 14 Aug 2013 04:10:29 +0000
(21:10 -0700)
committer
Shaheen Gandhi
<shaheen@fb.com>
Wed, 14 Aug 2013 04:10:29 +0000
(21:10 -0700)
ShaheenGandhi.pde
patch
|
blob
|
blame
|
history
diff --git
a/ShaheenGandhi.pde
b/ShaheenGandhi.pde
index 5ab568e3d5f9f5af6ef5325118b2767dc7238091..740883ddbb71b50da56d6b042c46453844a3b21d 100644
(file)
--- a/
ShaheenGandhi.pde
+++ b/
ShaheenGandhi.pde
@@
-120,9
+120,11
@@
class HelixPattern extends SCPattern {
// the helix. Figure out if the current point is inside that
// region.
float d = PVector.dist(p, toroidPoint);
// the helix. Figure out if the current point is inside that
// region.
float d = PVector.dist(p, toroidPoint);
- boolean inToroid =
abs(d)
< girth;
+ boolean inToroid =
d
< girth;
- return color((lx.getBaseHuef() + (360*(phase / TWO_PI)))%360, (inToroid ? 100 : 0), (inToroid ? 100 : 0));
+ // Soften edges by fading brightness
+ float b = constrain(100*(1 - ((d-.5*girth)/(girth*.5))), 0, 100);
+ return color((lx.getBaseHuef() + (360*(phase / TWO_PI)))%360, (inToroid ? 80 : 0), b);
}
}
}
}
@@
-158,6
+160,7
@@
class HelixPattern extends SCPattern {
// parameterized t value. select base pairs and
// associated colors. lerp between colors for each
// base pair to produce a DNA effect.
// parameterized t value. select base pairs and
// associated colors. lerp between colors for each
// base pair to produce a DNA effect.
+
}
void run(int deltaMs) {
}
void run(int deltaMs) {