未验证 提交 041503d1 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #18182 from AnHongpeng/patch-4

Zh Docs: fix the translation of `Face3`.
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
<h1>[name]</h1> <h1>[name]</h1>
<p class="desc"> <p class="desc">
在 [page:Geometry] 中被使用到的三角面片。这些三角面片会为所有标准几何体自动创建。 在 [page:Geometry] 中被使用到的三角形面。这些三角形面会为所有标准几何体自动创建。
然而,如果你正在构建一个自定义几何体,你需要手动创建这些三角面片 然而,如果你正在构建一个自定义几何体,你需要手动创建这些三角形面
</p> </p>
...@@ -26,22 +26,22 @@ ...@@ -26,22 +26,22 @@
<code> <code>
var material = new THREE.MeshStandardMaterial( { color : 0x00cc00 } ); var material = new THREE.MeshStandardMaterial( { color : 0x00cc00 } );
//创建仅有一个三角面片的几何体 // 创建仅有一个三角形面的几何体
var geometry = new THREE.Geometry(); var geometry = new THREE.Geometry();
geometry.vertices.push( new THREE.Vector3( -50, -50, 0 ) ); geometry.vertices.push( new THREE.Vector3( -50, -50, 0 ) );
geometry.vertices.push( new THREE.Vector3( 50, -50, 0 ) ); geometry.vertices.push( new THREE.Vector3( 50, -50, 0 ) );
geometry.vertices.push( new THREE.Vector3( 50, 50, 0 ) ); geometry.vertices.push( new THREE.Vector3( 50, 50, 0 ) );
//利用顶点 0, 1, 2 创建一个面 // 利用顶点 0, 1, 2 创建一个面
var normal = new THREE.Vector3( 0, 1, 0 ); //optional var normal = new THREE.Vector3( 0, 1, 0 ); //optional
var color = new THREE.Color( 0xffaa00 ); //optional var color = new THREE.Color( 0xffaa00 ); //optional
var materialIndex = 0; //optional var materialIndex = 0; //optional
var face = new THREE.Face3( 0, 1, 2, normal, color, materialIndex ); var face = new THREE.Face3( 0, 1, 2, normal, color, materialIndex );
//将创建的面添加到几何体的面的队列 // 将创建的面添加到几何体的面的队列
geometry.faces.push( face ); geometry.faces.push( face );
//如果没有特别指明,面和顶点的法向量可以通过如下代码自动计算 // 如果没有特别指明,面和顶点的法向量可以通过如下代码自动计算
geometry.computeFaceNormals(); geometry.computeFaceNormals();
geometry.computeVertexNormals(); geometry.computeVertexNormals();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册