Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: How to Calculate tangent ?

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2012
    Posts
    7

    How to Calculate tangent ?

    Hello to all,

    I try to understand the normal map

    Problem, I try to calculate the tangent I have to send per vertex.

    How to calculate it?

    example with a triangle in front :



    Position Normal Tangente
    vertex 1 -1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, ?, ? , ?,
    vertex 2 -1.0f,-1.0f, 1.0f, 0.0f, 0.0f, 1.0f, ?, ? , ?,
    vertex 3 1.0f, -1.0f, 1.0f, 0.0f, 0.0f, 1.0f, ?, ? , ?,

    Thanks in advance !
    Last edited by PiouPiou; 07-26-2013 at 10:41 AM.

  2. #2
    Junior Member Regular Contributor
    Join Date
    Nov 2012
    Location
    Bremen, Germany
    Posts
    149
    I can just give you a short description what needs to be done:
    What you need to do is to find a mapping from the space defined by the triangle into the space used by the normalmap-texture - or better said: the other way around.
    From the texture-coordinates at the vertices and the vertices themselves you can derive where along the X- and Y-axes of the normalmap-texture-space go in the triangle-texture-space.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    @PiouPiou: For the basics, check this* out. When you got the basic math right, check this out.

    * Lengyel, Eric. “Computing Tangent Space Basis Vectors for an Arbitrary Mesh”. Terathon Software 3D Graphics Library, 2001.

  4. #4
    Junior Member Newbie
    Join Date
    Apr 2012
    Posts
    7
    Quote Originally Posted by thokra View Post
    @PiouPiou: For the basics, check this* out. When you got the basic math right, check this out.

    * Lengyel, Eric. “Computing Tangent Space Basis Vectors for an Arbitrary Mesh”. Terathon Software 3D Graphics Library, 2001.
    thank you I will read the paper. I would say to you if I understood or not;-)

  5. #5
    Junior Member Newbie
    Join Date
    Apr 2012
    Posts
    7
    many thanks to all after my holliday it' works ;-)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •