A browser-based physics playground which is shared between two users, controlled by the Leap Motion (keyboard and mouse fallback is also supported). Users are connected peer2peer through WebRTC, with no intermediate server. The idea is that the ease of a browser app, the interactivity of the Leap Motion, and the social nature of a shared space combine to create an ideal environment for exploring physics.
Built at the Tokyo 2017 Junction Hackathon in April using LeapJS, Collab.js, Matter.js, and Two.js.
lever tipping due to too much weight
Obviously with further utilization of the physics engine many more physics principles could be explored!
Currently there are three modes.
- Mode 0 allows the user to draw static polygons. The user draws the outline of a shape, and from this outline, the environment produces a polygon of similar shape. This polygon is static and is not affected by gravity.
- Mode 1 allows the user to create dynamic circles. These circles are affected by gravity and friction and are especially useful in exploring situations such as a ball rolling down a ramp.
- Mode 2 allows the user to create dynamic polygons. Similar to mode 0, the user draws each vertex, from which a polygon is produced. These polygons are affected by gravity and friction. Such objects are useful in explore the dynamics of blocks sliding down ramps and other scenarios.
Button | Function |
---|---|
c | Clear session space |
spacebar | Switch mode |
Mode | Click function |
---|---|
0 | Create shape |
1 | Create circle |
2 | Create shape |
Gesture | Function |
---|---|
Palm up and fist closed, hold | Clear session |
Palm up | Switch mode |
Gesture | Function |
---|---|
Pinch and draw | Create shape |
Gesture | Function |
---|---|
Tap | Create circle |
Gesture | Function |
---|---|
Pinch and draw | Create shape |