File: cursor.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 (21 lines) | stat: -rw-r--r-- 483 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
from objex import *
from whrandom import *

class cursor:
    def __init__(self,x=0,y=0,z=0):
         self.c = Qcyl(.1,6,1)
	 self.x = x
	 self.y = y
	 self.z = z
	 
    def draw(self):
       	glPushMatrix()
	glEnable(GL_LIGHTING)
	glMaterialfv(GL_FRONT, GL_DIFFUSE, [1., 1., 0., 0.])
	glTranslate(self.x,self.y,self.z)
	self.c.draw()
	glPopMatrix()
        #self.x = self.x + random() - 0.5 
        #self.y = self.y + random() - 0.5 
        #self.z = self.z + random() - 0.5