|
@@ -2,11 +2,15 @@ Title: Three.jsのカスタムバッファジオメトリ
|
|
|
Description: カスタムバッファジオメトリを作る
|
|
|
TOC: カスタムバッファジオメトリ
|
|
|
|
|
|
+[前回の記事](threejs-custom-geometry.html)では`Geometry`を紹介しました。この記事では`BufferGeometry`を紹介します。`BufferGeometry`とは*一般的に*高速で動きメモリ消費も低く抑えられます。が、設定は少し難しいです。
|
|
|
+
|
|
|
A [previous article](threejs-custom-geometry.html) covered
|
|
|
how to use `Geometry`. This article is about `BufferGeometry`.
|
|
|
`BufferGeometry` is *generally* faster to start and uses
|
|
|
less memory but can be harder to setup.
|
|
|
|
|
|
+[ジオメトリの記事](threejs-custom-geometry.html) のおさらいをしましょう。`Geometry`には`Vector3`を設定する必要がありました。これは頂点を表す三次元上の点です。次に`Face3`を設定することで面を定義しました。これはvertexの配列のインデックス情報を使って3つの点を指定することで面を定義しています。光の反射方向などの設定するためにfaceにはnormal(法線)が必要でした。faceに対して1つのnormalを設定することもできますし、vertexに指定して滑らかな面を擬似的に作ることもできました。colorもnormalと同じようにfaceに指定したりvertexに指定したりできました。記事の最後では配列の配列を使ってテクスチャ座標(UV)を設定しました。配列の中の配列の1つが1つのfaceに対応しておりその配列の1つの要素がvertex1つに対応しています。
|
|
|
+
|
|
|
In [the article on Geometry](threejs-custom-geometry.html) we went over that to use a `Geometry` you supply an
|
|
|
array of `Vector3` vertices (positions). You then make `Face3` objects specifying
|
|
|
by index the 3 vertices that make each triangle of the shape you're making. To
|