sphere;
for($i = 0; $i <= 200 ; $i++)
{
currentTime $i;
$x1 = cos($i * 0.314) * 3;
$y1 = sin($i * 0.314) * 3;
$x1 += 10;
$z1 = 0;
move $x1 $y1 $z1;
setKeyframe;
}
sin, cos の引数にある0.314という値は回転のスピードを調節するための適当な値である。
この値を大きくするとスピードが早くなり、小さくすると遅くなる。
sphere -n sphere1;
sphere -n sphere2;
$x1 = ...;
$y1 = ...;
$x1 += 10;
$z1 = 0;
move $x1 $y1 $z1 sphere1;
$x2 = ...;
$y2 = ...;
$x2 += 10;
$z2 = 0;
move $x2 $y2 $z2 sphere2;
$z1 = cos(角度) * 半径;
$x1 = sin(角度) * 半径;
角度は適当な変数をfor文で変化させてゆけば良い。
global proc makeDna(int $num)
{
.
.
}
window ....;
.
.
.
intSliderGrp ... ;
button ... -command "$value = `intSliderGrp -q -value ....`;\
makeDna($value);";
showWindow;
もちろん、上記以外の方法でプログラミングしてもかまわない。