<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.ch/matlabcentral/newsreader/view_thread/242740</link>
    <title>MATLAB Central Newsreader - compute tangent vector to a 3d mesh</title>
    <description>Feed for thread: compute tangent vector to a 3d mesh</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2013 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.ch/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 20 Jan 2009 13:07:21 +0000</pubDate>
      <title>compute tangent vector to a 3d mesh</title>
      <link>http://www.mathworks.ch/matlabcentral/newsreader/view_thread/242740#622731</link>
      <author>antonietta</author>
      <description>&lt;br&gt;
&lt;br&gt;
I=B4m interested to compute the tangent normal of a 3D mesh at each&lt;br&gt;
vertex given the normals.&lt;br&gt;
&lt;br&gt;
I have a mesh, the coordinate of its center of mass and for each its&lt;br&gt;
vertex I have already the normals. At each vertex I=B4m interested to&lt;br&gt;
compute the tangent vector pointing toward the center of mass of the&lt;br&gt;
mesh .&lt;br&gt;
&lt;br&gt;
Any suggestions would be appreciated.</description>
    </item>
    <item>
      <pubDate>Tue, 20 Jan 2009 16:27:02 +0000</pubDate>
      <title>Re: compute tangent vector to a 3d mesh</title>
      <link>http://www.mathworks.ch/matlabcentral/newsreader/view_thread/242740#622779</link>
      <author>Roger Stafford</author>
      <description>antonietta &amp;lt;mangomengo@gmail.com&amp;gt; wrote in message &amp;lt;de7daa1b-7618-44b9-8a01-b52355ab1b9d@r36g2000prf.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I=B4m interested to compute the tangent normal of a 3D mesh at each&lt;br&gt;
&amp;gt; vertex given the normals.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have a mesh, the coordinate of its center of mass and for each its&lt;br&gt;
&amp;gt; vertex I have already the normals. At each vertex I=B4m interested to&lt;br&gt;
&amp;gt; compute the tangent vector pointing toward the center of mass of the&lt;br&gt;
&amp;gt; mesh .&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Any suggestions would be appreciated.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;At any point P=[x,y,z] with C=[x0,y0,z0] the center of mass, if N is the normal vector and C-P the vector pointing to the center of mass from P, then&lt;br&gt;
&lt;br&gt;
&amp;nbsp;cross(cross(N,C-P),N)&lt;br&gt;
&lt;br&gt;
will be in the direction of the surface tangent toward the center of mass.  You will probably want to normalize it to a unit vector by dividing it by its magnitude.  This works except in those cases where N points directly to the center of mass, in which case the tangent direction would be inherently indeterminate.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;Look up 'cross' in the documentation to apply it to your mesh of points in a vectorized manner.&lt;br&gt;
&lt;br&gt;
Roger Stafford</description>
    </item>
    <item>
      <pubDate>Thu, 22 Jan 2009 19:25:59 +0000</pubDate>
      <title>Re: compute tangent vector to a 3d mesh</title>
      <link>http://www.mathworks.ch/matlabcentral/newsreader/view_thread/242740#623275</link>
      <author>antonietta</author>
      <description>Dear all and dear Roger,&lt;br&gt;
&lt;br&gt;
Thanks for your previous posting ...&lt;br&gt;
it has been really helpful, everything works perfectly now.&lt;br&gt;
&lt;br&gt;
However, a new question come into my mind. ...It is pretty hard to&lt;br&gt;
explain, but I'll try to be clear.&lt;br&gt;
&lt;br&gt;
What about if I want to compute the surface tangent pointing from&lt;br&gt;
point P toward a generic point Pext? If P=3D[x,y,z] is a mesh point,  C=3D&lt;br&gt;
[x0,y0,z0] is the center of mass and N is the surface normal at point&lt;br&gt;
P. Pext =3D[x_ext,y_ext,z_ext] is a generic point in the space. Pext is&lt;br&gt;
NOT a point  of the mesh. I' m interested in computing the surface&lt;br&gt;
tangent pointing from P toward the projection of Pext on the tangent&lt;br&gt;
PLANE (at point P).In other words:&lt;br&gt;
I guess I should first compute the surface tangent plane  where point&lt;br&gt;
P belongs,&lt;br&gt;
next I should compute the projection (let's denote it as P2) of point&lt;br&gt;
Pext into the tangent plane,&lt;br&gt;
finally the tangent I am interested in should be something like the&lt;br&gt;
segment P2-P.&lt;br&gt;
&lt;br&gt;
Am I right?&lt;br&gt;
Do you have any suggestions about how to code this in matlab?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Thanks.&lt;br&gt;
&lt;br&gt;
Best Regards&lt;br&gt;
&lt;br&gt;
Antonietta&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
On Jan 20, 6:27=A0pm, "Roger Stafford"&lt;br&gt;
&amp;lt;ellieandrogerxy...@mindspring.com.invalid&amp;gt; wrote:&lt;br&gt;
&amp;gt; antonietta&amp;lt;mangome...@gmail.com&amp;gt; wrote in message &amp;lt;de7daa1b-7618-44b9-8a0=&lt;br&gt;
1-b52355ab1...@r36g2000prf.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I=3DB4m interested to compute thetangentnormal of a 3Dmeshat each&lt;br&gt;
&amp;gt; &amp;gt; vertex given the normals.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I have amesh, the coordinate of its center of mass and for each its&lt;br&gt;
&amp;gt; &amp;gt; vertex I have already the normals. At each vertex I=3DB4m interested to&lt;br&gt;
&amp;gt; &amp;gt; compute thetangentvector pointing toward the center of mass of the&lt;br&gt;
&amp;gt; &amp;gt;mesh.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Any suggestions would be appreciated.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; =A0 At any point P=3D[x,y,z] with C=3D[x0,y0,z0] the center of mass, if N=&lt;br&gt;
&amp;nbsp;is the normal vector and C-P the vector pointing to the center of mass fro=&lt;br&gt;
m P, then&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; =A0cross(cross(N,C-P),N)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; will be in the direction of the surfacetangenttoward the center of mass. =&lt;br&gt;
=A0You will probably want to normalize it to a unit vector by dividing it b=&lt;br&gt;
y its magnitude. =A0This works except in those cases where N points directl=&lt;br&gt;
y to the center of mass, in which case thetangentdirection would be inheren=&lt;br&gt;
tly indeterminate.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; =A0 Look up 'cross' in the documentation to apply it to yourmeshof points=&lt;br&gt;
&amp;nbsp;in a vectorized manner.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Roger Stafford</description>
    </item>
    <item>
      <pubDate>Thu, 22 Jan 2009 20:31:02 +0000</pubDate>
      <title>Re: compute tangent vector to a 3d mesh</title>
      <link>http://www.mathworks.ch/matlabcentral/newsreader/view_thread/242740#623302</link>
      <author>Roger Stafford</author>
      <description>antonietta &amp;lt;mangomengo@gmail.com&amp;gt; wrote in message &amp;lt;41b15a45-2966-4691-9d5e-b4a8cf757605@x16g2000prn.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; .......&lt;br&gt;
&amp;gt; What about if I want to compute the surface tangent pointing from&lt;br&gt;
&amp;gt; point P toward a generic point Pext? If P=[x,y,z] is a mesh point,  C=&lt;br&gt;
&amp;gt; [x0,y0,z0] is the center of mass and N is the surface normal at point&lt;br&gt;
&amp;gt; P. Pext =[x_ext,y_ext,z_ext] is a generic point in the space. Pext is&lt;br&gt;
&amp;gt; NOT a point  of the mesh. I'm interested in computing the surface&lt;br&gt;
&amp;gt; tangent pointing from P toward the projection of Pext on the tangent&lt;br&gt;
&amp;gt; PLANE (at point P).&lt;br&gt;
&amp;gt; .......&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;It's done just the same as with your center of mass.  It works for any point other than one along the line of the normal line through P.  This assumes you know the coordinates of this generic point, Pext.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;You don't need to fool around with the projection of Pext onto the tangent plane.  The cross(cross(N,Pext-P),N) takes care of that.  The inner cross(N,Pext-P) will yield a vector in the tangent plane and at right angles to the direction of that projection.  The second cross product&lt;br&gt;
&lt;br&gt;
&amp;nbsp;cross(cross(N,Pext-P),N) &lt;br&gt;
&lt;br&gt;
then gives the desired vector in the tangent plane in the direction of that projection.  The cross product is a marvelous tool to use for such problems as this in three-dimensional space.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;If you need projection P2, in and of itself, you can do this&lt;br&gt;
&lt;br&gt;
&amp;nbsp;P2 = Pext - dot(Pext-P,N)/dot(N,N)*N;&lt;br&gt;
&lt;br&gt;
Roger Stafford</description>
    </item>
  </channel>
</rss>
