How to compute dPdu, dPdv for triangles

For triangles, as well as other planar shapes, there's an affine mapping from parametric space to object space, said M.

In parametric space, we know the parametric coordiantes for 3 triangle corners are (u0, v0), (u1, v1), (u2, v2) respectively.

While in object space, the 3D coordinates for 3 triangle corners are P0, P1, P2.

So with the mapping M, we can transform the difference vectors (du1, dv1) = (u1 - u0, v1 - v0), and (du2, dv2) = (u2 - u0, v2 - v0) to the difference vectors in object space, said dP1 = P1 - P0, dP2 = P2 - P0, dP1, dP2 are 3D vectors.

The equation looks like:

(dP1)    (du1 dv1)

|     | = |           | * M

(dP2)    (du2 dv2)

Assume M = (K1, K2), K1, K2 are 3D vectors, the equation can be rewritten with:

(dP1)    (du1 dv1)   (K1)

|     | = |           | * |   |       (1)

(dP2)    (du2 dv2)   (K2)

Solve K1, K2, we get:

(K1)         (du1 dv1)   (dP1)

|    | = INV|           | * |    |

(K2)         (du2 dv2)   (dP2)

Now we need to understand what are K1, K2, using equation (1) we have:

dPdu * du = (du 0) * (K1) = K1 * du, thus we know dPdu = K1

                               (K2)

Similarly,

dPdv * dv = (0 dv) * (K1) = K1 * dv, thus we know dPdv = K2

                               (K2)

Finally we got:

(dPdu)         (du1 dv1)   (dP1)

|       | = INV|           | * |    |

(dPdv)         (du2 dv2)   (dP2)

Which satisfies:

P(u + du, v) = P(u, v) + dPdu * du

P(u, v + dv) = P(u, v) + dPdv * dv

 

posted on 2011-09-09 14:46 Len3d 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/len3d/archive/2011/09/09/2172528.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值