In the end, he got tired of writing all the coordinates for the terrain vertices, but he did get quite far.
Applying Box2D to translate from pixels into mm:
Some more translations, this time from Codea (Lua) into Processing (Java).
Physics Lab tests from Codea:
Several recent translations of Box2D examples (from Daniel Shiffman’s book The Nature of Code) into Codea, that is Processing (Java) into Lua. Both Box2D and Codea are physics libraries.
Revolute Joint (Windmill):
In this project Simon combined two exercises and one example from Daniel Shiffman’s Nature of Code book, Chapter 5 – Physic Libraries. The specific physics library used here is Box2D. Simon combined exercises 5.6 (Bridge) and 5.10 (Attraction Apply Force), and example 5.7 (Create a windmill) to create a motor that catapults particles towards an attractor. If the particles fly past the attractor, “bricks” can be added to the canvas by clicking the mouse – the weight of the bricks helps regulate the motor in the right direction. For this project, both gravitational attraction and global gravity force were applied: