Wednesday, March 25, 2009

Morph (Code)

Ok so... i'm still coding my morph but I'll put up my progress so far.

The name of the object I'm deforming is: sphere
//This Squishes the Sphere
int $i;
string $obj = "sphere";
float $pPos[];
for($i=0; $i <= 381; $i++){
select -r ($obj+".vtx["+$i+"]");
$pPos = `pointPosition -w ($obj+".vtx["+$i+"]")`;

move -r -os -wd (-$pPos[0]) 0 0;
}

//This splits the faces into individual peices
string $obj = "sphere";

for($i=0; $i <= 399; $i++){
select -r ($obj+".f["+$i+"]");
polyChipOff -kft off -dup off;
};

//Todo: Randomize face start times
//Todo: Set some faces to squish onto x axis rather than all on the z (I'll tell them to go to x or z by Face Normal value)

Heres what it looks like visually.
Before Squish

Squish PerformedProof that the faces are all detatched
So with this I'll be able to apply the function to my model for our final movie, then animate the faces resuming their correct positions.

-Jorge

No comments:

Post a Comment