The Mandala image is built out of snakes. This version of Mandala can draw from one to four snakes (at a time). Each snake is characterized by a length and a color. The length is measured in pixels, the dots that make up the screen. The snake color depends upon the current palette. Snake parameters are set on a dialog box, started from the View|Options drop-down menu.
Whenever the Mandala window frame is created or resized, a new drawing circle is created. The circle is sized so that it fits completely within the smallest dimension of the client area of the window. All Mandalas are drawn within this circle. The perimeter of the circle is always drawn in black. The circle surrounds an X-Y coordinate system with the origin at the center of the circle. Snakes only move within the upper half of the circle. In fact, they are bounded by the upper half of the circle. They cannot have a negative Y value, or be further from the origin than the radius of the outer circle. Of course pixels are ultimately drawn over the entire circle. This is due to symmetry, or reflections and rotations of the snakes.
As you make the outer circle smaller, you may want to reduce the snake length. The best looking Mandalas are a delicate balance between snake colors and the background color. As the background shrinks (smaller circle), it is sometimes desirable to reduce the snake length.
The fundamental unit of change in Mandala is the iteration. An iteration is a single step movement of all of the snakes that are being drawn. This means that a pixel is added to the head of the snake, and a pixel is removed at the end of the snake. A pixel is only removed at the end of the snake when the snake has reached its full length.
The terms adding and removing, while intuitively descriptive, do not technically describe the process of combining colors on the screen. Please see the Palette page for more detailed information.
The pixel changes in a given snake are duplicated in other regions of the screen based upon the selected symmetry. In the case of 12-way symmetry, where all four snakes are being displayed, and the snakes are at full length, a given iteration implies the changing of 96 (12-way symmetry X 4 snakes X 2 ends) pixels. In practice, snakes may overlap and share a pixel location, so the number of pixels visually changing may be reduced.
An update represents a change of the actual visible window. Updates are started by a timer within the program. The update rate can be controlled with a slider control on a dialog box. At the start of each update, one or more iterations are performed, and the result of the update is the display of the cumulative results of all of the iterations per that update.
The iterations per update and update rate are both adjustable. As you vary these controls, you can create a wide range of visual effects. Increasing the iterations per update will increase the pixel per second rate, at the expense of making the snakes appear to have a jerky motion.
A snake starts out with zero length The initial or first point of all snakes is the center of the segment or wedge. The snake has a head and a tail. The length of all snakes is set on the Options Dialog Box.
The Mandala drawing algorithm moves through a series of operations. These operations are executed for each enabled snake (one to four). Each complete set of operations for all snakes is called an iteration.
The process of setting pixels is complicated by the addition of symmetry. Each pixel that is either set or cleared will give rise to additional pixels that are in the reflected or rotated segments (or wedges). Please see the symmetry page. Note that the addition of symmetry does not create more snakes. The basic snakes are reflected or rotated to create symmetric images that look as if there are many snakes, but in fact, there the are never more than the four fundamental snakes that exist within the upper half of the outer circle.
If you are interested in the operation of snakes, try selecting 2-way symmetry, one snake, and drawing within a single segment. This will draw a single snake without symmetry.
The new snake head position is derived from the previous snake head position. For any given pixel, there are 8 adjacent neighbor pixels. The new snake head is selected by random from one of these neighboring pixels. The new position must not violate one of the bounds rules. If it does, another one of the neighbors is selected. Ultimately, therefore, the snake motion, and the entire Mandala animation, is controlled exclusively by the set of random numbers produced by the random number generation software (which is part of the Windows software).
A sequence of random numbers is generated from a random number seed. This is a number given to the random number generation software before asking for random numbers. Since the seed controls the sequence of random numbers, we really have a pseudo random number generator, as opposed to true random numbers. If we control and reuse the seed, we will be able to reproduce the identical sequence of pseudo random numbers.
Mandala allows you to select one of two random number seeds. The first is a portion of the current time. Since time rarely stops, we will have an endless supply of changing seeds. The other random seed choice comes from an integer that you, the user, specify. If you supply your own seed, and do not change the size of the window (or other aspects of the Mandala), the visual pattern will repeat identically each time the Mandala is restarted. Please note that if you discover a seed that you really like, you should make sure to repeat all of the other Mandala options, including the window size. If something changes, you will not reproduce a previous Mandala animation. Random number options and parameters are specified on the View|Options dialog box.
The seed value is shown in the status bar, on the bottom of the window.
When Mandala starts, the program is in run mode. The screen will be updated at the update rate, with the specified number of iterations per update. The update cycle can be paused with the View|Pause command. The cycle can be continued with the View|Run command. Drawing can be restarted with the View|Restart command.
Last update: Monday, July 30, 2001 03:17:33 PM
Back to the Mandala Home Page