となっています。以下 各変数を説明しましょう。
#declare N=24; //number of units
#declare r=0.04; // roundishness of units
#declare pos=<-3,-3,0>; // the position of the initial end unit
#declare in=<0,0,1>; // getting in vector at initial end surface
#declare out=<0,1,0>; // getting out vector from initial end unit to the next unit
#declare ro=array[24] { //how to twist at each joint 1:cockwise 2:180 degree 3:anti clockwise
//leave the first element 0
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0
/* propeller
0,1,1,2,3,1,0,3,
1,1,1,2,3,1,0,3,
1,1,1,2,3,1,0,3
*/
};
#declare colA=<0,0,1>; // one color of alternative colors of units.
#declare colB=<1,1,1>; // the other color of alternative colors of units.
N | ユニットの数です。製品版のスネークキューブは24でした。 |
---|---|
r | ユニットの角の丸みの半径です。小さめの正の値を指定してください。 大きくすると ユニットの角の丸みがおおきくなります。 |
pos | 端のユニットの位置です。つぎの図の赤い玉の座標になります。 |
in | 端のユニットの向きを指定するベクトルです。 次の図の緑のベクトルです。 (プログラム内で 勝手に正規化するので 長さはどうでもいいです。) |
out | 端のユニットの向きを指定するベクトルです。 次の図の黄色のベクトルです。 (プログラム内で 勝手に正規化するので 長さはどうでもいいです。 また、勝手に直交化しますので、上の「inベクトル」と 完全に直交してなくても 大丈夫です。) |
ro | スネークキューブの各ジョイントのひねる方向を指定する配列です。 最初の要素は0にしておいてください。 その他の23個の要素は 端のユニットから 順に23個のジョイントの ひねる方向を指定するもので、 1:右ネジひねり、2:180度ひねり、3:左ネジひねり、になります。 (実は 整数でなくても大丈夫です。) |
colA、colB | ユニットの色です。2色で交互にぬるので2色指定してください。 |