First, when you draw you call
glRotatef(30, 1, 1, 0)
And after drawing you call:
glRotatef(-30, -1, -1, 0)
. To reverse the rotation, you only need to change the sign of the degrees, not the axis, so it should be:
glRotatef(-30, 1, 1, 0);
To avoid this (and to make it easier), instead of doing this:
glTranslatef(self.position, self.position, self.position) glRotate(30, 1, 1, 0) ... draw ... glRotate(-30, 1, 1, 0) glTranslatef(-self.position, -self.position, -self.position)
glPushMatrix(); glTranslatef(self.position, self.position, self.position) glRotate(30, 1, 1, 0) ... draw ... glPopMatrix();
This way, between glPushMatrix() and glPopMatrix(), you can do whatever transformations you want, that it won't affect the previous matrix.
I don't know if this is exactly your problem, but when you draw the cubes, you're translating them first and then rotating.
In this case, the farther away the cube is from the origin, the longer will be the rotation, because it will be rotating around the axis and not around itself.
Again, i don't know if this is intentional or not, if it is then forget it.
I don't really know Python, but this seems to be a problem with OpenGL, so i hope it helps.
Also, unless the OpenGL spec is different for Python, shouldn't the glRotate() call be glRotatef() (or glRotated() if your using doubles)?