Sierpinsky Applet
Warning: This may be slow and annoying.
The following applet creates fractals bounded by polygons, using the
Chaos game.
|
|
What's going on?
-
You enter the number of sides of the polygon (some integer between
2 and 100) and a multiplier M (a real number between 0 and 1).
The vertices of your polygon are then assigned screen positions.
-
Next, a point p is chosen at random and drawn onto the screen.
-
From then until the end of time (or until you quit or change the
parameters, whichever happens first), one of the vertices of the
polygon is randomly selected and its distance D from p is
calculated and multiplied by the multiplier M. Now p is
shifted towards the randomly selected vertex a distance equal to
D*M and drawn onto the screen. The process starts again
with this new p.
My Suggestions:
Try 5 sides and multiplier 0.62. Also 3 and 0.4; 6 and 0.67; 100 and
0.97...
Next: What happens when you use irregular polygons?
What if the polygons aren't convex? Can this be extended into 3d?
Jessica Shepherd
(jshepher@cs.utah.edu)
April 23, 1997