Login
You're viewing the functional.cafe public feed.
  • Mar 3, 2026, 2:07 AM

    In my online undergraduate P5.js course, students are about to begin the module on motion and physics, including a bit of physics simulation using Matter.js. It suddenly occurred to me that I had never seen anybody put together this particular demo before, and I realized it had to be done. Messy source code at editor.p5js.org/isohedral/full.

    A short video displaying a P5.js sketch in operation. The sketch appears to show the classic XKCD comic #2347, "Dependency" (a tower of blocks representing "all modern digital infrastructure", with a single narrow block near the bottom labelled "a project some random person in Nebraska has been thanklessly maintaining since 2003"). A mouse pointer appears and clicks on the narrow support block. The blocks come to life, evidently controlled by a rigid-body physics simulation, and the whole tower quickly collapses, just as we would expect it to do.
    💬 37🔄 1031⭐ 1171

Replies

  • Mar 3, 2026, 11:57 AM

    @csk Register the mousemove handler on the window object, then you will get the events even when the mouse moves out of the window/frame while dragging.

    💬 1🔄 0⭐ 1
  • 💬 1🔄 0⭐ 1
  • Mar 3, 2026, 1:35 PM

    @Humus @csk hmm, maybe turn it into an awareness-building game (a la tower defense games) where you must fend-off hackers trying to topple the whole tower over and whack knowledge into capitalists'/politicians' heads that treat the ecosystem as a black-box; boss level: secure funding without caving into three-letter agencies pressuring the dev to sneak vulnerabilities.

    💬 1🔄 0⭐ 0
  • Mar 3, 2026, 4:01 PM

    @csk Sometimes I wonder if this isn't the right solution to the software problem.

    A video of the xkcd software stack cartoon, but the bottom box is flung up into the air, causing all the boxes on top to spread everywhere.
    💬 0🔄 6⭐ 11
  • 💬 1🔄 0⭐ 1
  • ChuckChuckMcManis@chaos.social
    Mar 3, 2026, 7:13 PM

    @csk So you're saying if you shove aside the random person in Nebraska the architecture simplifies itself to something with fewer layers? 😆

    💬 1🔄 0⭐ 2
  • 💬 1🔄 10⭐ 19
  • Mar 4, 2026, 2:52 PM

    @csk I love the idea, but it's unstable in its base config already. Just clicking into the image changes the setup.

    💬 1🔄 0⭐ 0