Hi, I’m really new to processing and I need some help on an idea I don’t really know where to start at.
What I have now is a grid, and I’ll make it not visible later, it just acts as a guideline.
I want a vertical line to appear in every single box of the grid, with randomized thickness and location inside each grid box. I don’t think I have the right general idea to pull this.
so would I was thinking I code a line appearing randomly in one square with different thickness first, then loop it down the x-axis then the y-axis of the grid.
Is there another method or idea anyone would suggest?
ah- sorry if it’s hard to read, I don’t know how to upload what I have so I just copied pasted it directly in text from processing.
int x;
int y;
int gridX = 20;
int gridY = 30;
int gridXB = 120;
int gridYB = 120;
void setup()
{
size(1200, 900);
background(230);
noStroke();
frameRate(10);
}
void draw()
{
rectMode(CENTER);
noFill();
stroke(0);
strokeWeight(1);
rect(width/2, height/2, 1100, 800);
//first square starts within 100 from the boarder (20+80)
//grid squares end before the boarder (120 away from screen size)
for (int x = gridXB; x <= width-120; x += gridX)
{
for (int y = gridYB; y <= height-120; y += gridY)
{
strokeWeight(0.25);
noFill();
rect(x, y, 19, 29);
//the line randomly generates within each square of the grid
//the line varies from different thickness
//looping from the first line down the x-axis
}
}
{