Skip to content

Commit

Permalink
Docs: Improve Chinese translation. (mrdoob#29406)
Browse files Browse the repository at this point in the history
  • Loading branch information
puxiao committed Sep 14, 2024
1 parent b06a2e9 commit 5a3fb41
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 111 deletions.
15 changes: 0 additions & 15 deletions docs/examples/zh/controls/DragControls.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,6 @@ <h2>方法</h2>

<p>共有方法请参见其基类[page:Controls]。</p>

<h3>[method:undefined connect] ()</h3>
<p>
添加控制器的事件监听。
</p>

<h3>[method:undefined disconnect] ()</h3>
<p>
移除控制器的事件监听。
</p>

<h3>[method:undefined dispose] ()</h3>
<p>
若不再需要该控制器,则应当调用此函数。
</p>

<h2>源代码</h2>

<p>
Expand Down
56 changes: 26 additions & 30 deletions docs/examples/zh/controls/OrbitControls.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Controls] &rarr;

<h1>轨道控制器([name])</h1>

<p class="desc">
Expand Down Expand Up @@ -67,7 +69,7 @@ <h3>[name]( [param:Camera object], [param:HTMLDOMElement domElement] )</h3>
<p>
[page:Camera object]: (必须)将要被控制的相机。该相机不允许是其他任何对象的子级,除非该对象是场景自身。<br><br>

[page:HTMLDOMElement domElement]: 用于事件监听的HTML元素。
[page:HTMLDOMElement domElement]: 用于事件监听的HTML元素。(可选)
</p>

<h2>Events</h2>
Expand All @@ -89,12 +91,13 @@ <h3>end</h3>

<h2>属性</h2>

<p>共有属性请参见其基类[page:Controls]。</p>

<h3>[property:Boolean autoRotate]</h3>
<p>
将其设为true,以自动围绕目标旋转。<br>
请注意,如果它被启用,你必须在你的动画循环里调用[page:.update]()。
Set to true to automatically rotate around the target.<br> Note that if this is enabled, you must call [page:.update]
() in your animation loop. If you want the auto-rotate speed to be independent of the frame rate (the refresh rate of the display), you must pass the time `deltaTime`, in seconds, to [page:.update]().
如果希望自动旋转速度与帧速率(显示器的刷新率)无关,则必须将时间 `deltaTime`(以秒为单位)传递给 [page:.update]()。
</p>

<h3>[property:Float autoRotateSpeed]</h3>
Expand All @@ -110,16 +113,6 @@ <h3>
请注意,要使得这一值生效,你必须在你的动画循环里调用[page:.update]()。
</p>

<h3>[property:HTMLDOMElement domElement]</h3>
<p>
该 HTMLDOMElement 用于监听鼠标/触摸事件,该属性必须在构造函数中传入。在此处改变它将不会设置新的事件监听。
</p>

<h3>[property:Boolean enabled]</h3>
<p>
当设置为false时,控制器将不会响应用户的操作。默认值为true。
</p>

<h3>[property:Boolean enableDamping]</h3>
<p>
将其设置为true以启用阻尼(惯性),这将给控制器带来重量感。默认值为false。<br>
Expand Down Expand Up @@ -177,6 +170,11 @@ <h3>[property:Float maxPolarAngle]</h3>
你能够垂直旋转的角度的上限,范围是0到Math.PI,其默认值为Math.PI。
</p>

<h3>[property:Float maxTargetRadius]</h3>
<p>
你能够让目标移动离 [page:.cursor] 有多远,其默认值为Infinity。
</p>

<h3>[property:Float maxZoom]</h3>
<p>
你能够将相机缩小多少(仅适用于[page:OrthographicCamera]),其默认值为Infinity。
Expand All @@ -197,6 +195,11 @@ <h3>[property:Float minPolarAngle]</h3>
你能够垂直旋转的角度的下限,范围是0到Math.PI,其默认值为0。
</p>

<h3>[property:Float minTargetRadius]</h3>
<p>
你能够让目标移动离 [page:.cursor] 有多近,其默认值为0。
</p>

<h3>[property:Float minZoom]</h3>
<p>
你能够将相机放大多少(仅适用于[page:OrthographicCamera]),其默认值为0。
Expand All @@ -215,11 +218,6 @@ <h3>
</code>
</p>

<h3>[property:Camera object]</h3>
<p>
正被控制的摄像机。
</p>

<h3>[property:Float panSpeed]</h3>
<p>
位移的速度,其默认值为1。
Expand Down Expand Up @@ -253,6 +251,11 @@ <h3>[property:Vector3 target]</h3>
它可以在任何时候被手动更新,以更改控制器的焦点。
</p>

<h3>[property:Vector3 cursor]</h3>
<p>
被 [page:.minTargetRadius] 和 [page:.maxTargetRadius] 限制的焦点。可随时手动更新以更改 [page:.target] 的兴趣中心。
</p>

<h3>[property:Object touches]</h3>
<p>
该对象包含由控件所使用的触摸操作的引用。
Expand All @@ -276,15 +279,12 @@ <h3>[property:Float zoomSpeed]</h3>

<h3>[property:Boolean zoomToCursor]</h3>
<p>
Setting this property to `true` allows to zoom to the cursor's position. Default is `false`.
将此属性设置为 `true` 可以缩放至光标位置。默认值为 `false`
</p>

<h2>Methods</h2>
<h2>方法</h2>

<h3>[method:undefined dispose] ()</h3>
<p>
移除所有的事件监听。
</p>
<p>共有方法请参见其基类[page:Controls]。</p>

<h3>[method:radians getAzimuthalAngle] ()</h3>
<p>
Expand All @@ -298,7 +298,7 @@ <h3>[method:radians getPolarAngle] ()</h3>

<h3>[method:Float getDistance] ()</h3>
<p>
Returns the distance from the camera to the target.
返回从相机到目标的距离。
</p>

<h3>[method:undefined listenToKeyEvents] ( [param:HTMLDOMElement domElement] )</h3>
Expand All @@ -323,11 +323,7 @@ <h3>[method:undefined stopListenToKeyEvents] ()</h3>

<h3>[method:Boolean update] ( [param:Number deltaTime] )</h3>
<p>
更新控制器。必须在摄像机的变换发生任何手动改变后调用,
或如果[page:.autoRotate]或[page:.enableDamping]被设置时,在update循环里调用。
Update the controls. Must be called after any manual changes to the camera's transform,
or in the update loop if [page:.autoRotate] or [page:.enableDamping] are set. `deltaTime`, in seconds, is optional,
and is only required if you want the auto-rotate speed to be independent of the frame rate (the refresh rate of the display).
更新控制器。必须在摄像机的变换发生任何手动改变后调用,或如果[page:.autoRotate]或[page:.enableDamping]被设置时,在update循环里调用。`deltaTime` 以秒为单位,是可选的,并且仅当您希望自动旋转速度独立于帧速率(显示器的刷新率)时才是必需的。
</p>

<h2>源代码</h2>
Expand Down
5 changes: 5 additions & 0 deletions docs/examples/zh/controls/PointerLockControls.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ <h3>[property:Float minPolarAngle]</h3>
摄像机的俯仰角下限限制。范围为0到Math.PI弧度之间。默认值为0。
</p>

<h3>[property:Float pointerSpeed]</h3>
<p>
指针移动对相机旋转的影响程度的乘数。默认值为1。
</p>

<h2>方法</h2>

<p>共有方法请参见其基类[page:Controls]。</p>
Expand Down
54 changes: 9 additions & 45 deletions docs/examples/zh/controls/TrackballControls.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:EventDispatcher] &rarr;
[page:Controls] &rarr;

<h1>轨迹球控制器([name])</h1>

Expand Down Expand Up @@ -41,7 +41,7 @@ <h3>[name]( [param:Camera camera], [param:HTMLDOMElement domElement] )</h3>
[page:Camera camera]: 渲染场景的摄像机。
</p>
<p>
[page:HTMLDOMElement domElement]: 用于事件监听的HTML元素。
[page:HTMLDOMElement domElement]: 用于事件监听的HTML元素。(可选)
</p>
<p>
创建一个新的 [name] 实例。
Expand All @@ -67,21 +67,13 @@ <h3>end</h3>

<h2>属性</h2>

<h3>[property:HTMLDOMElement domElement]</h3>
<p>
该 HTMLDOMElement 用于监听鼠标/触摸事件,该属性必须在构造函数中传入。在此处改变它将不会设置新的事件监听。
</p>
<p>共有属性请参见其基类[page:Controls]。</p>

<h3>[property:Number dynamicDampingFactor]</h3>
<p>
设置阻尼的强度。仅在[page:.staticMoving staticMoving]设为*false*时考虑。默认为*0.2*。
</p>

<h3>[property:Boolean enabled]</h3>
<p>
是否启用控制器。
</p>

<h3>[property:Array keys]</h3>
<p>
该数组包含用于控制交互的按键代码。
Expand Down Expand Up @@ -139,11 +131,6 @@ <h3>[property:Boolean noZoom]</h3>
是否禁用缩放,默认为*false*。
</p>

<h3>[property:Camera object]</h3>
<p>
正被控制的摄像机。
</p>

<h3>[property:Number panSpeed]</h3>
<p>
平移的速度,其默认值为*0.3*。
Expand All @@ -170,53 +157,30 @@ <h3>[property:Boolean staticMoving]</h3>
阻尼是否被禁用。默认为*false*。
</p>

<h3>[property:Vector3 target]</h3>
<p>
控件的焦点。
</p>

<h3>[property:Number zoomSpeed]</h3>
<p>
缩放的速度,其默认值为*1.2*。
</p>

<h2>方法</h2>

<h3>[method:undefined checkDistances] ()</h3>
<p>
确保控制器位于 [minDistance, maxDistance] 范围内。由[page:.update update]()调用。
</p>

<h3>[method:undefined dispose] ()</h3>
<p>
若不再需要该控制器,则应当调用此函数。
</p>
<p>共有方法请参见其基类[page:Controls]。</p>

<h3>[method:undefined handleResize] ()</h3>
<p>
若应用程序窗口大小发生改变,则应当调用此函数。
</p>

<h3>[method:undefined panCamera] ()</h3>
<p>
如有必要,执行平移。由[page:.update update]()调用。
</p>

<h3>[method:undefined reset] ()</h3>
<p>
重置控制器到初始状态。
</p>

<h3>[method:undefined rotateCamera] ()</h3>
<p>
如有必要,旋转相机。由[page:.update update]()调用。
</p>

<h3>[method:undefined update] ()</h3>
<p>
更新控制器,常被用在动画循环中。
</p>

<h3>[method:undefined zoomCamera] ()</h3>
<p>
如有必要,执行缩放。由[page:.update update]()调用。
</p>

<h2>源代码</h2>

<p>
Expand Down
32 changes: 11 additions & 21 deletions docs/examples/zh/controls/TransformControls.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Object3D] &rarr;
[page:Controls] &rarr;

<h1>变换控制器([name])</h1>

Expand Down Expand Up @@ -41,7 +41,7 @@ <h3>[name]( [param:Camera camera], [param:HTMLDOMElement domElement] )</h3>
[page:Camera camera]: 被控制的摄像机。
</p>
<p>
[page:HTMLDOMElement domElement]: 用于事件监听的HTML元素。
[page:HTMLDOMElement domElement]: 用于事件监听的HTML元素。(可选)
</p>
<p>
创建一个新的 [name] 实例。
Expand Down Expand Up @@ -73,7 +73,7 @@ <h3>objectChange</h3>

<h2>属性</h2>

<p>共有属性请参见其基类[page:Object3D]。</p>
<p>共有属性请参见其基类[page:Controls]。</p>

<h3>[property:String axis]</h3>
<p>
Expand All @@ -85,31 +85,16 @@ <h3>[property:Camera camera]</h3>
渲染场景的摄像机。
</p>

<h3>[property:HTMLDOMElement domElement]</h3>
<p>
该 HTMLDOMElement 用于监听鼠标/触摸事件,该属性必须在构造函数中传入。在此处改变它将不会设置新的事件监听。
</p>

<h3>[property:Boolean dragging]</h3>
<p>
当前是否正在拖动。只读属性。
</p>

<h3>[property:Boolean enabled]</h3>
<p>
是否启用控制器。默认为*true*。
</p>

<h3>[property:String mode]</h3>
<p>
当前的变换模式。可能的值包括"translate"、"rotate" 和 "scale"。默认为*translate*。
</p>

<h3>[property:Object3D object]</h3>
<p>
正在被控制的3D对象。
</p>

<h3>[property:Number rotationSnap]</h3>
<p>
默认情况下,3D对象是可以被连续旋转的。如果你将该值设为一个数值(弧度),则你将可以定义每次旋转3D对象时的步幅。
Expand Down Expand Up @@ -149,7 +134,7 @@ <h3>[property:Number translationSnap]</h3>

<h2>方法</h2>

<p>共有方法请参见其基类[page:Object3D]。</p>
<p>共有方法请参见其基类[page:Controls]。</p>

<h3>[method:TransformControls attach] ( [param:Object3D object] )</h3>
<p>
Expand All @@ -166,9 +151,9 @@ <h3>[method:TransformControls detach] ()</h3>
从控制器中移除当前3D对象,并确保控制器UI是不可见的。
</p>

<h3>[method:undefined dispose] ()</h3>
<h3>[method:Object3D getHelper] ()</h3>
<p>
若不再需要该控制器,则应当调用此函数
返回控件的视觉表示。将辅助对象添加到场景中,以直观地变换附着的3D对象
</p>

<h3>[method:Raycaster getRaycaster] ()</h3>
Expand All @@ -182,6 +167,11 @@ <h3>[method:String getMode] ()</h3>
<p>
返回变换模式。
</p>

<h3>[method:undefined reset] ()</h3>
<p>
将对象的位置、旋转和缩放重置为当前变换开始时的状态。
</p>

<h3>[method:undefined setMode] ( [param:String mode] )</h3>
<p>
Expand Down

0 comments on commit 5a3fb41

Please sign in to comment.