Skip to content

Instantly share code, notes, and snippets.

@dotmh
Created July 8, 2022 14:05
Show Gist options
  • Save dotmh/f24d8c705707c2aea214d13298d73a06 to your computer and use it in GitHub Desktop.
Save dotmh/f24d8c705707c2aea214d13298d73a06 to your computer and use it in GitHub Desktop.
Gen Art
let angle = 0;
let radiusNoise
let angleNoise
let centerNoise;
function setup() {
createCanvas(1024, 768);
background(220);
radiusNoise = random(10);
angleNoise = random(10)
centerNoise = [random(10), random(10)]
}
function draw() {
radiusNoise += 0.005;
angleNoise += 0.005;
[centerXNoise, centerYNoise] = centerNoise.map((n) => n += 0.06)
const [centerX, centerY] = [
width / 2 + noise(centerXNoise * 100 - 50),
height / 2 + noise(centerYNoise * 100 - 50)
]
let _RADIUS = noise(radiusNoise) * 600;
angle += noise(angleNoise) * 6 -3;
const angleRad = radians(angle);
const pointC = [
centerX + _RADIUS * cos(angleRad),
centerY + _RADIUS * sin(angleRad)
];
const angleRad2 = angleRad + PI;
const pointC2 = [
centerX + _RADIUS * cos(angleRad2),
centerY + _RADIUS * sin(angleRad2)
]
stroke(100,60);
strokeWeight(1);
stroke(
...Array(3).fill(null).map(() => random(255))
)
fill(...Array(3).fill(null).map(() => random(255)))
arc(...pointC, ...pointC2, noise(random(10)), PI + QUARTER_PI * noise(random(10)),CHORD)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment