fill shapes with generative patterns
in
Programming Questions
•
1 year ago
Hello
I'm wondering if is there a way to fill a shapes like triangles with a simple for cycle like this. In my project I would like to fill some triangles with differents pattern like points, lines,etc...
beginShape(TRIANGLES);
vertex(30, 75);
vertex(40, 20);
vertex(50, 75);
for (int i = 0; i < width; i = i+5) {
for (int j = 0; j < height; j = j+5) {
point(i, j);
}
}
endShape();
Where widht and height would be the range inside the vertex.
I suppose this is no the way but I cannot find the right solution.
I don't want to fill with images like png or jpg because it's heavy for my project, I have a lot of triangles inside an arrayList so could be not useful ... I prefer to generate the patterns.
Thanks for your support
Roberto
I'm wondering if is there a way to fill a shapes like triangles with a simple for cycle like this. In my project I would like to fill some triangles with differents pattern like points, lines,etc...
beginShape(TRIANGLES);
vertex(30, 75);
vertex(40, 20);
vertex(50, 75);
for (int i = 0; i < width; i = i+5) {
for (int j = 0; j < height; j = j+5) {
point(i, j);
}
}
endShape();
Where widht and height would be the range inside the vertex.
I suppose this is no the way but I cannot find the right solution.
I don't want to fill with images like png or jpg because it's heavy for my project, I have a lot of triangles inside an arrayList so could be not useful ... I prefer to generate the patterns.
Thanks for your support
Roberto
1