/
Modifying distribution along width and height

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;
}
}

Related content

Modifying scale with distribution
Modifying scale with distribution
More like this
Modifying rotation by distribution
Modifying rotation by distribution
More like this
p5.js Tiling and Repetition
p5.js Tiling and Repetition
More like this
(Extra) Curve Reactor
(Extra) Curve Reactor
More like this
Simple Collision Detection
Simple Collision Detection
More like this
Lesson 2.4 - Exercises
Lesson 2.4 - Exercises
More like this