1 / 13

Uso de MEL ( Maya Embedded Language)

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).

marcin
Télécharger la présentation

Uso de MEL ( Maya Embedded Language)

An Image/Link below is provided (as is) to download presentation 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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Uso de MEL (Maya Embedded Language) Para: Números aleatorios Fractales

  2. Abrir MEL

  3. 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”

  4. 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; };

  5. Aleatorios.mel

  6. Mandelbrot.mel parte 1/3 //All the COLOURS used within the Mandelbrot set. createAndAssignShaderlambert ""; setAttr "lambert2.color" -type double3 0.0 0.0 1.0 ; //blue createAndAssignShaderlambert ""; setAttr "lambert3.color" -type double3 0.0 0.0 0.0 ; //black createAndAssignShaderlambert ""; setAttr "lambert4.color" -type double3 1.0 0.0 1.0 ; //pink createAndAssignShaderlambert ""; setAttr "lambert5.color" -type double3 1.0 1.0 1.0 ; //white createAndAssignShaderlambert ""; setAttr "lambert6.color" -type double3 1.0 1.0 0.0 ; //yellow createAndAssignShaderlambert ""; setAttr "lambert7.color" -type double3 0.0 1.0 0.0 ; //green createAndAssignShaderlambert ""; setAttr "lambert8.color" -type double3 0.0 1.0 1.0 ; //light blue

  7. Mandelbrot.mel 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;

  8. for ($y = 0; $y < $SIZE; $y++) { 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; } } COLOREA CADA ESFERA } } 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; } Cálculos con cada esfera Variable $iter guarda el número de iteración en que x2 + y2 >= 4

  9. Planos alternos para el Conjunto de Mandelbrot Plano 1/m Se itera esta función:

More Related