|
|
||||||
|
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
For each iteration A, a color is picked at random; then two pairs of coordinates are randomly chosen. For each sub-iteration B, the random points are checked, and should they lie outside the triangle, the pairs are chosen again, until they both lie within the triangle. End of iteration B. Now, two "steps" are randomly chosen. These numbers lie between 0 and 4. For each of 40 iterations C, the first of the two previously picked pairs of coordinates are continuously incremented by step1 (both x and y), and the same for the second pair using step2. End of iteration C. After 50 iterations of A, B, and C, the screen is swiped from left to right, and the algorithm starts anew. The complete algorithm is built in 3 flow charts, where the first concentrates on the ground structure and only drawing one line per triangle; the second flow chart then adds another loop that repeatedly draws lines so as to form pseudo-two dimensional shapes. The third flow chart incorporates the code for swiping the image clean. Let's look at the flowchart diagrams of each of the 3 Kaleidoscopes: 1. The simplest version:
Everyone is encouraged to come up with their own idea of what shapes to use and how these shapes are represented in the applet. For homework, students are encouraged to come up with exotic shapes. The following is the code for the existing applet. The file "Swipe.java" should be downloaded as well, however, students need not change it or understand it at this point.
|
||||||||||||||||||||||||||||||||