I would like to switch the Y and Z axis orientation in PyOpenGL. I have tried using matrix transformations but I have not been able to do it.
Code:
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(self.zoom, -self.zoom, -self.zoom, self.zoom, -5000, 5000)
glMatrixMode(GL_MODELVIEW)
glClearColor(1, 1, 1, 0)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glLoadMatrixf(self.m)
Where:
self.zoom = 150
self.m = [[1, 0, 0, 0],
[0, 0, 1, 0],
[0, 1, 0, 0],
[0, 0, 0, 1]]
Edit: This works:
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(self.zoom, -self.zoom, -self.zoom, self.zoom, -5000, 5000)
up = 1
if self.theta == 360:
up = -1
gluLookAt(self.x, self.y, self.z, 0, 0, 0, 0, up, 0)
glMatrixMode(GL_MODELVIEW)
glClearColor(1, 1, 1, 0)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glLoadMatrixf(self.m)