File: text.py

package info (click to toggle)
python-opengl 1.5.7-5.3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,192 kB
  • ctags: 3,971
  • sloc: ansic: 18,030; python: 8,909; tcl: 328; cpp: 211; makefile: 115; sh: 24
file content (49 lines) | stat: -rw-r--r-- 734 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python

from OpenGL.GL import *
from OpenGL.Tk import *

from logo import *

def redraw(o):

  if o.grob == -1:
    o.grob = glGenLists(1);
    glNewList(o.grob, GL_COMPILE_AND_EXECUTE);
    glMaterialfv(GL_FRONT, GL_DIFFUSE, [1., 1., 0., 0.])
    define_logo()
    glEndList()

    o.autospin = 1

    o.xspin = 1
    o.yspin = 2

    o.update()

    o.after(10, o.do_AutoSpin)

  else:

    glCallList(o.grob)

#
# Demo starts here really.

import Tkinter, sys

o = Opengl(None, width = 400, height = 200, double = 1, depth = 1)
o.pack(expand = 1, fill = 'both')

o.redraw = redraw
o.set_centerpoint(30., 2., 0.)
o.set_eyepoint(80.)

o.grob = -1

o.autospin_allowed = 1

# Enter the tk mainloop.

Tkinter.mainloop()