row_major float4x4 mWorldViewProj;
//
float3 pos=mul(mWorldViewProj,vPosition);
对应指令为:
dp3 oPos.x, c0, v0
dp3 oPos.y, c1, v0
dp3 oPos.z, c2, v0
column_major float4x4 mWorldViewProj;
//
float3 pos=mul(vPosition,mWorldViewProj);
对应指令为:
dp3 oPos.x, v0, c0
dp3 oPos.y, v0, c1
dp3 oPos.z, v0, c2
原因是:
对于mul指令
Performs matrix multiplication between x and y.
If x is a vector, it treated as a row vector.
If y is a vector, it is treated as a column vector.
posted on 2007-09-14 11:51
Sherk 阅读(232)
评论(0) 编辑 收藏 引用