2,14c2 < #Hi George, < < #Here is the code for PyMandel.py... the simple Mandelbrot < #generator in python. If you don't have psyco installed, you can < #comment out those lines. Psyco is recommended, though, because it < #does speed up the execution time. Uncommenting the "extra" < #glColor and glVertex lines makes for some pretty pictures! I know < #inverse iteration would draw the outline much faster, but would it < #be as colorful? < #---------------------------------------------------------- < < #PyMandel < #By Stan Blank, Wayne City HS, Illinois, 5mar05 --- > # PyJulia 28d15 < glOrtho(-2.0,1.0,-1.5,1.5,-1.5,1.5) 30c17,21 < def drawMandel(): --- > #Slight change here to widen screen > glOrtho(-2.0,2.0,-1.5,1.5,-1.5,1.5) > > # Change to drawJulia > def drawJulia(): 38c29,31 < while x < 1.0: --- > > # Slight change here > while x < 2.0: 40a34,39 > # This represents the complex number c + di > # Change these numbers or do some internet > # Research on good parameters for Julia Sets > c = -.75 > d = .12 > 47,48c46,49 < xx = a*a - b*b + x < yy = 2*a*b + y --- > > # Slight change here > xx = a*a - b*b + c > yy = 2*a*b + d 53c54 < glVertex3f(x,y,0) --- > #glVertex3f(x,y,0) 58,59c59,64 < #glColor3f(cos(5*zz),sin(4*zz)*cos(4*zz),sin(2*zz)) < #glVertex3f(x,y,0) --- > > # This is new! > # What happens if you put this in the PyMandel program? > if zz < 4: > glColor3f(cos(5*zz),sin(4*zz)*cos(4*zz),sin(2*zz)) > glVertex3f(x,y,0) 68,69c73,76 < glutCreateWindow("Mandelbrot") < glutDisplayFunc(drawMandel) --- > glutCreateWindow("Julia Set at") > > # Note displayfunc name > glutDisplayFunc(drawJulia)