To validate this calculation, we can also ask OpenGL what it has stored in our program. The internal OpenGL matrix that holds all the transformation multiplications is called the ModelView Matrix. We can obtain its value by adding the following code to object.py after the transformations have been applied:
rot_axis $=$ c.get_rotation_axis ()
glTranslatef(pos.x, pos.y, pos.z)
glRotated(rot_angle, rot_axis.x, rot_axis.y,
rot_axis.z)
glscalef(scale.x, scale.y, scale.z)
$m v=$ glGetDoublev(GL_MODELVIEW_MATRIX)
print ("MV: ")
print (mv)
elif isinstance (c, Mesh3D):