File: square.py

package info (click to toggle)
glitch 0.6-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 488 kB
  • ctags: 649
  • sloc: python: 3,432; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 396 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

import glitch, glitch.glut

import OpenGL.GL as gl

class Square(glitch.Node):
    def draw(self, ctx):
        gl.glColor3f(0, 1.0, 0)
        gl.glBegin(gl.GL_QUADS)
        gl.glVertex3f(0, 0, 0)
        gl.glVertex3f(1, 0, 0)
        gl.glVertex3f(1, 1, 0)
        gl.glVertex3f(0, 1, 0)
        gl.glEnd()

square = Square()
camera = glitch.glut.GLUTCamera(children=[square])

camera.run()