unity 小知识 [随时更新]


        //旋转矩阵
        var mat = Matrix4x4.Rotate(Quaternion.Euler(new Vector3(90, 90, 0)));
        Debug.Log(mat *Vector3.one+"\n"+mat);
        
        //缩放矩阵
        mat = Matrix4x4.Scale(new Vector3(5, 5, 5));
        Debug.Log(mat * new Vector3(7, 2, 2) + "\n" + mat);

        //平移矩阵
        mat = Matrix4x4.Translate(new Vector3(5, 5, 5));
        Debug.Log(mat.MultiplyPoint(new Vector3(2,2,2)) + "\n" + mat);


猜你喜欢

转载自blog.csdn.net/qq_17813937/article/details/79950008