Answer the question
In order to leave comments, you need to log in
How to load mesh object geometry from three.js to cannon.js?
There is an example , I can’t understand how to process the geometry of a mesh object and how to feed it to cannon.js.
Mesh I get from ColladaLoader.
Answer the question
In order to leave comments, you need to log in
With the help of hacd , I disassembled the model, and gave it to ConvexPolyhedron () if this is not done, something like
Apparently:
new Trimesh(vertices, indices);
creates a mesh collider from an array of vertices and triangle indices.
In three.js, a mesh has a geometry (geometry), an octor has similar arrays: vertices and faces. Only they are made up of objects, not numbers. So all you have to do is turn the arrays of objects into arrays of numbers and feed them to cannon.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question