Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Improve Chinese translation. #27032

Merged
merged 4 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 25 additions & 19 deletions docs/api/zh/geometries/BoxGeometry.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@
<meta charset="utf-8" />
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
<link
type="text/css"
rel="stylesheet"
href="page.css" />
cswwww marked this conversation as resolved.
Show resolved Hide resolved
</head>
<body>
[page:BufferGeometry] &rarr;

<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 +38,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 );
scene.add( cube );
</code>
<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
23 changes: 16 additions & 7 deletions docs/api/zh/helpers/AxesHelper.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,31 @@ <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>

<h2>源码</h2>
<h3>
[method:this setColors]( [param:Color xAxisColor], [param:Color yAxisColor], [param:Color zAxisColor] )
</h3>
<p>
将坐标轴颜色设置为 [page:Color xAxisColor], [page:Color yAxisColor],
[page:Color zAxisColor].
</p>
<h3>[method:undefined dispose]()</h3>
<p>
释放分配至此实例的 GPU 相关资源。当应用程序中不再使用此实例时,请调用此方法。
</p>

<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>