Per-vertex fill not working in retained mode
in
Programming Questions
•
10 months ago
Hi
Anyone know why the retained mode code below doesn't apply the fill colours appropriately as per the non-retained mode version? Is this a bug or is there a different syntax for per-vertex fill settings in retained mode?
Thanks for any help
Matt
Anyone know why the retained mode code below doesn't apply the fill colours appropriately as per the non-retained mode version? Is this a bug or is there a different syntax for per-vertex fill settings in retained mode?
Thanks for any help
Matt
- PShape testShape;
void setup() {
size(200, 200, P3D);
colorMode(RGB, 255, 255, 255);
noStroke();
testShape = createShape();
testShape.fill(255, 0, 0);
testShape.vertex(50, 50);
testShape.fill(255, 0, 255);
testShape.vertex(150, 50);
testShape.fill(0, 0, 255);
testShape.vertex(150, 150);
testShape.fill(0, 255, 255);
testShape.vertex(50, 150);
testShape.end();
}
void draw() {
background(100, 100, 100);
if (mousePressed) {
shape(testShape);
}
else {
beginShape();
fill(255, 0, 0);
vertex(50, 50);
fill(255, 0, 255);
vertex(150, 50);
fill(0, 0, 255);
vertex(150, 150);
fill(0, 255, 255);
vertex(50, 150);
endShape(CLOSE);
}
}
1