<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/13130" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2021-01-05T10:48:05+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/13130</id>

		<entry>
		<author><name><![CDATA[AleRena19]]></name></author>
		<updated>2021-01-05T10:48:05+00:00</updated>

		<published>2021-01-05T10:48:05+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43241#p43241</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43241#p43241"/>
		<title type="html"><![CDATA[Re: Problem to add physic in a hollow cylinder (threeJS, AmmoJS)]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43241#p43241"><![CDATA[
<strong class="text-strong">UPDATE (05/01/2021)</strong><br><br>I update the ammoJS code part like this<br><div class="codebox"><p>Code: </p><pre><code>const vec31 = new Ammo.btVector3(0, 0, 0);const vec32 = new Ammo.btVector3(0, 0, 0);const vec33 = new Ammo.btVector3(0, 0, 0);const vertices = geometry.vertices;geometry.faces.forEach(face =&gt; {   triangles.push([      { x: vertices[face.a].x, y: vertices[face.a].y, z: vertices[face.a].z },      { x: vertices[face.b].x, y: vertices[face.b].y, z: vertices[face.b].z },      { x: vertices[face.c].x, y: vertices[face.c].y, z: vertices[face.c].z }   ]);});const shape = new Ammo.btConvexHullShape();triangles.forEach(triangle =&gt; {   vec31.setX(triangle[0].x);   vec31.setY(triangle[0].y);   vec31.setZ(triangle[0].z);   shape.addPoint(vec31, true);   vec32.setX(triangle[1].x);   vec32.setY(triangle[1].y);   vec32.setZ(triangle[1].z);   shape.addPoint(vec31, true);   vec33.setX(triangle[2].x);   vec33.setY(triangle[2].y);   vec33.setZ(triangle[2].z);   shape.addPoint(vec31, true);});</code></pre></div>I found this code from this <a href="https://stackoverflow.com/questions/39441459/rigid-body-shape-in-bullet-ammo-js-from-a-mesh-in-three-js?rq=1" class="postlink">question</a>, but this solution does not seem to work well, the cylinders fall to one side without standing.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13866">AleRena19</a> — Tue Jan 05, 2021 10:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[AleRena19]]></name></author>
		<updated>2020-12-31T10:34:29+00:00</updated>

		<published>2020-12-31T10:34:29+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43226#p43226</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43226#p43226"/>
		<title type="html"><![CDATA[Problem to add physic in a hollow cylinder (threeJS, AmmoJS)]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43226#p43226"><![CDATA[
Hi all,<br><br>I'm pretty new to threeJs and AmmoJs (porting of bullet) world and I don't know if I'm moving totally wrong or I miss something.<br><br>I created a hollow cylinder with threeJs using custom shape (<a href="https://github.com/alerena/shape-creation/blob/master/src/app/model/cave-cylinder.ts#L109-L194" class="postlink">CODE</a>) and created the physic with ammoJS using btConvexHullShape and btCompoundShape (<a href="https://github.com/alerena/shape-creation/blob/master/src/app/model/cave-cylinder.ts#L197-L236" class="postlink">CODE</a>), but something went wrong and I don't know how to make it work.<br><br>Here is a demo.<br><a href="https://hollow-cylinder.web.app/home" class="postlink">https://hollow-cylinder.web.app/home</a><br><br>Anybody can help me?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13866">AleRena19</a> — Thu Dec 31, 2020 10:34 am</p><hr />
]]></content>
	</entry>
	</feed>
