//You can use two starsvoid Identity(float** matrix){matrix[0][0] = matrix[1][1] = matrix[2][2] = matrix[3][3] = matrix[4][4] = 1.0f;//zero the rest...}//or a referencetypedef float mymatrix[4][4];void Identiry(mymatrix& matrix){matrix[0][0] = matrix[1][1] = matrix[2][2] = matrix[3][3] = matrix[4][4] = 1.0f;//zero the rest...}float** Fiddle(float** matrix){float** matI;matI = (float**)new float[4];for(long j=0;j<4;j++) matI[j] = new float[4];return matI;//delete like thisfor(j=0;j<4;++) delete[] matI[j];delete[] matI;}/*though that uses 20bytes not 16 like if you used an array mapping function on a float[16] & returned a float* like some matrix stuff is done... classes are nice because you can overload operators, like (int,int) so you can use 16bytes & still index the like D3DXMATRIX */matrix(1,1) = 1.0f;
Edited by - Magmai Kai Holmlor on July 11, 2000 12:22:17 AM