如何计算切线和双切向量
我在three.js中加载了纹理,然后传递给着色器。在顶点着色器中,我计算法线,然后将uv向量保存到变量中。 <script id="vertexShader" type="x-shader/x-vertex"> varying vec3 N,P; varying vec2 UV; void main() { gl_Position= projectionMatrix * modelViewMatrix * vec4(position,1.0); P= position; N= normalMatrix * vec3(normal); UV= uv; } </script> <script id="fragmentShader" type="x-shader/x-fragment"> varying vec3 N,P; varying vec2 UV; uniform sampler2D texture; void main() { gl_FragColor= texture2D(texture,UV); } </script> 如何计算T和B向量?