hwMatrix - HoverWare matrix utilities
#include "hw.h" void hwIdentity( hwFloat res[4][4] ) void hwScale( hwFloat res[4][4], hwFloat sx, hwFloat sy, hwFloat sz ) void hwRotateX( hwFloat res[4][4], hwFloat angle ) void hwRotateY( hwFloat res[4][4], hwFloat angle ) void hwRotateZ( hwFloat res[4][4], hwFloat angle ) void hwRotateAxis( hwFloat res[4][4], hwFloat angle, hwFloat axis[3] ) void hwMatMult( hwFloat res[4][4], hwFloat a[4][4], hwFloat b[4][4] ) void hwTransform( hwFloat mat[4][4], hwFloat point[3] ) hwInt32 hwInvertMat( hwFloat mat[4][4], hwFloat dst[4][4] ) void hwDisplay->pushMatrix( hwDisplay disp, hwFloat mat[4][4] ) void hwDisplay->popMatrix( hwDisplay disp )
These routines manipulate 4x4 transformations useful as modelling transforms in HoverWare. Their full descriptions are as follows:
The model matrix affects all graphics primitives in HoverWare, including cameras and lights. Note that pushMatrix() and popMatrix() are actually methods in the hwDisplay class and need to be called through an instance of hwDisplay.
/* Push a rotation about X on the matrix stack */ hwFloat mat[4][4]; hwRotateX( mat, 30.0 * M_PI / 180.0 ); disp->pushMatrix( disp, mat );