<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tanishq Singh</title>
    <description>The latest articles on DEV Community by Tanishq Singh (@tanishqsingh2301).</description>
    <link>https://dev.to/tanishqsingh2301</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F829731%2Ff4f339c5-e474-4a1b-ae68-d9bd5902e851.jpg</url>
      <title>DEV Community: Tanishq Singh</title>
      <link>https://dev.to/tanishqsingh2301</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tanishqsingh2301"/>
    <language>en</language>
    <item>
      <title>Create cannon shape from glb / THREE.Mesh / BufferGeometry.</title>
      <dc:creator>Tanishq Singh</dc:creator>
      <pubDate>Wed, 10 Nov 2021 19:11:14 +0000</pubDate>
      <link>https://dev.to/tanishqsingh2301/create-cannon-shape-from-glb-threemesh-buffergeometry-4nn</link>
      <guid>https://dev.to/tanishqsingh2301/create-cannon-shape-from-glb-threemesh-buffergeometry-4nn</guid>
      <description>&lt;p&gt;step 1: npm i cannon-utils&lt;/p&gt;

&lt;p&gt;step 2: import cu from ‘cannon-utils’;&lt;/p&gt;

&lt;p&gt;step 3: create shape, pass mesh and size&lt;/p&gt;

&lt;p&gt;shape: cu.CreateTriMesh(mesh, { x: 5, y: 5, z: 5 });&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;full example&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;gltfLoader.load(‘file_location.glb’, gltf =&amp;gt; {&lt;br&gt;&lt;br&gt;
gltf.scene.scale.set(2, 2, 2);&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;const cannon_shape = &lt;em&gt;cu.CreateTriMesh(gltf.scene.children[1], { x: 5, y: 5, z: 5 });&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;const body = new CANNON.Body({&lt;br&gt;&lt;br&gt;
shape: &lt;strong&gt;cannon_shape&lt;/strong&gt; ,&lt;br&gt;&lt;br&gt;
mass: 1&lt;br&gt;&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;world.addBody(body);&lt;/p&gt;

&lt;p&gt;scene.add(gltf.scene);&lt;br&gt;&lt;br&gt;
});&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
  </channel>
</rss>
