r/processing • • Aug 10 '20

Pocket Pleasures

173 Upvotes

12 comments sorted by

4

u/jusstol Aug 11 '20

What’s the logic behind the cool flickering effect in the background ?

5

u/Proton_Pixel Aug 11 '20 edited Aug 11 '20

it's a very simple random function :

void drawNoise(float radius) {

loadPixels();

for (int x = 0; x < width; x++)

for (int y = 0; y < height; y++) {

if (dist(width / 2, height / 2, x, y) < radius && y < height / 2)

pixels[x + y * width] = random(1) < .75 ? color(0) : color(255);

}

updatePixels();

}

1

u/jusstol Aug 11 '20

That simple ! Thank you for sharing.

2

u/[deleted] Aug 10 '20

neat effect!

1

u/ashadowwolf Aug 11 '20

Just looking at the thumbnail, I thought I was on r/crossstitch so this was a pleasant surprise

1

u/birv2 Aug 11 '20

Super cool! I’d love to see the code.

1

u/[deleted] Aug 11 '20

Looks coolHow did you get the black fade behind the circle? Or is it just my screen? Looks very subtle