Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Confluence
For you

Programming
Results will update as you type.
  • Programming

/
P5js Modifying distribution along width and height

P5js Modifying distribution along width and height

This content is archived.
Learn more
Aug 10, 2021

 

 

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,
{"serverDuration": 14, "requestCorrelationId": "6f1cb9d872254c06a04d06f9e239438e"}