Fall 2004 VSFX 419 Programming Models and Shaders II Malcolm Kesson

Main Portfolio

Contact Info

Aghal Creator

Aghal Creator

 
 
 
 
Aghal Creator 1 2 download the complete script

A simple exercise to get a feel for MEL scripting

An aghal is a type of middle eastern headband. Here, I've simplified the design to 4 spheres laid out in a square and connected by four cylinders. This script uses a custom MEL procedure to create the aghal based on user input for radius and length of the cylinders and radius of the spheres.

The basic MEL procedure:

proc makeAghal(float $sphRad, float $cylRad, float $cylLength)
{
for($counter = 0; $counter < 4; $counter++)
{
sphere -r $sphRad -p ($cylLength/2) 0 ($cylLength/2);
rotate -r -os 0 ($counter*90) 0 ;
}
for($counter = 0; $counter < 4; $counter++)
{
string $cylNames[] = `cylinder -n cyl -r $cylRad -hr ($cylLength/$cylRad) -p 0 0 ($cylLength/2)`;
rotate -r -os 0 ($counter*90) 0 ;
}
}

makeAghal(1.0, 0.5, 8.0);