DEV Community

milchreis
milchreis

Posted on • Originally published at suckatcoding.com

Procrastination: Coding Burpees instead of doing them

Let’s be honest: The hardest part of working out isn’t the lifting or the running. It’s deciding what to do.

Naturally, instead of just doing a push-up, I decided to spend several hours coding a 3D simulation to tell me what to do. Is it efficient? No. Is it the "suckatcoding" way? Absolutely.

You can check out the source code or roll the dice yourself below:

The "Why": Motivation (or lack thereof)

Why did I build this? Was it a burning passion for fitness technology? Not exactly.

  • Advanced Procrastination: I needed a rock-solid excuse to delay my actual workout. Nothing burns time quite like debugging JavaScript.
  • Fiscal Responsibility: I refused to spend actual money on those silly physical fitness dice. Why pay $10 for plastic when I can spend hours of my life building a digital version for free?
  • The "Learning" Excuse: I wanted to finally mess around with 3D in the browser. It was the perfect low-stakes project to crash a WebGL context with.

Under the Hood: How it Works

For the tech-curious, I didn't just use Math.random() and call it a day. I wanted it to feel real (even if my motivation to do the resulting Burpees wasn't).

Here is the stack that powers the procrastination:

  • ThreeJS: The heavy lifter used for the 3D rendering.
  • TweenJS: Handles the camera movements and smooth animations, making it look far more professional than it actually is.
  • Real Physics: I used CANNON-ES as physics engine for the dice throws. When the dice tumble, that’s gravity and collision logic at work—no pre-baked animations here.
  • Mood Lighting: I used Red and Blue spotlights to create a specific light atmosphere. Does it help the code run faster? No. Does it look cool? Yes.

The Verdict

The tool works perfectly. It rolls the dice, uses real physics, and looks great in 3D. Unfortunately, this means I have run out of excuses and actually have to do the workout now.

Check it out, fork the repo, and maybe use it to delay your own gym session.

This article was originally published on suckatcoding.com. Check it out for more ranting about Java and Spaghetti Code.

Top comments (0)