1、Affine transform:平行线变换平行线变换到平行线,但不保持长度和角度到平行线,但不保持长度和角度1000100010001),()(zyxzyxttttttTtTxyxy10000cossin00sincos00001)(xR10000cos0sin00100sin0cos)(yR1000010000cossin00sincos)(zR2cos1)(RtrTRR11000000000000)(zyxssssSExample:Scaling in a certain direction假设沿正交、右手系的矢量假设沿正交、右手系的矢量fx,fy,fz进行比例变换进行比例变换,则首先构
2、造矩阵则首先构造矩阵最后的变换为最后的变换为10000zyxfffFTFS(s)FFS(s)FX1Tzyzxxzppsppss),(100001000010001)(PHxz11xz11sHxz(s)由于由于|H|=1,|=1,故错切变换是一个故错切变换是一个保体积保体积的变换的变换t)T(RT(tRT(t)RXT(t)RXTzyxtrrrtrrrtrrr1111222120121110020100)(1000其逆矩阵的计算:xypolygonnormalxyincorrectxycorrect沿x方向比例缩放0.5Euler变换是一种直观直观的使一个物体(或摄像机)朝向一指定方向的有效方法。
3、其来源:瑞士大数学家Leonard Euler缺省视域方向:视线为z轴,头朝y轴Euler变换是三个矩阵的相乘E为一正交阵,其逆矩阵)()()(),(hprrphyxzRRRETzTxTyTyxzTRRRRRREE)(1xy-zpitchheadrollEuler变换:变换:Head,Pitch and Roll其它命名方式:其它命名方式:x-roll,y-roll,z-rollx-roll,y-roll,z-roll。在飞行仿真中,采用。在飞行仿真中,采用yawyaw而非而非headhead摇头摇头“No”点头点头左右摇晃身体左右摇晃身体2/p010)cos(0)sin()sin(0)cos
4、(010coshcossinhsin0sinhcoscoshsincoshsinsinhcos0sinhsincoshcos),2/,(hrhrhrhrrrrrrrrrrhE),()()()(222120121110020100rphhprfffffffffyxzERRRFhpphphprhrprhprhrhprhrprhprhrcoscossinsincoscossincossinsincoscossinsincoscossincossinsinsincoscossinsinsinsincoscosF 由于sin p=f21,f01/f11=-tan r,f20/f22=-tan h 故三个
5、欧拉参数的值为 h=atan2(-f20,f22)p=arsin(f21)r=atan2(-f01,f11)atan2(-f01,f11)无解。因010)cos(0)sin()sin(0)cos(hrhrhrhrFxyzrstxyzrstxyzrstMMTRx()srtssss/and if ),0,(and if ),0,(and if ),0(yzxzxyzyxyxzzxyxyzrrrrrrrrrrrrrrrrrrtTTtsrM)M(RMXxT222)cos1(cossin)cos1(sin)cos1(sin)cos1()cos1(cossin)cos1(sin)cos1(sin)cos1
6、()cos1(coszxzyyzxxzyyzyxyzxzyxxrrrrrrrrrrrrrrrrrrrrrRuq q和-q表示相同的旋转 q和r的复合旋转为rq10000)(1)()(0)()(1)(0)()()(1222222yxxwzyywzxxwzyzxzwyxywzxzwyxzyqqqsqqqqsqqqqsqqqqsqqsqqqqsqqqqsqqqqsqqsM10000)(21)(2)(20)(2)(21)(20)(2)(2)(21222222yxxwzyywzxxwzyzxzwyxywzxzwyxzyqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqMzwqqywqqxwq
7、qqqmmqqmmqqmm444011020021221)(4414)(24)(2222222222222222qMnqqqqqqqqqqqqqqqqstrwwzyxwwzyxzyxzyxqwqqzwqqywqqxqwqmm qqmm qqmm qq4 ,4 4 ,)(tr21011020021221M10 ;)(),(1tttqrqrqswwzzyyxxrqrqrqrqtttttcos10 ;sin)sin(sin)1(sin(),(slerp),(其中rqrqrqs4)log()log(exp1111iiiiiiiqqqqqba)-(1),2,slerp(),p(slerp(sler),(
8、squad1111ttttiiiiiiiiaaqqaaqq2)1(2),()1(21),(eeqwvtsqqvvtstsvtsRehehvevvhvvvhvvvhvhvevvhvvvhvvvhvhvezxzyyzxxzyyzyxyzxzyxx1)2(sin)2cos(1)2cos(1000000),(2222其中刚 体bones顶点混合folding(2/3,1/3)(1/3,2/3)前臂2/3,后臂1/3simple skin 0 1 ,)()(10110iniiiiniitt,其中PMuvertex blending 例子例子10000000001000010PxyzbtlrnxyzT(t
9、)xyzS(s)100020002000210002100201020011000020000200002)()(nfnfnfbtbtbtlrlrlrnfbtlrnfbtlrotTsSP10005.05.0000010000110001000200021,0nfnnfbtbtbtlrlrlroP+zxyqp投影平面投影平面z=-dxzz=-dpzpxqxqqp根据相似三角形法则:根据相似三角形法则:zyyzxxzxxppdqppdqpdpq 同理:0/100010000100001dpP1/10/100010000100001dpdppdpdpppppppdzyzxzzyxzyxppPqyxz(l,b,n)(r,t,n)Ppyxz0100200020002nffnnfnfbtbtbtnlrlrlrnpP 0100200020002nfnfnfnfbtbtbtnlrlrlrnpP 0100000200021,0nfnfnffbtbtbtnlrlrlrnpP