After enabling the "vertexTangentsHelper" feature in THREE.js, I've noticed that the tangents on various geometries appear to be incorrect.
I'm questioning whether these tangents are being miscalculated (possibly due to my shader output) or if there is a flaw in the "vertexTangentsHelper" function itself.
From what I understand, vertex tangent vectors should align with the "u" direction of the "uv" map and be perpendicular to the normal and bitangent of the vertex. I have attached some screenshots below to better illustrate my inquiry:
The first image demonstrates CORRECT tangents displayed on a mesh generated using "THREE.PlaneGeometry". All tangents point in the same consistent direction. (The mesh dimensions are 40 x 40 with 4 height segments and 4 width segments, and the tangents are 10 units in length.)
The second image highlights INCORRECT tangents on a mesh built with "THREE.BoxGeometry". The tangents along the edges do not align with those on their respective faces. (The mesh dimensions are 40 x 40 x 40 with 4 height segments and 4 width segments for each face, and again, the tangents measure 10 units.)
What could be causing this inconsistency? Is there an issue within the "computeTangents" function, the "VertexTangentsHelper" function, or perhaps something else I haven't considered? My version of three.js is re70.