Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- from pygame.locals import *
- from OpenGL.GL import *
- from OpenGL.GLU import *
- pygame.init()
- display = (800, 600)
- pygame.display.set_mode(display, DOUBLEBUF|OPENGL)
- pygame.display.set_caption("03 Lab 1 Wrichmond Well A. Chua")
- gluPerspective(45, (display[0]/display[1]), 1, 10)
- glTranslatef(0, 0, -5)
- while True:
- for event in pygame.event.get():
- if event.type==pygame.QUIT:
- pygame.quit()
- quit()
- glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
- glBegin(GL_LINES)
- glVertex3f(-0.5, 0.5, 0.5)
- glVertex3f(-0.5, -0.5, 0.5)
- glVertex3f(0.5, -0.5, 0.5)
- glVertex3f(0.5, 0.5, 0.5)
- glVertex3f(0.5,0.5,0.5)
- glVertex3f(-0.5, 0.5, 0.5)
- glEnd()
- pygame.display.flip()
- pygame.time.wait(15)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement