Ejemplo n.º 1
0
 /// <summary>
 /// Converts the first column of a matrix into a vertex.
 /// </summary>
 /// <param name="matrix">The matrix to convert.</param>
 /// <returns>A vertex version of the first column of the matrix.</returns>
 public static Vertex MatrixToVertex(Matrix matrix)
 {
     return new Vertex(matrix[0, 0], matrix[1, 0], matrix[2, 0], matrix[3, 0]);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Converts a vertex into a 4-hight, 1-width matrix.
        /// </summary>
        /// <param name="vertex">The vertex to convert</param>
        /// <returns>A Matrix[4, 1] version of the vertex.</returns>
        public static Matrix VertexToMatrix(Vertex vertex)
        {
            var matrix = new Matrix(4, 1);

            matrix[0, 0] = vertex.X;
            matrix[1, 0] = vertex.Y;
            matrix[2, 0] = vertex.Z;
            matrix[3, 0] = vertex.W;

            return matrix;
        }