Michael Herzog 2 gadi atpakaļ
vecāks
revīzija
f650053ce9

+ 57 - 60
docs/examples/en/utils/BufferGeometryUtils.html

@@ -16,33 +16,52 @@
 
 		<h2>Methods</h2>
 
-		<h3>[method:BufferGeometry toCreasedNormals]( [param:BufferGeometry geometry], [param:Number creaseAngle] )</h3>
+		<h3>[method:Object computeMikkTSpaceTangents]( [param:BufferGeometry geometry], [param:Object MikkTSpace], [param:Boolean negateSign] = true )</h3>
+		<ul>
+			<li>geometry -- Instance of [page:BufferGeometry].</li>
+			<li>MikkTSpace -- Instance of <i>examples/jsm/libs/mikktspace.module.js</i>, or <i>mikktspace</i> npm package. Await <i>MikkTSpace.ready</i> before use.
+			<li>negateSign -- Whether to negate the sign component (.w) of each tangent. Required for normal map conventions in some formats, including glTF.</li>
+		</ul>
+
 		<p>
-			geometry -- The input geometry. <br />
-			creaseAngle -- The crease angle.
+		Computes vertex tangents using the [link:http://www.mikktspace.com/ MikkTSpace] algorithm.
+		MikkTSpace generates the same tangents consistently, and is used in most modelling tools and
+		normal map bakers. Use MikkTSpace for materials with normal maps, because inconsistent
+		tangents may lead to subtle visual issues in the normal map, particularly around mirrored
+		UV seams.
 		</p>
+
 		<p>
-		Creates a new, non-indexed geometry with smooth normals everywhere except faces that meet at an angle greater than the crease angle.
+		In comparison to this method, [page:BufferGeometry.computeTangents] (a
+		custom algorithm) generates tangents that probably will not match the tangents
+		in other software. The custom algorithm is sufficient for general use with a
+		[page:ShaderMaterial], and may be faster than MikkTSpace.
 		</p>
 
-		<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 />
+		Returns the original [page:BufferGeometry]. Indexed geometries will be de-indexed.
+		Requires position, normal, and uv attributes.
+		</p>
 
-		Merges a set of geometries into a single instance. All geometries must have compatible attributes.
-		If merge does not succeed, the method returns null.
+		<h3>[method:Object computeMorphedAttributes]( [param:Mesh | Line | Points object] )</h3>
+		<p>
+		object -- Instance of [page:Mesh Mesh] | [page:Line Line] | [page:Points Points].<br /><br />
 
+		Returns the current attributes (Position and Normal) of a morphed/skinned [page:Object3D Object3D] whose geometry is a
+		[page:BufferGeometry BufferGeometry], together with the original ones: An Object with 4 properties:
+		`positionAttribute`, `normalAttribute`, `morphedPositionAttribute` and `morphedNormalAttribute`.
+
+		Helpful for Raytracing or Decals (i.e. a [page:DecalGeometry DecalGeometry] applied to a morphed Object
+		with a [page:BufferGeometry BufferGeometry] will use the original BufferGeometry, not the morphed/skinned one,
+		generating an incorrect result.
+		Using this function to create a shadow Object3D the DecalGeometry can be correctly generated).
 		</p>
 
-		<h3>[method:BufferAttribute mergeBufferAttributes]( [param:Array attributes] )</h3>
+		<h3>[method:Number estimateBytesUsed]( [param:BufferGeometry geometry] )</h3>
 		<p>
-		attributes -- Array of [page:BufferAttribute BufferAttribute] instances.<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.
+		geometry -- Instance of [page:BufferGeometry BufferGeometry] to estimate the memory use of.<br /><br />
 
+		Returns the amount of bytes used by all attributes to represent the geometry.
 		</p>
 
 		<h3>[method:InterleavedBufferAttribute interleaveAttributes]( [param:Array attributes] )</h3>
@@ -55,11 +74,23 @@
 
 		</p>
 
-		<h3>[method:Number estimateBytesUsed]( [param:BufferGeometry geometry] )</h3>
+		<h3>[method:BufferAttribute mergeBufferAttributes]( [param:Array attributes] )</h3>
 		<p>
-		geometry -- Instance of [page:BufferGeometry BufferGeometry] to estimate the memory use of.<br /><br />
+		attributes -- Array of [page:BufferAttribute BufferAttribute] instances.<br /><br />
 
-		Returns the amount of bytes used by all attributes to represent the geometry.
+		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.
+
+		</p>
+
+		<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 />
+
+		Merges a set of geometries into a single instance. All geometries must have compatible attributes.
+		If merge does not succeed, the method returns null.
 
 		</p>
 
@@ -80,54 +111,20 @@
 
 		</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. Valid inputs are `THREE.TriangleStripDrawMode` and `THREE.TriangleFanDrawMode`.<br /><br />
-
-		Returns a new indexed geometry based on `THREE.TrianglesDrawMode` draw mode. This mode corresponds to the `gl.TRIANGLES` WebGL primitive.
-		</p>
-
-		<h3>[method:Object computeMorphedAttributes]( [param:Mesh | Line | Points object] )</h3>
+		<h3>[method:BufferGeometry toCreasedNormals]( [param:BufferGeometry geometry], [param:Number creaseAngle] )</h3>
 		<p>
-		object -- Instance of [page:Mesh Mesh] | [page:Line Line] | [page:Points Points].<br /><br />
-
-		Returns the current attributes (Position and Normal) of a morphed/skinned [page:Object3D Object3D] whose geometry is a
-		[page:BufferGeometry BufferGeometry], together with the original ones: An Object with 4 properties:
-		`positionAttribute`, `normalAttribute`, `morphedPositionAttribute` and `morphedNormalAttribute`.
-
-		Helpful for Raytracing or Decals (i.e. a [page:DecalGeometry DecalGeometry] applied to a morphed Object
-		with a [page:BufferGeometry BufferGeometry] will use the original BufferGeometry, not the morphed/skinned one,
-		generating an incorrect result.
-		Using this function to create a shadow Object3D the DecalGeometry can be correctly generated).
+		geometry -- The input geometry. <br />
+		creaseAngle -- The crease angle. <br /><br />
 
+		Creates a new, non-indexed geometry with smooth normals everywhere except faces that meet at an angle greater than the crease angle.
 		</p>
 
-		<h3>[method:Object computeMikkTSpaceTangents]( [param:BufferGeometry geometry], [param:Object MikkTSpace], [param:Boolean negateSign] = true )</h3>
-		<ul>
-			<li>geometry -- Instance of [page:BufferGeometry].</li>
-			<li>MikkTSpace -- Instance of <i>examples/jsm/libs/mikktspace.module.js</i>, or <i>mikktspace</i> npm package. Await <i>MikkTSpace.ready</i> before use.
-			<li>negateSign -- Whether to negate the sign component (.w) of each tangent. Required for normal map conventions in some formats, including glTF.</li>
-		</ul>
-
-		<p>
-		Computes vertex tangents using the [link:http://www.mikktspace.com/ MikkTSpace] algorithm.
-		MikkTSpace generates the same tangents consistently, and is used in most modelling tools and
-		normal map bakers. Use MikkTSpace for materials with normal maps, because inconsistent
-		tangents may lead to subtle visual issues in the normal map, particularly around mirrored
-		UV seams.
-		</p>
-
+		<h3>[method:BufferGeometry toTrianglesDrawMode]( [param:BufferGeometry geometry], [param:TrianglesDrawMode drawMode] )</h3>
 		<p>
-		In comparison to this method, [page:BufferGeometry.computeTangents] (a
-		custom algorithm) generates tangents that probably will not match the tangents
-		in other software. The custom algorithm is sufficient for general use with a
-		[page:ShaderMaterial], and may be faster than MikkTSpace.
-		</p>
+		geometry -- Instance of [page:BufferGeometry BufferGeometry].<br />
+		drawMode -- The draw mode of the given geometry. Valid inputs are `THREE.TriangleStripDrawMode` and `THREE.TriangleFanDrawMode`.<br /><br />
 
-		<p>
-		Returns the original [page:BufferGeometry]. Indexed geometries will be de-indexed.
-		Requires position, normal, and uv attributes.
+		Returns a new indexed geometry based on `THREE.TrianglesDrawMode` draw mode. This mode corresponds to the `gl.TRIANGLES` WebGL primitive.
 		</p>
 
 		<h2>Source</h2>

+ 58 - 58
docs/examples/zh/utils/BufferGeometryUtils.html

@@ -16,31 +16,53 @@
 
 		<h2>方法</h2>
 
-		<h3>[method:BufferGeometry toCreasedNormals]( [param:BufferGeometry geometry], [param:Number creaseAngle] )</h3>
+		<h3>[method:Object computeMikkTSpaceTangents]( [param:BufferGeometry geometry], [param:Object MikkTSpace], [param:Boolean negateSign] = true )</h3>
+		<ul>
+			<li>geometry -- Instance of [page:BufferGeometry].</li>
+			<li>MikkTSpace -- Instance of <i>examples/jsm/libs/mikktspace.module.js</i>, or <i>mikktspace</i> npm package. Await <i>MikkTSpace.ready</i> before use.
+			<li>negateSign -- Whether to negate the sign component (.w) of each tangent. Required for normal map conventions in some formats, including glTF.</li>
+		</ul>
+
 		<p>
-			geometry -- The input geometry. <br />
-			creaseAngle -- The crease angle.
+		Computes vertex tangents using the [link:http://www.mikktspace.com/ MikkTSpace] algorithm.
+		MikkTSpace generates the same tangents consistently, and is used in most modelling tools and
+		normal map bakers. Use MikkTSpace for materials with normal maps, because inconsistent
+		tangents may lead to subtle visual issues in the normal map, particularly around mirrored
+		UV seams.
 		</p>
+
 		<p>
-		Creates a new, non-indexed geometry with smooth normals everywhere except faces that meet at an angle greater than the crease angle.
+		In comparison to this method, [page:BufferGeometry.computeTangents] (a
+		custom algorithm) generates tangents that probably will not match the tangents
+		in other software. The custom algorithm is sufficient for general use with a
+		[page:ShaderMaterial], and may be faster than MikkTSpace.
 		</p>
 
-		<h3>[method:BufferGeometry mergeBufferGeometries]( [param:Array geometries], [param:Boolean useGroups] )</h3>
 		<p>
-		geometries -- 由 [page:BufferGeometry BufferGeometry] 实例的数组。<br />
-		useGroups -- 是否要为了合并几何体而产生组。<br /><br />
+		Returns the original [page:BufferGeometry]. Indexed geometries will be de-indexed.
+		Requires position, normal, and uv attributes.
+		</p>
 
-		将一组几何体合并到一个实例中。所有几何体都必须兼容该属性。
-		如果合并不成功,则该方法返回 null。
+		<h3>[method:Object computeMorphedAttributes]( [param:Mesh | Line | Points object] )</h3>
+		<p>
+		object -- Instance of [page:Mesh Mesh] | [page:Line Line] | [page:Points Points].<br /><br />
+
+		Returns the current attributes (Position and Normal) of a morphed/skinned [page:Object3D Object3D] whose geometry is a
+		[page:BufferGeometry BufferGeometry], together with the original ones: An Object with 4 properties:
+		`positionAttribute`, `normalAttribute`, `morphedPositionAttribute` and `morphedNormalAttribute`.
+
+		Helpful for Raytracing or Decals (i.e. a [page:DecalGeometry DecalGeometry] applied to a morphed Object
+		with a [page:BufferGeometry BufferGeometry] will use the original BufferGeometry, not the morphed/skinned one,
+		generating an incorrect result.
+		Using this function to create a shadow Object3D the DecalGeometry can be correctly generated).
 
 		</p>
 
-		<h3>[method:BufferAttribute mergeBufferAttributes]( [param:Array attributes] )</h3>
+		<h3>[method:Number estimateBytesUsed]( [param:BufferGeometry geometry] )</h3>
 		<p>
-		attributes -- 由 [page:BufferAttribute BufferAttribute] 实例组成的数组。<br /><br />
+		geometry -- 通过 [page:BufferGeometry BufferGeometry] 的实例来估计内存使用情况。<br /><br />
 
-		将一组属性合并为一个单一的实例。所有几何体都必须兼容该属性,不支持 [page:InterleavedBufferAttribute InterleavedBufferAttributes] 。
-		如果合并不成功,则该方法返回 null 。
+		返回所有用于表示几何体的属性所占用的字节数。
 
 		</p>
 
@@ -52,11 +74,22 @@
 
 		</p>
 
-		<h3>[method:Number estimateBytesUsed]( [param:BufferGeometry geometry] )</h3>
+		<h3>[method:BufferAttribute mergeBufferAttributes]( [param:Array attributes] )</h3>
 		<p>
-		geometry -- 通过 [page:BufferGeometry BufferGeometry] 的实例来估计内存使用情况。<br /><br />
+		attributes -- 由 [page:BufferAttribute BufferAttribute] 实例组成的数组。<br /><br />
 
-		返回所有用于表示几何体的属性所占用的字节数。
+		将一组属性合并为一个单一的实例。所有几何体都必须兼容该属性,不支持 [page:InterleavedBufferAttribute InterleavedBufferAttributes] 。
+		如果合并不成功,则该方法返回 null 。
+
+		</p>
+
+		<h3>[method:BufferGeometry mergeBufferGeometries]( [param:Array geometries], [param:Boolean useGroups] )</h3>
+		<p>
+		geometries -- 由 [page:BufferGeometry BufferGeometry] 实例的数组。<br />
+		useGroups -- 是否要为了合并几何体而产生组。<br /><br />
+
+		将一组几何体合并到一个实例中。所有几何体都必须兼容该属性。
+		如果合并不成功,则该方法返回 null。
 
 		</p>
 
@@ -76,57 +109,24 @@
 
 		</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. Valid inputs are `THREE.TriangleStripDrawMode` and `THREE.TriangleFanDrawMode`.<br /><br />
-
-		Returns a new indexed geometry based on `THREE.TrianglesDrawMode` draw mode. This mode corresponds to the `gl.TRIANGLES` WebGL primitive.
-		</p>
-
-		<h3>[method:Object computeMorphedAttributes]( [param:Mesh | Line | Points object] )</h3>
+		<h3>[method:BufferGeometry toCreasedNormals]( [param:BufferGeometry geometry], [param:Number creaseAngle] )</h3>
 		<p>
-		object -- Instance of [page:Mesh Mesh] | [page:Line Line] | [page:Points Points].<br /><br />
-
-		Returns the current attributes (Position and Normal) of a morphed/skinned [page:Object3D Object3D] whose geometry is a
-		[page:BufferGeometry BufferGeometry], together with the original ones: An Object with 4 properties:
-		`positionAttribute`, `normalAttribute`, `morphedPositionAttribute` and `morphedNormalAttribute`.
-
-		Helpful for Raytracing or Decals (i.e. a [page:DecalGeometry DecalGeometry] applied to a morphed Object
-		with a [page:BufferGeometry BufferGeometry] will use the original BufferGeometry, not the morphed/skinned one,
-		generating an incorrect result.
-		Using this function to create a shadow Object3D the DecalGeometry can be correctly generated).
-
+			geometry -- The input geometry. <br />
+			creaseAngle -- The crease angle.
 		</p>
-
-		<h3>[method:Object computeMikkTSpaceTangents]( [param:BufferGeometry geometry], [param:Object MikkTSpace], [param:Boolean negateSign] = true )</h3>
-		<ul>
-			<li>geometry -- Instance of [page:BufferGeometry].</li>
-			<li>MikkTSpace -- Instance of <i>examples/jsm/libs/mikktspace.module.js</i>, or <i>mikktspace</i> npm package. Await <i>MikkTSpace.ready</i> before use.
-			<li>negateSign -- Whether to negate the sign component (.w) of each tangent. Required for normal map conventions in some formats, including glTF.</li>
-		</ul>
-
 		<p>
-		Computes vertex tangents using the [link:http://www.mikktspace.com/ MikkTSpace] algorithm.
-		MikkTSpace generates the same tangents consistently, and is used in most modelling tools and
-		normal map bakers. Use MikkTSpace for materials with normal maps, because inconsistent
-		tangents may lead to subtle visual issues in the normal map, particularly around mirrored
-		UV seams.
+		Creates a new, non-indexed geometry with smooth normals everywhere except faces that meet at an angle greater than the crease angle.
 		</p>
 
+		<h3>[method:BufferGeometry toTrianglesDrawMode]( [param:BufferGeometry geometry], [param:TrianglesDrawMode drawMode] )</h3>
 		<p>
-		In comparison to this method, [page:BufferGeometry.computeTangents] (a
-		custom algorithm) generates tangents that probably will not match the tangents
-		in other software. The custom algorithm is sufficient for general use with a
-		[page:ShaderMaterial], and may be faster than MikkTSpace.
-		</p>
+		geometry -- Instance of [page:BufferGeometry BufferGeometry].<br />
+		drawMode -- The draw mode of the given geometry. Valid inputs are `THREE.TriangleStripDrawMode` and `THREE.TriangleFanDrawMode`.<br /><br />
 
-		<p>
-		Returns the original [page:BufferGeometry]. Indexed geometries will be de-indexed.
-		Requires position, normal, and uv attributes.
+		Returns a new indexed geometry based on `THREE.TrianglesDrawMode` draw mode. This mode corresponds to the `gl.TRIANGLES` WebGL primitive.
 		</p>
 
-		<h2></h2>
+		<h2>Source</h2>
 
 		<p>
 			[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/utils/BufferGeometryUtils.js examples/jsm/utils/BufferGeometryUtils.js]