Well, if you are still reading this entry, here you have it. Fresh out of my brain, and it even compiles!
#ifndef MATRIX_4_X_3_H#define MATRIX_4_X_3_H#include "vectormath.h"class Matrix4x3{public: float m11,m12,m13; float m21,m22,m23; float m31,m32,m33; float tx,ty,tz; Matrix4x3 operator *(const Matrix4x3 &a) const { Matrix4x3 d; d.m11 = (m11 * a.m11) + (m12 * a.m21) + (m13 * a.m31); d.m12 = (m11 * a.m12) + (m12 * a.m22) + (m13 * a.m32); d.m13 = (m11 * a.m13) + (m12 * a.m23) + (m13 * a.m33); d.m21 = (m21 * a.m11) + (m22 * a.m21) + (m23 * a.m31); d.m22 = (m21 * a.m12) + (m22 * a.m22) + (m23 * a.m32); d.m23 = (m21 * a.m13) + (m22 * a.m23) + (m23 * a.m33); d.m31 = (m31 * a.m11) + (m32 * a.m21) + (m33 * a.m31); d.m32 = (m31 * a.m12) + (m32 * a.m22) + (m33 * a.m32); d.m33 = (m31 * a.m13) + (m32 * a.m23) + (m33 * a.m33); return d; } Matrix4x3() {} ~Matrix4x3() {} void Identity() { m11 = m22 = m33 = 1.0f; m12=m13=m21=m23=m31=m32=m33 = 0.0f; tx=ty=tz = 0.0f; } void RotateX(float thetaX) { m22 = cos(thetaX); m23 = sin(thetaX); m32 = -sin(thetaX); m33 = cos(thetaX); } void RotateY(float thetaY) { m11 = cos(thetaY); m13 = -sin(thetaY); m31 = sin(thetaY); m33 = cos(thetaY); } void RotateZ(float thetaZ) { m11 = cos(thetaZ); m12 = sin(thetaZ); m21 = -sin(thetaZ); m22 = cos(thetaZ); } void Translate(Vector3 vec) { tx = vec.x; ty = vec.y; tz = vec.z; } void Copy(const Matrix4x3 &a) { m11 = a.m11; m12 = a.m12; m13 = a.m13; m21 = a.m21; m22 = a.m22; m23 = a.m23; m31 = a.m31; m32 = a.m32; m33 = a.m33; }};#endif // MATRIX_4_X_3_H