キーフレーム・アニメーションは以下の手順で作ってゆく。
球を円状にアニメーションさせるMELスクリプト。
global proc circleAnimation(float $rad, int $frame)
{
float $x, $z;
float $r;
float $add = 0.1;
sphere;
for($r = 0.0, $i = 0; $i < $frame; $r += $add, $i++)
{
currentTime $i;
$x = $rad * sin($r);
$z = $rad * cos($r);
move $x 0 $z;
setKeyframe;
}
}
circleAnimation3(円の半径, 上下動の範囲, フレーム数)