PyOpenGL
PyOpenGL
Ganpat University
Ensure Python and pip are installed
glBegin(GL_LINES)
for edge in edges:
for vertex in edge:
# glColor3fv((0, 1, 0))
glVertex3fv(vertices[vertex])
glEnd()
Ganpat University def main():
pygame.init()
display = (800, 600)
pygame.display.set_mode(display, DOUBLEBUF | OPENGL)
pygame.display.set_caption("Pygame Demostration")
pygame.mouse.set_pos(display[0]/2,display[1]/2)
gluPerspective(45, (display[0] / display[1]), 0.1, 500.0)
glTranslatef(0.0, 0.0, -15)
glRotatef(1,45,45,45)
while True:
handle_events()
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit()
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
cube()
pygame.display.flip()
pygame.time.wait(10)