hyades.Camera.CreateCameraMatrix C# (CSharp) Method

CreateCameraMatrix() public static method

public static CreateCameraMatrix ( Vector3 &rotation, Matrix &matrix ) : void
rotation Vector3
matrix Matrix
return void
        public static void CreateCameraMatrix(ref Vector3 rotation, out Matrix matrix)
        {
            float a = (float)Math.Cos(rotation.X);
            float b = (float)Math.Sin(rotation.X);

            float c = (float)Math.Cos(rotation.Y);
            float d = (float)Math.Sin(rotation.Y);

            float e = (float)Math.Cos(rotation.Z);
            float f = (float)Math.Sin(rotation.Z);

            matrix = new Matrix();
            matrix.M11 = (c * e);
            matrix.M12 = (c * f);
            matrix.M13 = -d;
            matrix.M21 = (e * b * d - a * f);
            matrix.M22 = ((e * a) + (f * b * d));
            matrix.M23 = (b * c);
            matrix.M31 = (e * a * d + b * f);
            matrix.M32 = -(b * e - f * a * d);
            matrix.M33 = (a * c);
            matrix.M44 = 1;
        }

Same methods

Camera::CreateCameraMatrix ( Vector3 &rotation, Vector3 &position, Matrix &matrix ) : void