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

Feat: translate three docs into Chinese version #23262

Merged
merged 1 commit into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
45 changes: 20 additions & 25 deletions docs/examples/zh/utils/BufferGeometryUtils.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,71 +10,66 @@
<h1>[name]</h1>

<p class="desc">
A class containing utility functions for [page:BufferGeometry BufferGeometry] instances.
一个包含 [page:BufferGeometry BufferGeometry] 实例的实用方法的类。
</p>


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

<h3>[method:BufferGeometry mergeBufferGeometries]( [param:Array geometries], [param:Boolean useGroups] )</h3>
<p>
geometries -- Array of [page:BufferGeometry BufferGeometry] instances.<br />
useGroups -- Whether groups should be generated for the merged geometry or not.<br /><br />
geometries -- [page:BufferGeometry BufferGeometry] 实例的数组。<br />
useGroups -- 是否要为了合并几何体而产生组。<br /><br />

Merges a set of geometries into a single instance. All geometries must have compatible attributes.
If merge does not succeed, the method returns null.
将一组几何体合并到一个实例中。所有几何体都必须兼容该属性。
如果合并不成功,则该方法返回 null

</p>

<h3>[method:BufferAttribute mergeBufferAttributes]( [param:Array attributes] )</h3>
<p>
attributes -- Array of [page:BufferAttribute BufferAttribute] instances.<br /><br />
attributes -- [page:BufferAttribute BufferAttribute] 实例组成的数组。<br /><br />

Merges a set of attributes into a single instance. All attributes must have compatible properties
and types, and [page:InterleavedBufferAttribute InterleavedBufferAttributes] are not supported. If merge does not succeed, the method
returns null.
将一组属性合并为一个单一的实例。所有几何体都必须兼容该属性,不支持 [page:InterleavedBufferAttribute InterleavedBufferAttributes] 。
如果合并不成功,则该方法返回 null 。

</p>

<h3>[method:InterleavedBufferAttribute interleaveAttributes]( [param:Array attributes] )</h3>
<p>
attributes -- Array of [page:BufferAttribute BufferAttribute] instances.<br /><br />
attributes -- [page:BufferAttribute BufferAttribute] 实例组成的数组。<br /><br />

Interleaves a set of attributes and returns a new array of corresponding attributes that share
a single InterleavedBuffer instance. All attributes must have compatible types. If merge does not
succeed, the method returns null.
交叉存储一组属性并返回一个新的对应属性数组,这些属性共享一个 InterleavedBuffer 实例。所有属性都必须兼容的该类型。如果合并不成功,则该方法返回 null 。

</p>

<h3>[method:Number estimateBytesUsed]( [param:BufferGeometry geometry] )</h3>
<p>
geometry -- Instance of [page:BufferGeometry BufferGeometry] to estimate the memory use of.<br /><br />
geometry -- 通过 [page:BufferGeometry BufferGeometry] 的实例来估计内存使用情况。<br /><br />

Returns the amount of bytes used by all attributes to represent the geometry.
返回所有用于表示几何体的属性所占用的字节数。

</p>

<h3>[method:BufferGeometry mergeVertices]( [param:BufferGeometry geometry], [param:Number tolerance] )</h3>
<p>
geometry -- Instance of [page:BufferGeometry BufferGeometry] to merge the vertices of.<br />
tolerance -- The maximum allowable difference between vertex attributes to merge. Defaults to 1e-4.<br /><br />
geometry -- 用于合并顶点的 [page:BufferGeometry BufferGeometry] 实例。<br />
tolerance -- 要合并的顶点属性之间允许的最大差异。 默认为 1e-4<br /><br />

Returns a new [page:BufferGeometry BufferGeometry] with vertices for which all similar vertex attributes
(within tolerance) are merged.
返回一个新的 [page:BufferGeometry BufferGeometry] ,其中包含将所有(在容差范围内的)具有相似属性的顶点合并而成的顶点。

</p>

<h3>[method:BufferGeometry toTrianglesDrawMode]( [param:BufferGeometry geometry], [param:TrianglesDrawMode drawMode] )</h3>
<p>
geometry -- Instance of [page:BufferGeometry BufferGeometry].<br />
drawMode -- The draw mode of the given geometry.<br /><br />
geometry -- [page:BufferGeometry BufferGeometry] 实例。<br />
drawMode -- 给定几何体的绘制模式。<br /><br />

Returns a new indexed [page:BufferGeometry BufferGeometry] based on the [page:DrawModes THREE.TrianglesDrawMode] draw mode. This mode
corresponds to the *gl.TRIANGLES* WebGL primitive.
基于 [page:DrawModes THREE.TrianglesDrawMode] 绘制模式,返回一个新的有索引值的 [page:BufferGeometry BufferGeometry]。 此模式对应于 WebGL 的原始术语 *gl.TRIANGLES* 。

</p>

<h2>Source</h2>
<h2></h2>

<p>
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/utils/BufferGeometryUtils.js examples/jsm/utils/BufferGeometryUtils.js]
Expand Down
20 changes: 10 additions & 10 deletions docs/examples/zh/utils/SceneUtils.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>场景工具([name]</h1>

<p class="desc">A class containing useful utility functions for scene manipulation.</p>
<p class="desc">一个用于操控场景的实用类。</p>


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

<h3>[method:Group createMeshesFromInstancedMesh]( [param:InstancedMesh instancedMesh] )</h3>
<p>
instancedMesh -- The instanced mesh.
instancedMesh -- 实例化网格。
</p>
<p>
Creates a new group object that contains a new mesh for each instance of the given instanced mesh.
为给定的实例化网格的每个实例,创建一个包含新网格的新物体组(Object Group)。
</p>

<h3>[method:Group createMultiMaterialObject]( [param:BufferGeometry geometry], [param:Array materials] )</h3>
<p>
geometry -- The geometry for the set of materials. <br />
materials -- The materials for the object.
geometry -- 材料集的几何形状。 <br />
materials -- 为物体准备的材料。
</p>
<p>
Creates a new Group that contains a new mesh for each material defined in materials. Beware that this is not the same as an array of materials which defines multiple materials for 1 mesh.<br />
This is mostly useful for objects that need both a material and a wireframe implementation.
创建一个新组,囊括了在材质中定义的每种材质的新网格。请注意,这和为一个网格定义多种材质的材质数组不同。<br />
该方法对于同时需要材质和线框绘制的物体非常有用。
</p>

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

<p>
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/utils/SceneUtils.js examples/jsm/utils/SceneUtils.js]
Expand Down
14 changes: 5 additions & 9 deletions docs/examples/zh/utils/SkeletonUtils.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,15 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>骨架工具([name]</h1>

<p class="desc">Utility functions for [page:Skeleton], [page:SkinnedMesh], and [page:Bone] manipulation.</p>
<p class="desc">用于操控 [page:Skeleton] [page:SkinnedMesh]、和 [page:Bone] 的实用方法。</p>


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

<h3>[method:Object3D clone]( [param:Object3D object] )</h3>
<p>
Clones the given object and its descendants, ensuring that any [page:SkinnedMesh] instances
are correctly associated with their bones. Bones are also cloned, and must be descendants of
the object passed to this method. Other data, like geometries and materials, are reused by
reference.
克隆给定对象及其后代,确保任何 [page:SkinnedMesh] 实例都与其骨骼正确关联。同时,骨骼也会被克隆,且必须是传递给此方法的物体的后代。而其他数据,如几何形状和材料,是通过引用来实现重复使用的。
</p>

<h3>[method:Object findBoneTrackData]( [param:String name], [param:Array tracks] )</h3>
Expand Down Expand Up @@ -52,7 +48,7 @@ <h3>[method:undefined retarget]( [param:SkeletonHelper target], [param:SkeletonH
<h3>[method:AnimationClip retargetClip]( [param:SkeletonHelper target], [param:SkeletonHelper source], [param:AnimationClip clip], [param:Object options] )</h3>
<p></p>

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

<p>
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/utils/SkeletonUtils.js examples/jsm/utils/SkeletonUtils.js]
Expand Down