We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Can't seem to figure out why my shapes I made are not filling. Here is my code, much appreciated.
void setup() {
size(400, 300);
smooth();
}
void draw() {
fill(117,255,223);
strokeWeight(1);
stroke(0,0,0);
line(331,165,183,296);
line(183,296,39,134);
line(39,134,188,3);
line(188,3,331,165);
fill(255,27,0);
strokeWeight(1);
stroke(0,0,0);
line(187,162,89,248);
line(89,248,187,29);
line(187,29,273,248);
line(273,248,187,162);
fill(92,255,0);
strokeWeight(1);
stroke(0,0,0);
line(73,155,189,130);
line(189,130,102,173);
line(102,173,135,218);
line(135,218,283,53);
line(283,53,137,248);
line(137,248,73,155);
}
Answers
A series of lines is not meant to fill
pls look at PShape / vertex in the reference
Moved topic and reformatted code. See To newcomers in this forum: read attentively these instructions
And as Chrisir said: lines are disconnected (even if you draw them looking like a shape), so there is no fill of the shape they form. beginShape() allows you to draw polygons (and more).