//------------------------------------------------------------------------- FKCW_3D_Node::FKCW_3D_Node() { m_mat=unitMat(); m_camera=NULL; m_lightSource=NULL; m_program=NULL; m_passUnifoCallback=NULL; }
//------------------------------------------------------------------------- FKCW_3D_Matrix4 FKCW_3D_Node::getRotation3D() { FKCW_3D_Matrix4 RMat=unitMat(); //replace left up 3x3 sub matrix of RMat with m_mat const int indexs[9]={0,1,2,4,5,6,8,9,10}; for(int i=0;i<9;i++){ int index=indexs[i]; RMat.setAt(index, m_mat.getAt(index)); } return RMat; }
void aPow(int p, double a[SIZE][SIZE], double x[SIZE][SIZE], int n) { double b[SIZE][SIZE]; if (p < 0) { printf("aPow: Error!\n"); } else if (p == 0) { unitMat(x, n); } else { copyMat(a, x, n); /* x <- a */ while (p > 1) { prod(a, x, b, n); copyMat(b, x, n); p--; } } }
bool isUnitMat(const Cc3dMatrix4&mat){ return isEqual(mat, unitMat()); }