<?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/4535" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2013-03-14T22:06:44+00:00</updated>

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

		<entry>
		<author><name><![CDATA[czuber]]></name></author>
		<updated>2013-03-14T22:06:44+00:00</updated>

		<published>2013-03-14T22:06:44+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=30254#p30254</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=30254#p30254"/>
		<title type="html"><![CDATA[Re: how to use btSoftBodyHelpers::CreatePatchUV() ?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=30254#p30254"><![CDATA[
Worked very well!<br><br>Thanks!<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10090">czuber</a> — Thu Mar 14, 2013 10:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mi076]]></name></author>
		<updated>2011-05-18T10:41:56+00:00</updated>

		<published>2011-05-18T10:41:56+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=23526#p23526</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=23526#p23526"/>
		<title type="html"><![CDATA[Re: how to use btSoftBodyHelpers::CreatePatchUV() ?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=23526#p23526"><![CDATA[
comments from btSoftBodyHelpers.cpp<div class="codebox"><p>Code: </p><pre><code>        /*         *         *  corners:         *         *  [0][0]     corner00 ------- corner01   [resx][0]         *                |                |         *                |                |         *  [0][resy]  corner10 -------- corner11  [resx][resy]         *         *         *         *         *         *         *   "fixedgs" map:         *         *  corner00      --&gt;   +1         *  corner01      --&gt;   +2         *  corner10      --&gt;   +4         *  corner11      --&gt;   +8         *  upper middle --&gt;  +16         *  left middle    --&gt;  +32         *  right middle  --&gt;  +64         *  lower middle --&gt; +128         *  center         --&gt; +256         *         *         *   tex_coords size   (resx-1)*(resy-1)*12         *         *         *         *     SINGLE QUAD INTERNALS         *         *  1) btSoftBody's nodes and links,         *     diagonal link is optional ("gendiags")         *         *         *    node00 ------ node01         *      | .                       *      |   .                     *      |     .                   *      |       .                 *      |         .               *    node10        node11         *         *         *         *   2) Faces:         *      two triangles,         *      UV Coordinates (hier example for single quad)         *               *     (0,1)          (0,1)  (1,1)         *     1 |\            3 \-----| 2         *       | \              \    |         *       |  \              \   |         *       |   \              \  |         *       |    \              \ |         *     2 |-----\ 3            \| 1         *     (0,0)    (1,0)       (1,0)         *         *         *         *         *         *         */</code></pre></div><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2636">mi076</a> — Wed May 18, 2011 10:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mi076]]></name></author>
		<updated>2011-05-18T10:15:08+00:00</updated>

		<published>2011-05-18T10:15:08+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=23525#p23525</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=23525#p23525"/>
		<title type="html"><![CDATA[Re: how to use btSoftBodyHelpers::CreatePatchUV() ?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=23525#p23525"><![CDATA[
Here is an example:<br>use like CreatePatch() and provide a pointer to array to hold texture coordinates.<div class="codebox"><p>Code: </p><pre><code>int resolution_x = 10;int resolution_y = 10;const btScalar half_width = btScalar(10.0);const btScalar length      = btScalar(20.0);const btScalar pos_x      = btScalar(-15.0);const btScalar pos_y      = btScalar(30.0);const btScalar pos_z      = btScalar(-50.0);float * tex_coords = new float[ (resolution_x - 1)*(resolution_y -1)*12 ];btSoftBody * sb = btSoftBodyHelpers::CreatePatchUV(soft_body_world_info,                                  btVector3(pos_x - half_width,                                            pos_y,                                            pos_z),                                  btVector3(pos_x + half_width,                                            pos_y,                                            pos_z),                                  btVector3(pos_x - half_width,                                            pos_y - length,                                            pos_z + btScalar(0.0)),                                  btVector3(pos_x + half_width,                                            pos_y - length,                                            pos_z + btScalar(1.0)),                                  resolution_x,                                  resolution_y,                                  1 + 2,                                  false,                                  tex_coords);world-&gt;addSoftBody(sb);//sb-&gt;setTotalMass(btScalar(5.0));</code></pre></div>draw:<br><div class="codebox"><p>Code: </p><pre><code>glActiveTexture(GL_TEXTURE0);glBindTexture(GL_TEXTURE_2D, t0);glEnable(GL_TEXTURE_2D);glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);int j = 0;        for(int i=0; i &lt; sb-&gt;m_faces.size(); i++)    {    btSoftBody::Face f0 = sb-&gt;m_faces[i];    btSoftBody::Node * node00 = f0.m_n[0];    btVector3 v00 = node00-&gt;m_x;    btVector3 n00 = node00-&gt;m_n;    btSoftBody::Node * node01 = f0.m_n[1];    btVector3 v01 = node01-&gt;m_x;    btVector3 n01 = node01-&gt;m_n;    btSoftBody::Node * node02 = f0.m_n[2];    btVector3 v02 = node02-&gt;m_x;    btVector3 n02 = node02-&gt;m_n;    glBegin(GL_TRIANGLES);    glNormal3f( n00.getX(), n00.getY(), n00.getZ() );    glMultiTexCoord2f(GL_TEXTURE0, tex_coords[j+0], tex_coords[j+1]);    glVertex3f( v00.getX(), v00.getY(), v00.getZ() );    glNormal3f( n01.getX(), n01.getY(), n01.getZ() );    glMultiTexCoord2f(GL_TEXTURE0, tex_coords[j+2], tex_coords[j+3]);    glVertex3f( v01.getX(), v01.getY(), v01.getZ() );    glNormal3f( n02.getX(), n02.getY(), n02.getZ() );    glMultiTexCoord2f(GL_TEXTURE0, tex_coords[j+4], tex_coords[j+5]);    glVertex3f( v02.getX(), v02.getY(), v02.getZ() );    glEnd();    j += 6;    }glDisable(GL_TEXTURE_2D);</code></pre></div><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2636">mi076</a> — Wed May 18, 2011 10:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[neothemachine]]></name></author>
		<updated>2011-05-17T19:58:12+00:00</updated>

		<published>2011-05-17T19:58:12+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=23518#p23518</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=23518#p23518"/>
		<title type="html"><![CDATA[Re: how to use btSoftBodyHelpers::CreatePatchUV() ?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=23518#p23518"><![CDATA[
I'm wondering about the same function. It would be nice if a developer could shed some light on it. Thanks!<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=8168">neothemachine</a> — Tue May 17, 2011 7:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[yaoyansi]]></name></author>
		<updated>2010-01-02T05:36:31+00:00</updated>

		<published>2010-01-02T05:36:31+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=16758#p16758</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=16758#p16758"/>
		<title type="html"><![CDATA[how to use btSoftBodyHelpers::CreatePatchUV() ?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=16758#p16758"><![CDATA[
hi, all<br>Could you tell me how to use btSoftBodyHelpers::CreatePatchUV() ? There is no demo in bullet on this function. I have a problem of how to create a skit on a skinned character, but i don't know whether this function can solve my problem.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=3020">yaoyansi</a> — Sat Jan 02, 2010 5:36 am</p><hr />
]]></content>
	</entry>
	</feed>
