By 44avalanche
This is an update for previous video: • Simple Gears Visual Simulation (test code)
Added: Reciprocating Engine + Inertia for acceleration and braking. There are still problems with the math to control the inertia and rotation. The equations used to control the angular speed to simulate inertia are:
-For acceleration [1-e^(-t/TC)] TC=Time Constant
-For braking [e^(-t/TC)]
Although the visual effect looks acceptable, I don't know if in a real system like that, the inertial behavior is exponential and can be modeled by these equations. While braking, the rotation is even inverted (something I wasn't expecting)
Built with Processing 2.03. (still under construction).
Music:
Bright Wish by Kevin MacLeod (incompetech.com)
Funk Game Loop by Kevin MacLeod (incompetech.com)