Initially started from the Three.js + Vite + TypeScript starter template, this example project has the barebone basics for running a Threejs scene with Bounce physics.
A lot of features have been removed from the original template, just to make it easier to find the code relevant to physics, which is in src/scene.ts.
Note: In a real project, you would typically use instanced meshes when rendering large numbers of the same geometry, to reduce your draw calls. However this was avoided here, again to keep this example simple.
Installation
npm installRun dev mode (starts local server at http://localhost:5173/)
npm run devBuild
npm run buildPreview build (build first! starts local server at http://localhost:4173/)
npm run preview