0
2

More than 3 years have passed since last update.

複合形状の物体を物理演算の世界に持ち込む (CANNON.js + THREE.js)

Last updated at Posted at 2020-12-31

See the Pen freefall by using cannon.js by kob58im (@kob58im) on CodePen.

要点

複合形状(ここではコの字型)の物体の作成は、ただ単に bodyaddShape するだけで良いっぽい。(cannon.jsのdemodemo.addScene関数から推測した結論。)

CANNON.jsの世界の物体をTHREE.jsの世界の物体に変換する部分は、cannon.demoshape2mesh 関数から持ってきました。

参考サイト

  1. 三次元物理演算エンジン、Cannon.jsを使ってみた。 | KnockKnock
  2. https://schteppe.github.io/cannon.js/build/cannon.demo.js
  3. https://github.com/schteppe/cannon.js/blob/master/demos/compound.html
  4. CANNON.jsのConvexPolyhedronにBlenderから書きだしたデータを読み込ませる - Qiita
  5. Three.js + Cannon.js でゴゴゴとドドドを物理演算してみるテスト - CX's Hatena Blog
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2