矩阵:Matrix4x4
namespace UnityEngine
{
public struct Matrix4x4
{
public float m00;
public float m10;
public float m20;
public float m30;
public float m01;
public float m11;
public float m21;
public float m31;
public float m02;
public float m12;
public float m22;
public float m32;
public float m03;
public float m13;
public float m23;
public float m33;
}
}
变换后点的(X’,Y’,Z’)= (x,y,z) * ( 4*4矩阵)
scale:模型的大小变化,在透视投影中用来产生场景深度效果
public static Matrix4x4 Scale(Vector3 v)
{
return new Matrix4x4
{
m00 = v.x,
m01 = 0f,
m02 = 0f,
m03 = 0f,
m10 = 0f,
m11 = v.y,
m12 = 0f,
m13 = 0f,
m20 = 0f,
m21 = 0f,
m22 = v.z,
m23 = 0f,
m30 = 0f,
m31 = 0f,
m32 = 0f,
m33 = 1f
};
}
</