Quaternion计算3D物体旋转⾓度
在3D程序中,通常⽤quaternion来计算3D物体的旋转⾓度,与Matrix相⽐,quaternion更加⾼效,占⽤的储存空间更⼩,此外也更便于插值。在数学上,quaternion表⽰复数w+xi+yj+zk,其中i,j,k都是虚数单位。
可以把quaternion看做⼀个标量和⼀个3D向量的组合。实部w表⽰标量,虚部表⽰向量标记为V,或三个单独的分量(x,y,z)。所以quaternion可以记为[w,V]或[ w,x,y,z]。对quaternion最⼤的误解在于认为w表⽰旋转⾓度,V表⽰旋转轴,正确的理解应该是w与旋转⾓度有关,v与旋转轴有关。
降邪unity3d⾥的Quaternion⾃带了⼀些⽅便的改变形式:
Creates a rotation which rotates angle degrees around axis.
撩女生的话Creates a rotation which rotates from fromDirection to toDirection.
Creates a rotation that looks along forward with the the head upwards along upwards
飞蚊症最佳治疗方法
二月初惊见草芽Spherically interpolates from towards to by t.
钟小艾背景Interpolates from towards to by t and normalizes the result afterwards.擅长的反义词
Returns the Inver of rotation.
烟雨长廊
宝宝喜欢趴着睡Returns the angle in degrees between two rotations a and b.
Returns a rotation that rotates x degrees around the x axis. y degrees around the y axis. z degrees around the z axis.