'Configure OpenGL to draw in 3d.'

def set_3d(self):

    (width, height) = self.get_size()
    glEnable(GL_DEPTH_TEST)
    glViewport(0, 0, width, height)
    glMatrixMode(GL_PROJECTION)
    glLoadIdentity()
    gluPerspective(65.0, (width / float(height)), 0.1, 60.0)
    glMatrixMode(GL_MODELVIEW)
    glLoadIdentity()
    (x, y) = self.rotation
    glRotatef(x, 0, 1, 0)
    glRotatef((- y), math.cos(math.radians(x)), 0, math.sin(math.radians(x)))
    (x, y, z) = self.position
    glTranslatef((- x), (- y), (- z))
