COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### how to compute the tangent space of the mesh

• Follow

```hello everyone:
i want to do some brdf lighting in the local coordinate system(tangent
space) of every vertex. i find that all the algorithm(for mesh not
parametric surface) are need the vertex coordinate, norma vector, and
texture coordinate. i can not understand what the texture coordinate
mean. My question is that if there is a mesh model, such as a teapot
without texture mapping, how can i compute its vertexs' tangent
space.
Thanks a lot.

```
 0
Reply hy7646 (3) 5/20/2007 1:48:38 AM

```"iShan" <hy7646@gmail.com> wrote in message
> My question is that if there is a mesh model, such as a teapot
> without texture mapping, how can i compute its vertexs' tangent
> space.

Compute vertex normals, say, by computing at each vertex
an average (or weighted average) of the face normals of
all faces that share that vertex.  You have a vertex V and
a vertex normal N, so the tangent space is the plane
Dot(N,X-V) = 0.

If you need specific tangent vectors, you have infinitely
many pairs of orthogonal vectors to choose from.  The
challenge is to try to choose them so that the "tangent
field" is smoothly varying.  You can estimate the curvature
and metric tensors at each vertex, so it is possible to
estimate the principal directions at the vertices.  These
are good candidates for a smooth field, although you must
beware of "umbilic points".  Surfaces with the topology of
a sphere (genus 0) are also problematic, since it is impossible
mathematically to construct a continuous tangent vector
field on a sphere where the vectors are all unit length.

--
Dave Eberly
http://www.geometrictools.com

```
 0

```On May 20, 1:32 pm, "Dave Eberly" <dNOSPAMebe...@usemydomain.com>
wrote:
> "iShan" <hy7...@gmail.com> wrote in message
>
>
> > My question is that if there is a mesh model, such as a teapot
> > without texture mapping, how can i compute its vertexs' tangent
> > space.
>
> Compute vertex normals, say, by computing at each vertex
> an average (or weighted average) of the face normals of
> all faces that share that vertex.  You have a vertex V and
> a vertex normal N, so the tangent space is the plane
> Dot(N,X-V) = 0.
>
> If you need specific tangent vectors, you have infinitely
> many pairs of orthogonal vectors to choose from.  The
> challenge is to try to choose them so that the "tangent
> field" is smoothly varying.  You can estimate the curvature
> and metric tensors at each vertex, so it is possible to
> estimate the principal directions at the vertices.  These
> are good candidates for a smooth field, although you must
> beware of "umbilic points".  Surfaces with the topology of
> a sphere (genus 0) are also problematic, since it is impossible
> mathematically to construct a continuous tangent vector
> field on a sphere where the vectors are all unit length.
>
> --
> Dave Eberlyhttp://www.geometrictools.com
do the isotropic brdf computing, the tangent plane is sufficient.
but do the anisotropic one, someone advised me to seek help from the
art designer, who can give the texture coordinate of all the vertex,
do you think this is a good method?

```
 0

```"iShan" <hy7646@gmail.com> wrote in message

> do the isotropic brdf computing, the tangent plane is sufficient.
> but do the anisotropic one, someone advised me to seek help from the
> art designer, who can give the texture coordinate of all the vertex,
> do you think this is a good method?

The construction that I mentioned for computing the tangent space
at a vertex uses information local to that vertex.  You need to know
vertex neighbors to estimate normals and tangents (and principal
curvatures and principal directions).  I also mentioned that once
you have the tangent space, you have infinitely many pairs of
tangent vectors to use for the local coordinate system at the vertex.

The assignment of texture coordinates to the vertices effectively
provides a parameterization of the surface, say, position is P(u,v) =
(x(u,v),y(u,v),z(u,v)), where u and v are the parameters.  This
allows you to create specific tangent vectors.  For example, you
can choose T1 = (dP/du)/|dP/du|.  If N is the unit-length vertex
normal, then the other tangent is T2 = Cross(N,T1).  T1 is chosen
based on how position varies with texture coordinate u.  Who
better than an artist to assign the texture coordinate?

--
Dave Eberly
http://www.geometrictools.com

```
 0

```On May 21, 11:27 pm, "Dave Eberly" <dNOSPAMebe...@usemydomain.com>
wrote:
> "iShan" <hy7...@gmail.com> wrote in message
>
>
> > do the isotropic brdf computing, the tangent plane is sufficient.
> > but do the anisotropic one, someone advised me to seek help from the
> > art designer, who can give the texture coordinate of all the vertex,
> > do you think this is a good method?
>
> The construction that I mentioned for computing the tangent space
> at a vertex uses information local to that vertex.  You need to know
> vertex neighbors to estimate normals and tangents (and principal
> curvatures and principal directions).  I also mentioned that once
> you have the tangent space, you have infinitely many pairs of
> tangent vectors to use for the local coordinate system at the vertex.
>
> The assignment of texture coordinates to the vertices effectively
> provides a parameterization of the surface, say, position is P(u,v) =
> (x(u,v),y(u,v),z(u,v)), where u and v are the parameters.  This
> allows you to create specific tangent vectors.  For example, you
> can choose T1 = (dP/du)/|dP/du|.  If N is the unit-length vertex
> normal, then the other tangent is T2 = Cross(N,T1).  T1 is chosen
> based on how position varies with texture coordinate u.  Who
> better than an artist to assign the texture coordinate?
>
> --
> Dave Eberlyhttp://www.geometrictools.com

ok, i know that. thanks very much.

```
 0

4 Replies
333 Views

Similiar Articles:

7/29/2012 6:26:00 AM