Skip to content

Commit

Permalink
Docs: Improve Chinese translation. (mrdoob#27032)
Browse files Browse the repository at this point in the history
* Docs: Improve Chinese translation.

* Update several Chinese documentation pages

* Update BoxGeometry.html

* Update BoxGeometry.html
  • Loading branch information
cswwww authored Oct 23, 2023
1 parent 4b48a81 commit 1978da5
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 55 deletions.
35 changes: 19 additions & 16 deletions docs/api/zh/geometries/BoxGeometry.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

<h1>立方缓冲几何体([name])</h1>

<p class="desc">[name]是四边形的原始几何类,它通常使用构造函数所提供的“width”、“height”、“depth”参数来创建立方体或者不规则四边形。</p>
<p class="desc">
[name] 是四边形的原始几何类,它通常使用构造函数所提供的 “width”、“height”、“depth” 参数来创建立方体或者不规则四边形。
</p>

<iframe id="scene" src="scenes/geometry-browser.html#BoxGeometry"></iframe>

Expand All @@ -33,36 +35,37 @@ <h1>立方缓冲几何体([name])</h1>

<h2>代码示例</h2>

<code>const geometry = new THREE.BoxGeometry( 1, 1, 1 );
const material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
const cube = new THREE.Mesh( geometry, material );
<code>
const geometry = new THREE.BoxGeometry( 1, 1, 1 );
const material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
const cube = new THREE.Mesh( geometry, material );
scene.add( cube );
</code>

<h2>构造器</h2>
<h2>构造函数(Constructor)</h2>

<h3>[name]([param:Float width], [param:Float height], [param:Float depth], [param:Integer widthSegments], [param:Integer heightSegments], [param:Integer depthSegments])</h3>
<p>
width — X轴上面的宽度,默认值为1<br />
height — Y轴上面的高度,默认值为1<br />
depth — Z轴上面的深度,默认值为1<br />
widthSegments — (可选)宽度的分段数,默认值是1<br />
heightSegments — (可选)高度的分段数,默认值是1<br />
depthSegments — (可选)深度的分段数,默认值是1
width — X 轴上面的宽度,默认值为 `1`<br />
height — Y 轴上面的高度,默认值为 `1`<br />
depth — Z 轴上面的深度,默认值为 `1`<br />
widthSegments — (可选)宽度的分段数,默认值是 `1`<br />
heightSegments — (可选)高度的分段数,默认值是 `1`<br />
depthSegments — (可选)深度的分段数,默认值是 `1`
</p>

<h2>属性</h2>
<p>共有属性请参见其基类[page:BufferGeometry]。</p>
<h2>属性(Properties)</h2>
<p>共有属性请参见其基类 [page:BufferGeometry]。</p>

<h3>[property:Object parameters]</h3>
<p>
一个包含着构造函数中每个参数的对象。在对象实例化之后,对该属性的任何修改都不会改变这个几何体。
</p>

<h2>方法(Methods)</h2>
<p>共有方法请参见其基类[page:BufferGeometry]。</p>
<h2>方法Methods</h2>
<p>共有方法请参见其基类 [page:BufferGeometry]。</p>

<h2>源代码</h2>
<h2>源码(Source)</h2>

<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
Expand Down
39 changes: 22 additions & 17 deletions docs/api/zh/geometries/PlaneGeometry.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ <h1>平面缓冲几何体([name])</h1>

<p class="desc">一个用于生成平面几何体的类。</p>

<iframe id="scene" src="scenes/geometry-browser.html#PlaneGeometry"></iframe>
<iframe
id="scene"
src="scenes/geometry-browser.html#PlaneGeometry"
></iframe>

<script>

Expand All @@ -30,37 +33,39 @@ <h1>平面缓冲几何体([name])</h1>
}

</script>

<h2>代码示例</h2>

<code>const geometry = new THREE.PlaneGeometry( 1, 1 );
const material = new THREE.MeshBasicMaterial( {color: 0xffff00, side: THREE.DoubleSide} );
const plane = new THREE.Mesh( geometry, material );
scene.add( plane );
<code>
const geometry = new THREE.PlaneGeometry( 1, 1 );
const material = new THREE.MeshBasicMaterial( {color: 0xffff00, side: THREE.DoubleSide} );
const plane = new THREE.Mesh( geometry, material );
scene.add( plane );
</code>

<h2>构造器</h2>
<h2>构造函数(Constructor)</h2>

<h3>[name]([param:Float width], [param:Float height], [param:Integer widthSegments], [param:Integer heightSegments])</h3>
<h3>
[name]([param:Float width], [param:Float height], [param:Integer widthSegments], [param:Integer heightSegments])
</h3>
<p>
width — 平面沿着X轴的宽度。默认值是1<br />
height — 平面沿着Y轴的高度。默认值是1<br />
widthSegments — (可选)平面的宽度分段数,默认值是1<br />
heightSegments — (可选)平面的高度分段数,默认值是1
width — 平面沿着 X 轴的宽度。默认值是 `1`<br />
height — 平面沿着 Y 轴的高度。默认值是 `1`<br />
widthSegments — (可选)平面的宽度分段数,默认值是 `1`<br />
heightSegments — (可选)平面的高度分段数,默认值是 `1`
</p>

<h2>属性</h2>
<p>共有属性请参见其基类[page:BufferGeometry]。</p>
<h2>属性(Properties)</h2>
<p>共有属性请参见其基类 [page:BufferGeometry]。</p>

<h3>.parameters</h3>
<h3>[property:Object parameters]</h3>
<p>
一个包含着构造函数中每个参数的对象。在对象实例化之后,对该属性的任何修改都不会改变这个几何体。
</p>

<h2>方法(Methods)</h2>
<h2>方法Methods</h2>
<p>共有方法请参见其基类[page:BufferGeometry]。</p>

<h2>源代码</h2>
<h2>源码(Source)</h2>

<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
Expand Down
13 changes: 5 additions & 8 deletions docs/api/zh/helpers/AxesHelper.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,16 @@ <h2>例子</h2>
[example:webgl_loader_nrrd WebGL / loader / nrrd]
</p>

<h2>构造函数</h2>


<h2>构造函数(Constructor)</h2>
<h3>[name]( [param:Number size] )</h3>
<p>
[page:Number size] -- (可选的) 表示代表轴的线段长度. 默认为 *1*.
[page:Number size] -- (可选的) 表示代表轴的线段长度. 默认为 `1`.
</p>

<h2>属性</h2>
<h2>属性(Properties)</h2>
<p>请到基类 [page:LineSegments] 页面查看公共属性.</p>

<h2>方法</h2>
<h2>方法(Methods)</h2>
<p>请到基类 [page:LineSegments] 页面查看公共方法.</p>

<h3>
Expand All @@ -55,8 +53,7 @@ <h3>[method:undefined dispose]()</h3>
释放此实例分配的GPU相关资源。每当应用程序中不再使用此实例时,请调用此方法。
</p>

<h2>源码</h2>

<h2>源码(Source)</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
Expand Down
33 changes: 19 additions & 14 deletions docs/manual/zh/introduction/WebGL-compatibility-check.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,28 @@
<body>
<h1>WebGL兼容性检查([name])</h1>
<p>
虽然这个问题现在已经变得越来不明显,但不可否定的是,某些设备以及浏览器直到现在仍然不支持WebGL。<br>以下的方法可以帮助你检测当前用户所使用的环境是否支持WebGL,如果不支持,将会向用户提示一条信息。
虽然这个问题现在已经变得越来不明显,但不可否定的是,某些设备以及浏览器直到现在仍然不支持WebGL。
<br>以下的方法可以帮助你检测当前用户所使用的环境是否支持WebGL,如果不支持,将会向用户提示一条信息。
</p>

<p>
请将[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/capabilities/WebGL.js]引入到你的文件,并在尝试开始渲染之前先运行该文件。
</p>

<code>
if (WebGL.isWebGLAvailable()) {
// Initiate function or other initializations here
animate();
} else {
const warning = WebGL.getWebGLErrorMessage();
document.getElementById('container').appendChild(warning);
}
</code>

导入 WebGL 兼容检测模块,并在尝试渲染任何内容之前运行以下程序。
</p>

<code>
import WebGL from 'three/addons/capabilities/WebGL.js';

if ( WebGL.isWebGLAvailable() ) {

// Initiate function or other initializations here
animate();

} else {

const warning = WebGL.getWebGLErrorMessage();
document.getElementById( 'container' ).appendChild( warning );

}
</code>
</body>
</html>

0 comments on commit 1978da5

Please sign in to comment.