In the process of creating my Super Creatures set, I wanted a dynamically random simulation of the Super Formula designed by Johan Gielis to produce a body, secondary body and facial features. The program I wrote has setup two useful methods.
One method is “creature”, which will randomly create a creature around the world origin, wherever that may be. The creature method will distinctly develop a random body, a transparent secondary body which is also color coordinated with the base body, a random number of eyes between 2 and 4 and a mouth.
The body parts and the mouth are all developed using the method called “superform”, which implies the super formula. The “superform” method accepts a few key parameters including: the desired width & height and the six distinct parameters of the super formula, notably A, B, m, n1, n2, n3. Through the use of the parameters we can plug them into the super formula, which at a certain degree between 0 and 2PI (a full circle), will produce a point. Cycling through the range of 0 to 2PI in increments of .0001, we can come up with multiple vertices and finally connect them all to produce a shape. This shape is then displayed according to the previously defined fills and stroke qualities.

The desired width and height were usually decreased as the body pieces began to fit on the body. Yet to keep the dynamics of the program, all super shapes developed were and are random. Mostly modifying the parameters m, n1, n2 and n3, we can come up with all kinds of shapes.
Further exploration of radians between 0 and multiples of 2PI has shown quite extravagant shapes. Yet the way it has been implemented, the allowed range will only go from 0 to 4PI, since the program can run out of allowable memory due to so many vertices of a shape.
Also this formula can be simulated to produce 3 dimensional values and produce 3D Super Shapes.
I give credit to Johan Gielis for a functional method to produce super shapes and nodebox.com for giving me inspiration.

0 comments:
Post a Comment