   How to compute the TBN  space in dx9
  Hi,I want to get a Normal Mapping effect, but first I must compute the TBN for every vertex myself(I can not use D3DXComputeTangent() because of the format of my model).I got a expression about TBN:IF you have three points of a trangle:p1,p2,p3,  and u123,v123 are their UV. then:    (v3 - v1).(p2 - p1) - (v2 - v1).(p3 - p1)T = ---------------------------------------    (u2 - u1).(v3 - v1) - (v2 - v1).(u3 - u1)    (u3 - u1).(p2 - p1) - (u2 - u1).(p3 - p1)B = ---------------------------------------    (v2 - v1).(u3 - u1) - (u2 - u1).(v3 - v1)N = cross(T, B)now I have a question: if a point shares three or more trangles, how should I compute the right TBN vector for every vertex?  or I have made some mistakes on TBN?...thx!!   
This article on the subject might be of help. If I understand your question correctly, the way to calculate per-vertex tangents/normals is to simply average the triangle tangents/normals for each triangle the vertex is part of. This is explained in more detail in the linked article.;Quote:now I have a question: if a point shares three or more trangles, how should I compute the right TBN vector for every vertex? You compute a tangent for every vertex not triangle, you should have shared verticies with smoothed normal , so that sharing triangles get the same tangent at that point. In case of having different texture coordinate in some triangle of the point, the point is shared anyway so algorithm indexes the vertex with new coordinates .;  thank Johnn and remigius, I have got smoothed normals and you mean I just average the tangents which were computed for their own trangle ? I will have a try.   