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()