Translation is just a way to say move something to a new position. In fact, in
3JS, we've been using translation for positioning parts of the drinking bird
model. 3JS has translation and other transforms built into every object. In this
code, we're moving the center of the sphere to the position 0, 540, 0, which is
a vector, that is any point on the sphere is moved by this vector to a new
position. This code does the same thing, only this line has been changed. It's
pretty obvious that this y-coordinate can be the sum or product of any set of
numbers. My point here is that adding values together like this is equivalent to
adding the coordinates of the vectors. So here, a vector of 0, 160, 0 and a
vector of 0, 390, 0 are added together to get 0, 540, 0. Translations can be
treated somewhat like numbers in this respect. You can add them together in any
order and you'll obtain a final translation vector that sums all the
translations and tells you the final position.
平行移動とはオブジェクトを
新しい位置へ移動することです
この技法はthree.jsで水飲み鳥のモデルを
作成した際に利用しました
three.jsではどのオブジェクトにも
平行移動などの変換を実行できます
このコードでは球体の中心を点(0,540,0)へ移動します
これはベクトルです
つまり球体上のすべての点が
このベクトルで移動するということです
これは同じ操作を示すコードですが
最後の行だけ変えています
もちろんこのy座標はあらゆる値の和や積になり得ます
重要なのは値の足し算とベクトル座標の足し算は
同じ操作であることです つまり次のことが言えます
ベクトル(0,160,0)と(0,390,0)の和は
(0,540,0)になります
平行移動はこの点で数学と似た
考え方をします これらの座標を
足し算する順序は任意で
すべての座標を合計したベクトルは
球体の最終的な位置を示します
平移只是「把東西移動到新位置」的另一種說法
我們已經使用了 Three.js 的平移來搬移喝水鳥模型的零件
Three.js 的所有物件有內建平移與其他座標變換
這段程式我們將球的中心移動到 (0, 540, 0),這是個向量
這個球上的所有點都移動 (0, 540, 0) 這個向量到新位置
這段程式做了一樣的事,只有這行變了
這個 Y 座標明顯可以是任意數字的和或乘積
我想提的是這樣加總數字等同是在加總向量的座標
這裡有向量 (0, 160, 0) 跟向量 (0, 390, 0)
加起來是 (0, 540, 0)
平移可以像這樣當數字操作
你可以以任何順序加總它們得到最終的總和平移向量
然後取得最終位置