My projects: SUGG (M), SYNONS, URLS, SIMILAR, Misc: 3Dengine, UniteHowTo, FliCC, TripIdeas, My blog.
Old/abandoned: TheRarestWords (TcCrnch).
Hi, I'm Slava V. and I develop those projects in free time. rarestwords@mail.ru
To main page | 3dengine.org

Random Lines (PyOpenGL)


This is a testing computationally expensive function (it should take a second or two to run, this was written to demonstrate CallList PyOpenGL Class):
import random
def random_lines():
	print "random_lines called"
	glBegin(GL_LINES)
	i = 0.
	for i in range(100*1000):
		i+=.1
		t = random.uniform(0,3)
		x = math.sin(i+t*.14)
		y = math.sin(i*.2+t*.114)
		z = math.cos(i*.12+t*.114)**2

		glColor3f( x,y-x,z*.1 )
		glVertex3f( x,y,z )
	glEnd()