string TestDoubleMatrix() { double* a, * b, * x; a = GenerateMatrix(MatrixSize); b = GenerateMatrix(MatrixSize); x = MultiplyMatrix(a, b, MatrixSize, MatrixSize, MatrixSize); double result = x[MatrixSize / 2 * MatrixSize + MatrixSize / 2]; delete[] a; delete[] b; delete[] x; return printstring("%f", result); }
void cMatrixStack::GenerateMatrix(uintf _level) { if (_level == 0) return; sMatrixStackLevel *l = &level[_level]; sMatrixStackLevel *p = &level[l->parent]; if (!p->current) GenerateMatrix(l->parent); memcopy(l->mtx, level[l->parent].mtx, sizeof(Matrix)); movealongx(l->mtx, l->pivot.x); movealongy(l->mtx, l->pivot.y); movealongz(l->mtx, l->pivot.z); if (l->rotx) rotatearoundx(l->mtx, l->rotx); if (l->roty) rotatearoundy(l->mtx, l->roty); if (l->rotz) rotatearoundz(l->mtx, l->rotz); fixrotations(l->mtx); l->current = true; }