Esempio n. 1
0
    public static P3D_Matrix CreateMatrix(Vector2 position, Vector2 size, float angle)
    {
        P3D_Matrix matrix3 = P3D_Matrix.Translation(size.x * -0.5f, size.y * -0.5f);
        P3D_Matrix matrix4 = P3D_Matrix.Scaling(size.x, size.y);

        return(((P3D_Matrix.Translation(position.x, position.y) * P3D_Matrix.Rotation(angle)) * matrix3) * matrix4);
    }
Esempio n. 2
0
    public static P3D_Matrix CreateMatrix(Vector2 position, Vector2 size, float angle)
    {
        var t = P3D_Matrix.Translation(position.x, position.y);
        var r = P3D_Matrix.Rotation(angle);
        var o = P3D_Matrix.Translation(size.x * -0.5f, size.y * -0.5f);
        var s = P3D_Matrix.Scaling(size.x, size.y);

        return(t * r * o * s);
    }