The Squishy Lab

Double Pendulum

Posted on under Projects

It's been a while since I've posted anything to the site, but I've finally finished my latest project: Double Pendulum! It's pretty self-explanatory—it's an interactive double pendulum simulation. Check it out here, or continue reading to see my thoughts on the project.


The Inspiration

It's hard to pin down exactly where and when I became inspired to do this. After all, I've always had a special place in my heart for writing physics simulations, from the orbit simulations of my youth to the fluid simulations that I one day hope to write.

But if I had to pin the inspiration for Double Pendulum down to one moment, I'd probably say it came from the classes I took on dynamical systems and numerical analysis.

I've always enjoyed being able to take what I've learned in multiple fields and see how everything can interact, and this project is no different. Specifically, putting this together involved:

  • Finding equations of motion for the system
  • Building a solver for the system
  • Inverse kinematics to snap the masses to the mouse
  • Setting up plots of phase space and portrait space
  • And a lot of time spent positioning UI elements.

Some of this was taught in my classes, some of it was taught to me by my friends, and some of it was stuff I already knew. But regardless, it was fun to get to put it all together into one project.


That being said, I don't think there's too much to talk about in terms of the process of building this. Of course, I used Haxe to bulid it and the OpenFL framework to handle rendering and interaction, as well as the FeathersUI library for most of the UI elements, but I don't think that I have much else to say about it. If anything, I think that this mostly ended up being an exercise in object-oriented programming and codebase management, as well as getting even more familiar with the above frameworks. Just another small step towards my childhood dream of one day becoming a game developer of some sort.

One other small thing that I felt was worth noting was how much this project came to resemble an educational applet from the glory days of Flash and Java in the browser. Maybe it's just my nostalgia speaking, but I feel like there's a certain charm to applets of the era. And though I've clearly built something more in line with my modern aesthetic, I'd like to think that I've captured that long-gone spirit to an extent.

Who knows? Maybe I'll publish more applets like this in the future. Until then, stay tuned—I've got some big ideas for the future.

0 Comments

Log in to comment on posts.

Nothing here yet. Be the first to comment!