Developer Documentation
Centre for Vision, Speech & Signal Processing
USER IN NAMESPACE AMMA TREE ROOT AMMA SEARCH AMMA HOME
 

  PUBLIC
HomTransMatC::HomTransMatC(void)
HomTransMatC::HomTransMatC(const HomTransMatC &)
HomTransMatC::HomTransMatC(const Matrix4d4C &)
HomTransMatC::HomTransMatC(RealT,RealT,RealT,RealT,RealT,RealT,RealT,RealT,RealT,RealT,RealT,RealT,RealT,RealT,RealT,RealT)
HomTransMatC::~HomTransMatC(void)
HomTransMatC::Dump(void) const
HomTransMatC::Inv(void)
HomTransMatC::Pos(void)
HomTransMatC::SetPos(Vector3dC &)
HomTransMatC::SetPos(RealT,RealT,RealT)
HomTransMatC::Perspective(void)
HomTransMatC::SetPerspective(Vector3dC &)
HomTransMatC::SetPerspective(RealT,RealT,RealT)
HomTransMatC::Scale(void)
HomTransMatC::SetScale(RealT)
HomTransMatC::ImportQuartern(QuarternC &)
HomTransMatC::ExportQuartern(void)
HomTransMatC::ExportRotVector(void)
HomTransMatC::ExportRotAngle(void)
HomTransMatC::ExportRotation(void)
HomTransMatC::ImportRotation(Vector3dC &)
HomTransMatC::operator=(const HomTransMatC &)
HomTransMatC::operator=(const Matrix4d4C &)
HomTransMatC::operator+(const HomTransMatC &)
HomTransMatC::operator-(const HomTransMatC &)
HomTransMatC::operator*(const HomTransMatC &)
HomTransMatC
 
include "amma/HomTransMatC.hh"
User Level:Default
Library:HoppeOpt
Example: regtool.cc
Section:default.Andrew Stoddart
In Scope:std

Comments:
----------------------------------------------------------------------------- *********************************** HomTransMatC **************** *********** ----------------------------------------------------------------------------- File Name : HomTransMatC.hh Author : Paris Lyritis Last Change : 04/11/1997 Synopsis : The HomTransMatC represents the 4x4 Homogeneous Transformation Matrix ----------------------------------------------------------------------------- Modifications : Class Description .LP Suppose that we have a fixed reference frame (OXYZ) which contains a moving (rotating or translating) frame (OUVW). The later frame may move with respect to itself or to the OXYZ.Let me clarify that we are talking about right- handed frames. .LP Homogeneous Transformation Matrices (Htm) help us map coordinates from one frame to another. They are particularly helpful when we know the position of a point in a local frame, which (frame) moves with respect to some fixed world frame. Usually OUVW is attached on a rigid body which is expressed with local coordinates. The vector/point (pu,pv,pw)of the rigid body can be transformed to (px,py,pz), by multiplying the appropriate Htm with it. .LP Usually such a vector is represented with a Vector3dC, but the provision for a Vector4dC representation has also been made. We can express a 3D vector (x,y,z) in homogeneous coordinates, just by adding a scale value s, ie. (x/s,y/s,z/s,s). When a Vector3dC is used we add to it a scale equal to 1. .LP So, we use the HomTransMatC to describe a (rotation/translation/perspective/scale). We can store that information by storing the HomTransMatC itself. Extracting the translation from such a matrix is easy. But how can we extract the angles from an Htm ? In this case we use the QuarternC to extract the rotation angles of our HomTransMatC. We wanted to avoid keeping a dual representation, i.e. three additional RealT variables in the HomTransMatC to denote the angles (which angles and in what sequence?) Instead, every time we want to find the rotation that an HomTransMatC represents, we set a QuarternC with the rotation submatrix, and we export from it the vector and the angle of rotation about it. .LP Basically the HomTransMatC class is an "enchanced" Matrix4d4C class. Most os its overloaded operators are just executing the according Matrix4d4C operators.

Variables:
Matrix4d4C T;
The class data is public to allow full access to its member functions. We suppose that Matrix4d4C is sufficiently "protected" by itself and that the programmer is "carefull?". Constructors ------------

Methods:
HomTransMatC()
Null constructor

HomTransMatC(const HomTransMatC &)
Copy constructor

HomTransMatC(const Matrix4d4C &)
Constructor from a Matrix4d4C

HomTransMatC(RealT,RealT,RealT,RealT,RealT,RealT,RealT,RealT,RealT,RealT,RealT,RealT,RealT,RealT,RealT,RealT)

~HomTransMatC()
Destructor Access Functions ----------------

void Dump() const
Outputs the contents of the matrix to stdout in a comprehensive format

HomTransMatC Inv()
Returns an HomTransMatC which is the inverse of this Htm. It does not modify this instance. Additionally, this is not a typical 4x4 inverse function and therefore cannot be applied to derive the inverse of any 4x4 matrix. It only works for Htms with their perspective sub-matrix equal to [0 0 0] and their scale equal to [1]. So, the result is hard-coded to return an Htm with such characteristics.

Vector3dC Pos()
Returns the position vector which is described by the 3x1 upper right sub-matrix of this Htm.

void SetPos(Vector3dC &)

void SetPos(RealT,RealT,RealT)
Sets the position sub-matrix of the Htm.

Vector3dC Perspective()
Returns the perspective vector which is the lower-left 1X3 submatric

void SetPerspective(Vector3dC &)

void SetPerspective(RealT,RealT,RealT)
Sets the perspective sub-matrix of the Htm. Should be kept [0 0 0]

RealT Scale()
Returns the perspective vector which is the lower-left 1X3 submatric Normally, should be [0 0 0]

void SetScale(RealT)
Sets the scale element of the Htm. (Normally should be 1)

void ImportQuartern(QuarternC &)
Sets the rotation sub-matrix from a given quarternion

QuarternC ExportQuartern()
Returns the quaternion which describes this Htm's rotation.

Vector3dC ExportRotVector()
Exports the unit vector of the rotation axis.

RealT ExportRotAngle()
Exports the angle of rotation (in degrees) about the previous rotation axis. I found that the accuracy depends on the rad2deg canstant defined in HomTransMatC.cc

Vector3dC ExportRotation()
Exports the represented rotation in the form of a single vector r(rx,ry,rz). Recall, that if |r| is the length of the vector (i.e. sqrt(rx^2+ry^2+rz^2) then the rotation is theta=|r|, about a unit vector u=(rx,ry,rz)/|r|.

void ImportRotation(Vector3dC &)
Import the rotation represented by the given vector, into the rot. sub-matrix. Rotation expressed in degrees. Overloaded Operators --------------------

HomTransMatC & operator=(const HomTransMatC &)
Assignment

HomTransMatC & operator=(const Matrix4d4C &)
Assignment to a Matrix4d4C

HomTransMatC operator+(const HomTransMatC &)
HomTransMatC + HomTransMatC = HomTransMatC (Breaks down to Matrix4d4C +)

HomTransMatC operator-(const HomTransMatC &)
HomTransMatC - HomTransMatC = HomTransMatC (Breaks down to Matrix4d4C -)

HomTransMatC operator*(const HomTransMatC &)
HomTransMatC * HomTransMatC = HomTransMatC (Breaks down to Matrix4d4C *)


Programmer:Andrew Stoddart, Documentation by CxxDoc: Tue Mar 20 10:49:27 2001