Drawing a color gradient with a line, even in 3D, is pretty straight-forward:
import peasy.*;
PeasyCam cam;
void setup() {
size(1300, 1300, P3D);
cam = new PeasyCam(this, 200);
}
void draw() {
background(255);
beginShape(LINES);
stroke(0, 0, 0);
strokeWeight(30);
vertex(30, 20);
stroke(178, 34, 34);
vertex(85, 75);
endShape();
}
But as soon as I try to draw a curve vertex, the same structure will not draw a color gradient. Why is that and how can I draw a curveVertex with a color gradient?
Here’s a MWE:
import peasy.*;
PeasyCam cam;
void setup() {
size(1300, 1300, P3D);
cam = new PeasyCam(this, 200);
}
void draw() {
background(255);
beginShape();
stroke(0, 0, 0);
strokeWeight(30);
curveVertex(30, 20);
curveVertex(85, 20);
stroke(178, 34, 34);
curveVertex(85, 75);
curveVertex(30, 75);
endShape();
}
I found this post from 2017 but unfortunately, the OP did not reveal how color gradients with vertices and curvedVertices behave the same…