1

I'm tinkering a bit with cannon.js and three.js, and i wish to have terrain. This would require a custom CANNON.RigidBody. I've seen the predefined shapes, like plane, box and sphere, but i cannot seem to figure out where or how cannon defines its shapes. is there a way to create a CANNON.RigidBody from a THREE.Geometry, or THREE.Mesh or even define it poly, by poly?

1 Answer 1

2

If you want to construct a terrain, you could use the CANNON.Heightfield class. See the example.

There's currently no way to feed an arbitrary polygon/trimesh directly into Cannon.js. More on the subject here.

UPDATE: The new CANNON.Trimesh class can be used for trimesh collisions. It is currently limited to sphere and plane collisions.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.