Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

Matrix Class Reference
[GLT Math]

4x4 Matrix More...

#include <matrix4.h>

List of all members.

Public Methods

 Matrix ()
 Default constructor.

 Matrix (const Matrix &matrix)
 Copy constructor.

 Matrix (const float *matrix)
 Construct from array.

 Matrix (const double *matrix)
 Construct from array.

 Matrix (const unsigned int glMatrix)

 Matrix (const std::string &str)
 Construct from string.

Matrix & operator= (const Matrix &)
 Assignment operator.

Matrix operator * (const Matrix &) const
 Matrix multiplication.

Matrix & operator *= (const Matrix &)
 In-place matrix multiplication.

Vector operator * (const Vector &) const
 Matrix transformation of 3D vector.

void reset ()
 Reset to identity matrix.

void identity ()
 Reset to identity matrix.

bool isIdentity () const
 Is this matrix identity?

double & operator[] (const int i)
 Access i'th element of matrix.

const double & operator[] (const int i) const
 Access i'th element of matrix.

 operator double * ()
 Access as array.

 operator const double * () const
 Access as array.

bool operator== (const Matrix &) const
 Equality operator.

bool operator!= (const Matrix &) const
 Not-equal operator.

Matrix inverse () const
 Calculate matrix inverse.

Matrix transpose () const
 Calculate matrix transpose.

UnMatrix unmatrix () const
 Calculate unmatrix.

double det () const
 Calculate matrix determinant.

void glMultMatrix () const
 Mult current OpenGL matrix.

void glLoadMatrix () const
 Load current OpenGL matrix.

std::ostream & writePov (std::ostream &os) const
 Write matrix in Povray format.


Matrix matrixScale (const double sf)
 Uniform scale transformation matrix.

Matrix matrixScale (const Vector sf)
 Non-uniform scale transformation matrix.

Matrix matrixTranslate (const Vector trans)
 Translation transformation matrix.

Matrix matrixTranslate (const real x, const real y, const real z)
 Translation transformation matrix.

Matrix matrixRotate (const Vector axis, const double angle)
 Axis rotation transformation matrix.

Matrix matrixRotate (const double azimuth, const double elevation)
 Rotation transformation matrix.

Matrix matrixOrient (const Vector &x, const Vector &y, const Vector &z)
 Orientation transformation matrix.

Matrix matrixOrient (const Vector &direction, const Vector &up)
 Orientation transformation matrix.

std::ostream & operator<< (std::ostream &os, const Matrix &m)
 Write a matrix to a text output stream.

std::istream & operator>> (std::istream &is, Matrix &m)
 Read a matrix from a text output stream.

Detailed Description

4x4 Matrix

Nigel Stewart, RMIT (
Nice pictures and explanation for 4x4 transformation matrices.

Definition at line 49 of file matrix4.h.

Friends And Related Function Documentation

Matrix matrixRotate const Vector    axis,
const double    angle

Axis rotation transformation matrix.

axis  Axis of rotation
angle  Angle in degrees

Definition at line 310 of file matrix4.cpp.

Matrix matrixRotate const double    azimuth,
const double    elevation

Rotation transformation matrix.

azimuth  East-West degrees
elevation  North-South degrees

Definition at line 348 of file matrix4.cpp.

Matrix matrixOrient const Vector   x,
const Vector   y,
const Vector   z

Orientation transformation matrix.

x  New orientation for +x
y  New orientation for +y
z  New orientation for +z

Definition at line 380 of file matrix4.cpp.

Matrix matrixOrient const Vector   direction,
const Vector   up

Orientation transformation matrix.

direction  New orientation for +z
up  New orientation for +y

Definition at line 406 of file matrix4.cpp.

The documentation for this class was generated from the following files:
Generated on Tue Nov 5 11:11:49 2002 for GLT by doxygen1.2.18