lerpColor not working with beginShape() but beginShape(POINTS). why?
in
Core Library Questions
•
1 year ago
i'm somehow confused. lerpColor is not working without defining the shape mode like: POINTS, LINES... . it's only working when i'm defining OPENGL as a renderer, which i acctually can't do, because i want to use it in processingjs. does anyone know why or maybe a workaround?
WORKING:
----
beginShape(POINTS);
for (int j = 0; j <= steps; j++) {
float t = j / float(steps);
stroke(lerpColor(from, to, t));
float x = bezierPoint(p1x, cp1x, cp2x, p2x, t);
float y = bezierPoint(p1y, cp1y, cp2y, p2y, t);
vertex(x, y);
}
endShape();
---
NOT working:
----
beginShape();
for (int j = 0; j <= steps; j++) {
float t = j / float(steps);
stroke(lerpColor(from, to, t));
float x = bezierPoint(p1x, cp1x, cp2x, p2x, t);
float y = bezierPoint(p1y, cp1y, cp2y, p2y, t);
vertex(x, y);
}
endShape();
---
1