JORDAN YOUNGLOVE
MATRIX MEL SCRIPT
//Creates orb and Platonic shape that is broken apart with polyChipOff command.
polyPlatonic -r 3 -primitive 4 -subdivisionMode 2 -subdivisions 1 -sphericalInflation 0.75;
rename "pPlatonic1" "orbShards";
polyChipOff -dup off -kft off -ls .85 .85 0;
polySelectConstraint -t 8 -m 3 -r on -rr 0.3;
scale -pivot 0 0 0 -r 0.89 0.89 0.89;
select -r orbShards;
polyExtrudeFacet -ch 1 -kft on -thickness .05 ;
polySelectConstraint -r off;
polyBevel3 -fraction 0.5 -offsetAsFraction 1 -autoFit 1 -depth 1 -mitering 0 -miterAlong 0 -chamfer 1 -segments 1 -worldSpace 1 -smoothingAngle 30 -subdivideNgons 1 -mergeVertices 1 -mergeVertexTolerance 0.0001 -miteringAngle 180 -angleTolerance 180 -ch 1 orbShards.f[0:299];
polySphere -r 1 -sx 16 -sy 16 -ax 0 1 0 -cuv 2 -ch 1;
rename "pSphere1" "orb";
//Creates two gears around the orb.
polyGear -sides 16 -r 4 -ir 3.5 -h 0.25 -hd 1 -gs 0.4 -go 0.5 -gt 0.5;
rotate 0 0 45;
polyGear -sides 16 -r 4.9 -ir 4.4 -h 0.25 -hd 1 -gs 0.4 -go 0.6 -gt 0.5;
rotate 0 0 -45;
select -r "pGear1" "pGear2";
group -name gears_GRP;
select -r "pGear1" "pGear2";
polyBevel3 -fraction 0.2 -offsetAsFraction 1 -autoFit 1 -depth 1 -mitering 0 -miterAlong 0 -chamfer 1 -segments 1 -worldSpace 1 -smoothingAngle 30 -subdivideNgons 1 -mergeVertices 1 -mergeVertexTolerance 0.0001 -miteringAngle 180 -angleTolerance 180 -ch 1 pGear1;
polyBevel3 -fraction 0.2 -offsetAsFraction 1 -autoFit 1 -depth 1 -mitering 0 -miterAlong 0 -chamfer 1 -segments 1 -worldSpace 1 -smoothingAngle 30 -subdivideNgons 1 -mergeVertices 1 -mergeVertexTolerance 0.0001 -miteringAngle 180 -angleTolerance 180 -ch 1 pGear2;
select -all ;
group -name gearOrb_GRP;
move 0 6 0;
//Creates large polyHelix around orb
polyHelix -c 4 -h 27 -w 26 -r 0.7 -sa 8 -subdivisionsCoil 50;
//Generates randomly placed objects for the large helix
{
vector $data[];
getVertices("pHelix1", $data);
print (size($data));
for($pos in $data) {
if(rand(0.0, 1.0) >= 0.7) {
polyCube -w (rand(0.1, 1)) -h 0.05 -d (rand(0.05, 0.5));
move ($pos.x) ($pos.y + rand(0.05, 1)) ($pos.z + rand(0.05, 1));
rotate 0 (1 + rand(-50, 50)) (1 + rand(-50, 50));
scale (rand(0.2, 2)) (rand(0.2, 2)) (rand(0.2, 2));
}
}
}
select "pHelix1";
hide;
//Creates the gradually spiraling DNA structure.
global proc string dna_start(int $xNum,
float $xSpace,
float $sphOutSize,
float $sphInSize) {
//proc sphere_row_group() {
for ($x = 0; $x < $xNum; $x++) {
if ($x > 0 && $x < ($xNum - 1))
{
sphere -r $sphOutSize;
move ($xSpace * $x) 0 0;
scale $sphInSize $sphInSize $sphInSize;
}
else
{
sphere -r $sphOutSize;
move ($xSpace * $x) 0 0;
}
}
select -all;
return `group`;
}
global proc dna_strand(int $xNum,
int $yNum,
float $xSpace,
float $ySpace,
float $twist,
float $sphOutSize,
float $sphInSize) {
float $yheight = 0;
for ($y = 0; $y < $yNum; $y++){
string $g = dna_start($xNum, $xSpace, $sphOutSize, $sphInSize);
move -absolute 0 $yheight 0 $g;
$yheight += $ySpace;
rotate 0 ($twist) 0;
}
}
dna_strand(10, 70, 0.5, 0.01, 10, 0.5, 0.5);