Make your own free website on Tripod.com

Contents Turbed: A Turbulent Behavior Development System News
In file matrix4x4.hpp:

class Matrix

4x4 Matrix class for affine transformations

Public Fields

ofloat m[4][4]
matrix data

Public Methods

o Matrix()
Default constructor M=I
o Matrix(Matrix &nm)
Copy contructor
ovoid setMatrix(Matrix &nm)
Copy data from another matrix
ovoid setMatrixData(float nm[4][4])
Set matrix from bidimentional array
ovoid setIdentity()
M=I
ovoid setIdentity(Matrix &mo)
Set identity of another matrix !!??
ovoid operator=(float d)
Set all matrix with a specific value
ovoid operator=(Matrix& nm)
Assign value from another matrix
oint operator==(Matrix& nm)
Comparision operator
ovoid Invert(Matrix &mout)
Invert this matrix
ovoid Invert(Matrix mo, Matrix &mout)
Invert a matrix and return the inverted new matrix
ofloat Det()
Determinant of this matrix
ofloat Det(Matrix mo)
Determinant of a matrix
ovoid Adjoint(Matrix &mout)
return the adjoint matrix of this one
ovoid Adjoint(Matrix &mo, Matrix &mout)
return an adjoint matrix
ovoid multMatPoint(float vin[], float vout[])
returns M*P (P= column vector)
ovoid multPointMat(float vin[], float vout[])
returns P*M (P= row vector)
ovoid multMatMat(Matrix m2, Matrix &mout)
M3=M*M2
ovoid multMatMat(Matrix m1, Matrix m2, Matrix &mout)
M3=M1*M2
ovoid multMatMatTrans(Matrix m1, float v[], Matrix &mout)
M*Transformation matrix (vector)
ovoid multMatMatTrans(float v[4], Matrix &mout)
this matrix * Transformation matrix (vector)
ovoid multMatMatScal(Matrix m1, float v[], Matrix &mout)
M* Scale matrix (vector)
ovoid multMatMatScal(float v[4], Matrix &mout)
this matrix * Scale Matrix (vector)
ovoid multMatMatRot(Matrix m1, float v[], Matrix &mout)
M* rotation matrix (vector=angle,axis(x,y,z))
ovoid multMatMatRot(float v[], Matrix &mout)
this matrix* rotation matrix (vector=angle,axis(x,y,z))
ovoid Print()
print this matrix on the stdout
o ~Matrix()
class destructor

Private Methods

ofloat Det2x2(float a1, float b1, float a2, float b2)
2x2 sub-matrix determinant
ofloat Det3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
3x3 sub-matrix determinant


Documentation

4x4 Matrix class for affine transformations. order is row mayor (stdc internal=OGL ordering (row major order) mat[row][column] ie:
Opengl style transformation matrix : M*v           
| 1 0 0 x |   V1
| 0 1 0 y | * V2 
| 0 0 1 z |   V3
| 0 0 0 1 |   1 


My style transformation matrix : v*M 
. [ V1 V2 V3 1] * | 1 0 0 0 | 
.                 | 0 1 0 0 |  
.                 | 0 0 1 0 |
.                 | x y z 1 |  

To convert from MyMatrix to Ogl the eval use tranpose matrix!!!


This class has no child classes.
Author:
Daniel Barrero

Alphabetic index HTML hierarchy of classes or Java


This software was originally written by Daniel Barrero at the IRIT's Equipe Synthèse d'Images
contact: barrero@irit.fr

Generated by doc++