Matrix 矩阵变换
1)OpenGL matrix
void CCadTransform::GetGLMatrix (double matrix[16]) const { /* OpenGL matrix is a 4x4 matrix in column-major order. Translate component is in last column. m_rotate is a 3x3 matrix in column-major order. */ // rotation matrix (3x3) matrix[0] = m_rotate[E_MAJOR_AXIS][X_AXIS] * m_scale[X_AXIS]; matrix[1] = m_rotate[E_MAJOR_AXIS][Y_AXIS] * m_scale[X_AXIS]; matrix[2] = m_rotate[E_MAJOR_AXIS][Z_AXIS] * m_scale[X_AXIS]; matrix[3] = 0.0; matrix[4] = m_rotate[E_MINOR_AXIS][X_AXIS] * m_scale[Y_AXIS]; matrix[5] = m_rotate[E_MINOR_AXIS][Y_AXIS] * m_scale[Y_AXIS]; matrix[6] = m_rotate[E_MINOR_AXIS][Z_AXIS] * m_scale[Y_AXIS]; matrix[7] = 0.0; matrix[8] = m_rotate[E_ALIGN_AXIS][X_AXIS] * m_scale[Z_AXIS]; matrix[9] = m_rotate[E_ALIGN_AXIS][Y_AXIS] * m_scale[Z_AXIS]; matrix[10] = m_rotate[E_ALIGN_AXIS][Z_AXIS] * m_scale[Z_AXIS]; matrix[11] = 0.0; // translate component matrix[12] = m_translate[X_AXIS]; matrix[13] = m_translate[Y_AXIS]; matrix[14] = m_translate[Z_AXIS]; matrix[15] = 1.0; } // CCadTransform::GetGLMatrix() |
所有的时间均为北京时间。 现在的时间是 06:59 AM. |