2

I've been using Cannon.js with Three.js a lot recently and they work great together.

There's to be one part which I'm struggling to find information/examples about.

Is it possible to rig a character model using Cannon.js default shapes for physics/collision simulations?

For example - https://threejs.org/examples/webgl_animation_skinning_blending.html

This is a Three.js SkinnedMesh (exported from a 3d application), it contains bones which simulate 'pre-configured' animations (walk, run, etc). I want to add Cannon.js shape's to each 'bone' and be able to use this model in my scene for collisions etc. Is this possible to do?

danlong
  • 880
  • 1
  • 8
  • 21
  • Do you want the physics to drive the skinmesh (ragdoll simulation), or do you want the skinmesh animation to drive the physics shapes? – schteppe Sep 12 '18 at 07:22
  • Ideally both? I'd like to be able to have a skinmesh character rigged to walk, run but then if the character gets hit, react with the cannon.js type physics. – danlong Sep 12 '18 at 08:24
  • I'm trying to achieve the same goal, any chance you managed to do it? – Nikita Fedorov Oct 15 '20 at 07:07
  • Unfortunately I didn't get any further than this question, sorry. – danlong Oct 16 '20 at 10:29
  • @danlong I managed to do it, but still struggling with performance. If you're still interested, check this answer: https://stackoverflow.com/a/65074285/6188783 – Nikita Fedorov Nov 30 '20 at 13:16
  • Thanks for the reference @NikitaFedorov - hope you manage to sort performance – danlong Nov 30 '20 at 19:15

0 Answers0