Remix.run Logo
▲ donalddominko 3 hours ago

This is actually very interesting idea you had. I watched the demo and played with it and I am looking for a link to repo - I would like to know how did you implement the system achieving the outcome.

▲bhaprayan 2 hours ago | parent [-]

Happy to open source, the code is a little messy right now, so I’ll clean it up and post a link in a few days!

High level:

I’m using ThreeJS for the rendering and Rapier (https://rapier.rs/) for simulating bodies, joints, collisions, forces, etc. The mechanism is solved for using a simple heuristic search (eg constraints, etc that you introduce in the scene) and then run through Rapier to find a configuration that works, though there are definitely more sophisticated ways to do this. The audio is based off a sound pack which I tried to make physically realistic so impacts are panned relative to the camera, with compression and a small generated reverb.