transform_coord

Homogeneous (affine) coordinate transformation. More...

Modules

 transform_coord
 The C++ interface for affine coordinate transforms.
 
 af_transform_coord
 The C interface for affine coordinate transforms.
 

Detailed Description

Homogeneous (affine) coordinate transformation.

Using transformation matrices containing homogeneous coordinates,

Using transformation matrices containing homogeneous coordinates, translations can be seamlessly intermixed with all other types of transformations. The reason is that the real plane is mapped to the w = 1 plane in real projective space, and so translation in real Euclidean space can be represented as a shear in real projective space. Although a translation is a non-linear transformation in a 2-D or 3-D Euclidean space described by Cartesian coordinates, it becomes, in a 3-D or 4-D projective space described by homogeneous coordinates, a simple linear transformation (a shear).

When using affine transformations, the homogeneous component of a coordinate vector (normally called w) will never be altered. One can therefore safely assume that it is always 1 and ignore it. However, this is not true when using perspective projections.

The inputs to the transform_coord function are the vertex array of size m x n, where m is the number of points and n is dimensionality of the points, ie. if vertices are 3D then n is 3.

Each column of the vertex array represent a coordinate axis. The 0th column is x, 1st column is y, 2nd column is z, 3rd column is w.

The other input is the transformation matrix. This always need to be a square matrix of size 4x4 or less.

For more about homogeneous transforms, see: Affine Transformations