'Create the projection matrix from the current viewing position.
elev stores the elevation angle in the z plane
azim stores the azimuth angle in the x,y plane
dist is the distance of the eye viewing point from the object
point.'

def get_proj(self):

    (relev, razim) = (((np.pi * self.elev) / 180), ((np.pi * self.azim) / 180))
    (xmin, xmax) = self.get_xlim3d()
    (ymin, ymax) = self.get_ylim3d()
    (zmin, zmax) = self.get_zlim3d()
    worldM = proj3d.world_transformation(xmin, xmax, ymin, ymax, zmin, zmax)
    R = np.array([0.5, 0.5, 0.5])
    xp = (R[0] + ((np.cos(razim) * np.cos(relev)) * self.dist))
    yp = (R[1] + ((np.sin(razim) * np.cos(relev)) * self.dist))
    zp = (R[2] + (np.sin(relev) * self.dist))
    E = np.array((xp, yp, zp))
    self.eye = E
    self.vvec = (R - E)
    self.vvec = (self.vvec / proj3d.mod(self.vvec))
    if (abs(relev) > (np.pi / 2)):
        V = np.array((0, 0, (-1)))
    else:
        V = np.array((0, 0, 1))
    (zfront, zback) = ((- self.dist), self.dist)
    viewM = proj3d.view_transformation(E, R, V)
    projM = self._projection(zfront, zback)
    M0 = np.dot(viewM, worldM)
    M = np.dot(projM, M0)
    return M
