Modifying distribution along width and height
int gridW = 10;
int gridH = 10;
int border = 100;
int stepX = 40;
int stepY = 40;
float distModifier = 1.05;
int graphicSize = 30;
void setup()
{
size(800,800);
background(255);
noStroke();
fill(0);
float distX = stepX;
float distY = stepY;
translate(border,border);
println(pow(distModifier,gridW));
for(int i=0;i < gridH;i++)
{
for(int j = 0;j < gridW;j++)
{
rect(j * distX, i * distY, graphicSize, graphicSize);
distX *= distModifier;
}
distX = stepX;
distY *= distModifier;
}
}
, multiple selections available,
Related content
Modifying scale with distribution
Modifying scale with distribution
Modifying rotation by distribution
Modifying rotation by distribution
p5.js Tiling and Repetition
p5.js Tiling and Repetition
(Extra) Curve Reactor
(Extra) Curve Reactor
Simple Collision Detection
Simple Collision Detection
Lesson 2.4 - Exercises
Lesson 2.4 - Exercises