Beispiel #1
0
        public Matrix4 GetViewMatrix(Matrix4 globalModelMatrix)
        {
            Vector4 lookat = new Vector4(Vector3.UnitZ, 1);
            Vector4 up = new Vector4(Vector3.UnitY, 1);

            lookat = lookat.ApplyOnVector(globalModelMatrix);

            up = up.ApplyOnVector(globalModelMatrix);

            var position = Vector3.Zero.ApplyOnPoint(globalModelMatrix);
            return MatrixHelper.LookAt(position, position + lookat.Xyz, up.Xyz);
        }