ABC3Dz
1
I’d like to know how to animate a physic box or something geometry.
I search in google, i found: three.js webgl - animation - basic
I try and test follow a three.js example
https://abczezeze.github.io/YingLak/wrong
It’s animate geometry.
It is’t animate physic.
My simple demo
https://abc3dz.github.io/YingLak/simplebox
Hello,
To animate a physics box in Three.js, you can use a physics library like Cannon.js. Here’s a brief overview: HP Instant Ink Login
- Set up Cannon.js: Include Cannon.js in your project.
- Create Physics World: Initialize a physics world to handle collisions and interactions.
- Create Physics Bodies: Create physics bodies (e.g., Box) and add them to the world.
- Synchronize with Three.js: Update the Three.js mesh positions and rotations based on the physics world.
For a detailed guide, you can refer to this tutorial.
Best regards,
Joan Henry
1 Like