which all return an array of 16 doubles. The meaning of each of the
values is documented but it is not clear how these values correspond to
the "standard" OpenGL transformation matrix. Knowledge of this is
typically needed when drawing directly into the SolidWorks OpenGL window.
Solution:
The relationship between the SolidWorks and OpenGL transformations is
shown in the following code fragments.
Note that there is an AutoMatrix class which automatically pushes and pops
the OpenGL matrices.
*/
// apply component Xform to OpenGL matrix
glMultMatrixd(OpenGLmatrix);
// do some OpenGL drawing
}
//------------------------------------------------------------------------
//------------------------------------------------------------------------
// class AutoMatrix
// automatically pushes matrix on creation and pops matrix on destruction
class AutoMatrix
{
private:
GLint m_MatrixMode;
//------------------------------------------------------------------------
// class AutoMatrix
// automatically pushes matrix on creation and pops matrix on destruction
AutoMatrix::AutoMatrix()
{
glGetIntegerv(GL_MATRIX_MODE, &m_MatrixMode);