Categories: Architecture

butterfly-effect.jpg

This is my first stab at creating a form from the Lorenz Attractor (Butterfly Effect) algorithm. I need to tweak a few numbers in the Maya script to get various sets of results. But I think it’s pretty beautiful already.

MEL Script:

//—————————————————————
int $i=0;

int $j=1;

int $max = 1000; //number of circles generated

float $myx0,$myy0,$myz0,$myx1,$myy1,$myz1;

float $myh = 0.01;

float $mya = 28; //a, b, and c are a set of commonly used

float $myb = 46.92; //constants to generate the Lorenz attractor
float $myc = 4;
$myx0 = 0.1;

$myy0 = 0;

$myz0 = 0;

for ($i=0;$i<$max;$i++)

{

circle -c $myx0 $myy0 $myz0 -r 0.5;

//differential equations

$myx1 = $myx0 + $myh * $mya * ($myy0 - $myx0);

$myy1 = $myy0 + $myh * ($myx0 * ($myb - $myz0) - $myy0);

$myz1 = $myz0 + $myh * ($myx0 * $myy0 - $myc * $myz0);

$myx0 = $myx1;

$myy0 = $myy1;

$myz0 = $myz1;

}
select -allDagObjects;

scale -r 0.05 0.05 0.05 ;

loft -ch 1;

select -allDagObjects;

select -d loftedSurface1;

delete;

Thanks a million to Fiona Mortimer for translating the original C source code to MEL.

Leave a Comment