from Hacker News

Relax while watching bouncing particles making connections when they get closer

by tikili on 1/6/25, 4:27 PM with 80 comments

  • by chkas on 1/9/25, 7:22 PM

    Hello author here. I'm a little surprised to see this on the front page of Hacker News. This is just a simple demo for my educational programming language Easylang. You can easily edit the code and increase the particle count for example. In the IDE you can then create a link with the code embedded in the URL.

    https://tiki.li/run/#cod=dVLNbsIwDL7nKT5p0gRDdEGMA9PYM+yO0FT...

  • by kaeruct on 1/9/25, 4:16 PM

    I'd like to share mine as well. There's a bit of more interaction between particles but I don't remember the exact logic. Code should be easy to read: https://kaeruct.github.io/projects/short-experiments/dots/
  • by bijection on 1/10/25, 2:03 AM

    I built a similar thing that includes forces between particles meant to simulate a sort of fluid or, as you scroll down, a gelatinous solid. There’s a bit of free energy injected to keep things moving so it’s actually a very bad fluid sim, but I think that makes it a better interactive toy in exchange.

    One of the fun parts of naively n^2 particle simulations is trying to find ways to reduce the algorithmic complexity of collision detection. I remember messing with sweep lines and similar, though I don’t remember what optimizations made it into the final code. [0]

    [0] https://omrelli.ug

  • by Recursing on 1/9/25, 9:34 PM

    See https://bleuje.com/animationsite/2024_1/ for a collection of programmatic black and white animations made with https://processing.org/

    He publishes the source code on https://github.com/Bleuje/processing-animations-code/tree/ma...

  • by thih9 on 1/10/25, 12:13 AM

    Note, you can edit the code.

    Here’s my version, with particles affecting each other: https://tiki.li/run/#cod=dVPbToNAEH3fr5jExLQacFH7UNP6Db43jaF...

  • by christina97 on 1/9/25, 5:30 PM

    Having a hero background that was a variation of this was really popular about 10 years ago or so. You’ll still find them on plenty of websites built around that time.
  • by mjstone on 1/9/25, 3:45 PM

    Reminds me of the Ex Machina end credits [1] (and the Android live wallpaper I made as a homage to it [2].)

    [1] https://www.youtube.com/watch?v=uRJ-fPAO3Go [2] https://play.google.com/store/apps/details?id=com.figmentano...

  • by tempestn on 1/9/25, 8:41 PM

    Anyone else's brain find this... I guess stressful, rather than relaxing? Something about them connecting but never hanging on, and the bits never all coming together, I think.
  • by bouncybouncycat on 1/9/25, 4:12 PM

    It seems to me that it is inevitable: every programmer goes through a phase where they do a bounded billiard ball simulation. It’s like a right of passage.
  • by someoneontenet on 1/9/25, 3:34 PM

    Neat, I’ve also made something like this with processing https://robw.fyi/constellation.html
  • by airstrike on 1/9/25, 4:02 PM

    Made a version with charged particles. Probably bad physics all around, but here it is: https://shorturl.at/ocvEO
  • by youainti on 1/9/25, 7:47 PM

    This made me realize how much I miss screensavers. I used to sit and just stare at them meditatively as a teen.
  • by gus_massa on 1/7/25, 3:54 PM

    Nice. Have you tried a version where the particles have a small atraction/repulsion? (Bonus points for a bar to choose the force.) (1/r^2? can I choose the exponent?)
  • by sota_pop on 1/10/25, 1:44 AM

    This reminds me of the header on the home page of one of my favorite network theory books:

    https://networksciencebook.com/

    The version in the banner is interactive with your cursor!

  • by idiotsecant on 1/10/25, 12:11 AM

    As an aside, I described this to Claude and had it recreate it in javascript with some other features I wanted. It took me 30 seconds to write the prompt and it worked flawlessly.

    Will anyone ever write fun things like this again once the machine can do it for you? How will young people ever get interested when the machine can do all the work for you?

  • by chkas on 1/10/25, 7:51 AM

  • by Art9681 on 1/10/25, 4:55 AM

    Neat. This is a popular visualization. It's been the ParticlesJS demo for quite some time now:

    https://vincentgarreau.com/particles.js/

    There are many like it, but this one is yours and its pretty cool.

  • by sadeshmukh on 1/10/25, 11:31 PM

    I decided to try making one myself and spent absolutely way too long on it: https://particles.halceon.xyz
  • by 65 on 1/9/25, 5:12 PM

    This would make the perfect hero background to my portfolio site!
  • by alentred on 1/9/25, 5:17 PM

    That... is... mesmerizing... ... ... ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏

    Thank you. I wonder if I could use it for meditation. If only it would not require a blue screen.

  • by ddawson on 1/9/25, 2:56 PM

    I feel like that's what's happening to my neurons when I'm browsing Reddit. And Hacker News.
  • by bitwize on 1/9/25, 10:11 PM

    Neat!

    I wrote a "game jam fail" game involving pulsating blue "cells" that cluster together and form attacking aliens:

    https://github.com/bitwize/cosmic-sweep

  • by greatNespresso on 1/9/25, 8:29 PM

    Hypnotizing. Watching this with Beanie playing in the background. Mate that feels good
  • by nayuki on 1/10/25, 1:24 AM

  • by grues-dinner on 1/9/25, 3:15 PM

    Nice. Reminds me strongly of levitated.net (sadly broken due to no Flash) and complexification.net (sadly broken due to no Java).

    Geeking out over Jared Tarbell over dial up basically got me into computers in the first place.

  • by polishdude20 on 1/9/25, 5:22 PM

    I'd love to see the connection line come from both particles and join between them! Ooo and also if they can like start with random colors and slowly as they meet their colors average out
  • by Zaskoda on 1/9/25, 7:06 PM

    This is a lot like how I imagine a mesh net with mobile nodes working.
  • by stackedinserter on 1/9/25, 3:58 PM

    I can't relax, the fact that connections don't affect their speed/direction infuriates me.
  • by voiper1 on 1/9/25, 5:01 PM

    Cute. First thing I did though was to see if moving my mouse or clicking affected it. Doesn't seem to, please add that!
  • by dbajaj on 1/10/25, 5:22 PM

    Do they attract to each other and over time gravitate towards the center?
  • by ausbah on 1/9/25, 7:40 PM

    curious what do ppl usually use to make these animations? i’ve used pillow with python in the pass but that only really works with images and seems clunky
  • by deadbabe on 1/9/25, 3:32 PM

    What if you incorporate game of life type rules into this?
  • by junon on 1/9/25, 7:27 PM

    Would love to see this with boids simulations :D
  • by leeoniya on 1/9/25, 3:22 PM

    there is a website on the internet that has this in the banner or background, but i cannot remember what it was.
  • by justsomehnguy on 1/9/25, 3:06 PM

    Need DVD version