NMM: Week 1 - Bouncing Balls
I first wanted to get animation with matplotlib working. This took a bit of debugging but I utlimately got it working by following this tutorial and changing the matplotlib backend (there is a known issue with osx). I'm used to Matlab so it'll get a bit of getting used to but I think I may find matplotlib to be more powerful in the long run. I especially love the ability to export gifs by just using imagemagick as the writer:
anim.save('animation.gif', writer='imagemagick', fps=30)
I decided to give Canvas a shot next. This was surprisingly simple and satisfying. I didn't make my example very advanced but it seemed intuitive for how I would go about adding layers of complexity. It's interesting to note how performance is definitely dependent on where it is run. It performs very well in my chrome browser, slower in safari, and grinds to a halt on my iPhone.
Move the mouse to change gravity
Continuing my exploration of physics engines, I thought I should give Open Dynamics Engine a try. It seems like pretty comprehensive physics engine with python bindings (pyODE). I was surprised by how easy it was to get up and running. I originally had few problems with depencies on my mac but I managed to resolve them (the trick was using macports instead of configuring/installing them myself) and got all of the tutorial examples working right away. I took the double pendulum example and modified it by adding a wall, a floor, and collision detection. Adding the collision detection took some effort but I worked it out (tutorial 3 helped a lot).
A pendulum with a small mass barely nudges the wall...
but one with a big mass...