1 / 13

# Uso de MEL ( Maya Embedded Language) - PowerPoint PPT Presentation

Uso de MEL ( Maya Embedded Language). Para: Números aleatorios Fractales. Abrir MEL. MEL ( Maya Embedded Language). En el Script Editor. File -> Open (O copiar y pegar el script en la parte de abajo del Script Editor).

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about ' Uso de MEL ( Maya Embedded Language)' - marcin

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### Uso de MEL (Maya Embedded Language)

Para:

Números aleatorios

Fractales

MEL (Maya Embedded Language)

• En el Script Editor.

• File -> Open (O copiar y pegar el script en la parte de abajo del Script Editor).

• Seleccionar la parte del texto a ejecutar y oprimir el botón:

• Practicar con el script: “Aleatorios.mel”

sphere;

rename nurbsSphere1 a1;

select a1;

duplicate -rr;

for(\$i=1; \$i<=9; ++\$i)

duplicate -rr -st;

for(\$i=1; \$i<=10; ++\$i)

{

select("a"+\$i);

\$x=rand(-5,5);

print \$x;

print " ";

\$y=rand(1,10);

print \$y;

print " ";

\$z=rand(-5,5);

print \$z;

print "\r";

move \$x \$y \$z;

select -d;

};

for(\$i=1;\$i<=10;\$i++)

{

\$x = rand(1,1000);

select ("a"+\$i);

rotate \$x \$x \$x;

select -d;

};

parte 1/3

//All the COLOURS used within the Mandelbrot set.

setAttr "lambert2.color" -type double3 0.0 0.0 1.0 ; //blue

setAttr "lambert3.color" -type double3 0.0 0.0 0.0 ; //black

setAttr "lambert4.color" -type double3 1.0 0.0 1.0 ; //pink

setAttr "lambert5.color" -type double3 1.0 1.0 1.0 ; //white

setAttr "lambert6.color" -type double3 1.0 1.0 0.0 ; //yellow

setAttr "lambert7.color" -type double3 0.0 1.0 0.0 ; //green

setAttr "lambert8.color" -type double3 0.0 1.0 1.0 ; //light blue

parte 2/3

int \$iter;

int \$SIZE = 100; //number of spheres to be generated in x and y

float \$LEFT = -2.0; //constant determining the left most co-ordinate

float \$RIGHT = 1.0; //constant determining the right most co-ordinate

float \$TOP = 1.0; //constant determining the upper most co-ordinate

float \$BOTTOM = -1.0; //constant determining the lower most co-ordinate

float \$x, \$y, \$count;

float \$zr, \$zi, \$cr, \$ci;

float \$rsquared, \$isquared;

{

for (\$x = 0; \$x < \$SIZE; \$x++)

{

\$zr = 0.0; \$zi = 0.0;

\$cr = \$LEFT + \$x * (\$RIGHT - \$LEFT) / \$SIZE;

\$ci = \$TOP + \$y * (\$BOTTOM - \$TOP) / \$SIZE;

\$rsquared = \$zr * \$zr;

\$isquared = \$zi * \$zi;

for (\$count = 0; \$rsquared + \$isquared <= 4.0

&& \$count < 200; \$count++)

{

\$zi = \$zr * \$zi * 2 + \$ci;

\$zr = \$rsquared - \$isquared + \$cr;

\$rsquared = \$zr * \$zr;

\$isquared = \$zi * \$zi;

if (\$rsquared + \$isquared >= 4.0){

\$iter = \$count;

break;

}

}

}

}

Mandelbrot.mel

parte 3/3

if (\$iter >= 0 && \$iter <= 1){

sphere -p \$x 0 \$y -r 0.4;

sets -e -forceElement lambert8SG;

}

if (\$iter > 1 && \$iter <= 2){

sphere -p \$x 0 \$y -r 0.5;

sets -e -forceElement lambert7SG;

}

if (\$iter > 2 && \$iter <= 3){

sphere -p \$x 0 \$y -r 0.6;

sets -e -forceElement lambert6SG;

}

if (\$iter > 3 && \$iter <= 5){

sphere -p \$x 0 \$y -r 0.7;

sets -e -forceElement lambert5SG;

}

if (\$iter > 5 && \$iter <= 10){

sphere -p \$x 0 \$y -r 0.8;

sets -e -forceElement lambert4SG;

}

if (\$iter > 10 && \$iter < 200){

sphere -p \$x 0 \$y -r 0.8;

sets -e -forceElement lambert2SG;

}

if (\$rsquared + \$isquared <= 4.0 && \$iter = 200){

sphere -p \$x 0 \$y -r 0.8;

sets -e -forceElement lambert3SG;

}