切线空间的计算

原帖地址

http://www.terathon.com/code/tangent.html

QP 0 = (uu 0 )T + (vv 0 )B ,

这行的意思是下面这个图

where T and B are tangent vectors aligned to the texture map, P 0 is the position of one of the vertices of the triangle, and (u 0 , v 0 ) are the texture coordinates at that vertex. The letter B stands for bitangent , but in many places it is stilled called binormal because of a mix-up in terms when tangent-space bump mapping first became widespread. (See “Bitangent versus Binormal” below.)

Suppose that we have a triangle whose vertex positions are given by the points P 0 , P 1 , and P 2 , and whose corresponding texture coordinates are given by (u 0 , v 0 ), (u 1 , v 1 ), and (u 2 , v 2 ). Our calculations can be made much simpler by working relative to the vertex P 0 , so we let

Q 1 = P 1P 0
Q 2 = P 2P 0

那么根据另外2点减去p0所得的向量

and

(s 1 , t 1 ) = (u 1u 0 , v 1v 0 )
(s 2 , t 2 ) = (u 2u 0 , v 2v 0 ).

We need to solve the following equations for T and B .

Q 1 = s 1 T + t 1 B
Q 2 = s 2 T + t 2 B

可以得出上面这个结论

 

由于Q1,Q2,s1,s2,t1,t2都是已知的 那么T,B 就可以求的出来 然后N = TXB

 

求出来的就是切线空间的左边

 

当normalmap是已知的时候,只要求逆就可以找到

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值