#include <AffineTransform.h>
Public Member Functions | |
AffineTransform (void) | |
creates a zero instance of AffineTransform | |
AffineTransform (const Vector4 &r1, const Vector4 &r2, const Vector4 &r3, const Vector4 &r4) | |
creates an instance of AffineTransform from row vectors r1,r2,r3,r4 | |
AffineTransform (const AffineTransform &vector) | |
copy constructor | |
~AffineTransform (void) | |
AffineTransform instance destructor. | |
Real & | operator() (int row, int col) |
component reference accessor | |
Real | operator() (int row, int col) const |
component accessor | |
Vector4 | row (int i) const |
row accessor | |
Vector4 | column (int j) const |
column accessor | |
AffineTransform & | operator= (const AffineTransform &u) |
copy operator | |
void | translate (Real tx, Real ty, Real tz) |
translation concatenation operator | |
void | scale (Real sx, Real sy, Real sz) |
scaling concatenation operator | |
void | rotate (char axis, Real angle) |
rotation concatenation operator | |
Vector4 | transform (const Vector4 &w) |
the transformation operator | |
Static Public Member Functions | |
static AffineTransform | makeIdentity () |
an identity transformation factory method | |
static AffineTransform | makeTranslation (Real tx, Real ty, Real tz) |
a translation transformation factory method | |
static AffineTransform | makeScaling (Real sx, Real sy, Real sz) |
a scaling transformation factory method | |
static AffineTransform | makeRotation (char axis, Real angle) |
a rotation trasnformation factory method |
This class implements a 4X4 affine transformation operator. We will use homogeneous coordinates for enabling basic transformations (including translation) of a point in R3 through m multiplication.
We will assume multiplication as u=M*v . For u as the result of v transformation by M :
A T M = P S
A - linear (3X3) block T - translation (3X1) block P - perspective (1X3) block S - scaling (1X1) block
taking a row x column order.
NOTE : the transform method specifically for Vector3 was replaced by a constructor of a Vector4 instance with w=1.0 .