from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * def display(): glClear( GL_COLOR_BUFFER_BIT ) glVertexPointeri( [[289,190],[320,128],[239,67],[194,101], [129,83],[75,73],[74,74],[20,10]] ) glColor3( .2, .2, .5 ) glDrawElementsui( GL_LINE_STRIP, [3,0,1,2,3,4,5,6,7] ) glEnableClientState( GL_COLOR_ARRAY ) glColorPointerf( [[1,1,0], [1,1,0], [1,.5,0], [1,1,0], [1,1,0], [.5,1,1], [1,1,0], [1,1,0]] ) glDrawArrays( GL_POINTS, 0, 8 ) glDisableClientState( GL_COLOR_ARRAY ) glFlush() def myInit(): glClearColor( 0, 0, .3, 0 ) glPointSize( 5 ) glEnable( GL_POINT_SMOOTH ) glEnableClientState( GL_VERTEX_ARRAY ) def reshape(w,h): glViewport( 0, 0, w, h) glMatrixMode( GL_PROJECTION ) glLoadIdentity() s = 350. gluOrtho2D( 0, s, 0, s*h/w ) glMatrixMode( GL_MODELVIEW ) def main(): glutInit([]) glutInitDisplayMode( GLUT_SINGLE | GLUT_RGB ) glutInitWindowSize( 600, 400 ) glutInitWindowPosition( 300, 100 ) glutCreateWindow( 'Big dipper' ) glutDisplayFunc ( display ) glutReshapeFunc ( reshape ) myInit() glutMainLoop() main()