Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
compute tangent vector to a 3d mesh

Subject: compute tangent vector to a 3d mesh

From: antonietta

Date: 20 Jan, 2009 13:07:21

Message: 1 of 4



I=B4m interested to compute the tangent normal of a 3D mesh at each
vertex given the normals.

I have a mesh, the coordinate of its center of mass and for each its
vertex I have already the normals. At each vertex I=B4m interested to
compute the tangent vector pointing toward the center of mass of the
mesh .

Any suggestions would be appreciated.

Subject: compute tangent vector to a 3d mesh

From: Roger Stafford

Date: 20 Jan, 2009 16:27:02

Message: 2 of 4

antonietta <mangomengo@gmail.com> wrote in message <de7daa1b-7618-44b9-8a01-b52355ab1b9d@r36g2000prf.googlegroups.com>...
>
> I=B4m interested to compute the tangent normal of a 3D mesh at each
> vertex given the normals.
>
> I have a mesh, the coordinate of its center of mass and for each its
> vertex I have already the normals. At each vertex I=B4m interested to
> compute the tangent vector pointing toward the center of mass of the
> mesh .
>
> Any suggestions would be appreciated.

  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

 cross(cross(N,C-P),N)

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.

  Look up 'cross' in the documentation to apply it to your mesh of points in a vectorized manner.

Roger Stafford

Subject: compute tangent vector to a 3d mesh

From: antonietta

Date: 22 Jan, 2009 19:25:59

Message: 3 of 4

Dear all and dear Roger,

Thanks for your previous posting ...
it has been really helpful, everything works perfectly now.

However, a new question come into my mind. ...It is pretty hard to
explain, but I'll try to be clear.

What about if I want to compute the surface tangent pointing from
point P toward a generic point Pext? If P=3D[x,y,z] is a mesh point, C=3D
[x0,y0,z0] is the center of mass and N is the surface normal at point
P. Pext =3D[x_ext,y_ext,z_ext] is a generic point in the space. Pext is
NOT a point of the mesh. I' m interested in computing the surface
tangent pointing from P toward the projection of Pext on the tangent
PLANE (at point P).In other words:
I guess I should first compute the surface tangent plane where point
P belongs,
next I should compute the projection (let's denote it as P2) of point
Pext into the tangent plane,
finally the tangent I am interested in should be something like the
segment P2-P.

Am I right?
Do you have any suggestions about how to code this in matlab?


Thanks.

Best Regards

Antonietta



On Jan 20, 6:27=A0pm, "Roger Stafford"
<ellieandrogerxy...@mindspring.com.invalid> wrote:
> antonietta<mangome...@gmail.com> wrote in message <de7daa1b-7618-44b9-8a0=
1-b52355ab1...@r36g2000prf.googlegroups.com>...
>
> > I=3DB4m interested to compute thetangentnormal of a 3Dmeshat each
> > vertex given the normals.
>
> > I have amesh, the coordinate of its center of mass and for each its
> > vertex I have already the normals. At each vertex I=3DB4m interested to
> > compute thetangentvector pointing toward the center of mass of the
> >mesh.
>
> > Any suggestions would be appreciated.
>
> =A0 At any point P=3D[x,y,z] with C=3D[x0,y0,z0] the center of mass, if N=
 is the normal vector and C-P the vector pointing to the center of mass fro=
m P, then
>
> =A0cross(cross(N,C-P),N)
>
> will be in the direction of the surfacetangenttoward the center of mass. =
=A0You will probably want to normalize it to a unit vector by dividing it b=
y its magnitude. =A0This works except in those cases where N points directl=
y to the center of mass, in which case thetangentdirection would be inheren=
tly indeterminate.
>
> =A0 Look up 'cross' in the documentation to apply it to yourmeshof points=
 in a vectorized manner.
>
> Roger Stafford

Subject: compute tangent vector to a 3d mesh

From: Roger Stafford

Date: 22 Jan, 2009 20:31:02

Message: 4 of 4

antonietta <mangomengo@gmail.com> wrote in message <41b15a45-2966-4691-9d5e-b4a8cf757605@x16g2000prn.googlegroups.com>...
> .......
> What about if I want to compute the surface tangent pointing from
> point P toward a generic point Pext? If P=[x,y,z] is a mesh point, C=
> [x0,y0,z0] is the center of mass and N is the surface normal at point
> P. Pext =[x_ext,y_ext,z_ext] is a generic point in the space. Pext is
> NOT a point of the mesh. I'm interested in computing the surface
> tangent pointing from P toward the projection of Pext on the tangent
> PLANE (at point P).
> .......

  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.

  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

 cross(cross(N,Pext-P),N)

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.

  If you need projection P2, in and of itself, you can do this

 P2 = Pext - dot(Pext-P,N)/dot(N,N)*N;

Roger Stafford

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us