Matrix44DTransformPosition Method |
Namespace: DigitalRune.Mathematics.Algebra
By using homogeneous coordinates 4 x 4 matrices can be used to define affine transformations or projective transformations in 3D space. When a 3D vector is given, the vector can have multiple meanings.
Position Vectors: A position vector identifies a point in 3D. Use TransformPosition(Vector3D) to transform position vectors. This method interprets the given Vector3D as a vector (x, y, z, 1) in homogeneous coordinates. The position vector is transformed by multiplication with the 4 x 4 matrix.
Direction Vectors: A direction vector (or displacement vector) defines a direction and length in 3D. Use TransformDirection(Vector3D) to transform direction vectors. This method interprets the given Vector3D as a vector (x, y, z, 0) in homogeneous coordinates. The direction vector is transformed by multiplication with the upper, left 3 x 3 corner of the transformation matrix.
Tangent Vectors: A tangent vector (surface tangent) defines a tangential direction at a point on a surface. They can be treated similar to direction vectors. Use TransformDirection(Vector3D) to transform tangent vectors and binormals vectors.
Normal vectors: A normal vector (surface normal) is a vector that is perpendicular to the tangent plane of a given point on a surface. In differential geometry normal vectors are "tangent covectors" or "cotangent vectors". They need to be treated differently than direction vectors or tangent vectors. Use TransformNormal(Vector3D) to transform normal vectors. A normal vector is transformed by multiplication with transpose of the inverse of the upper, left 3 x 3 corner of the transformation matrix.
(Note: If the transformation matrix contains only rotations, translations and uniform scalings then TransformDirection(Vector3D) can be used to transform normal vectors, which is faster.)