3 D
3 D
# Rotation state
rotate_x = 0
rotate_y = 0
last_x, last_y = 0, 0
dragging = False
def draw_axes():
"""Draw the X, Y, Z axes in 3D space."""
glBegin(GL_LINES)
# X axis (red)
glColor3f(1.0, 0.0, 0.0) # Red for X
glVertex3f(0.0, 0.0, 0.0)
glVertex3f(1.0, 0.0, 0.0)
# Y axis (green)
glColor3f(0.0, 1.0, 0.0) # Green for Y
glVertex3f(0.0, 0.0, 0.0)
glVertex3f(0.0, 1.0, 0.0)
# Z axis (blue)
glColor3f(0.0, 0.0, 1.0) # Blue for Z
glVertex3f(0.0, 0.0, 0.0)
glVertex3f(0.0, 0.0, 1.0)
glEnd()
def main():
global last_x, last_y, rotate_x, rotate_y, dragging
# Initialize Pygame
pygame.init()
# Quit Pygame
pygame.quit()
if __name__ == "__main__":
main()