Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python2
- try:
- from OpenGL.GLUT import *
- from OpenGL.GLU import *
- from OpenGL.GL import *
- import sys
- except ImportError:
- print "[!] Error importing one or more library(ies)\n\n"
- exit(-1)
- '''
- RGB color table:
- ****************
- Red Green Blue Color
- ------------------------------------------------------
- 0 0 0 Black
- 0 0 1 Blue
- 0 1 0 Green
- 0 1 1 Cyan
- 1 0 0 Red
- 1 0 1 Magenta
- 1 1 0 Yellow
- 1 1 1 White
- '''
- def MyCustomShape():
- glClear(GL_COLOR_BUFFER_BIT)
- # Your Objects to be draw should be put here
- glFlush()
- def main():
- glutInit(sys.argv)
- glutInitDisplayMode( GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH)
- glutInitWindowSize(500,500)
- glutCreateWindow("Lab1 - Submission")
- glClearColor(1.0,1.0,1.0,0.0)
- glMatrixMode(GL_PROJECTION)
- gluOrtho2D(0.0, 200.0, 0.0, 200.0)
- glutDisplayFunc(MyCustomShape)
- glutMainLoop()
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement