提交 ea51a689 编写于 作者: M Mr.doob

Merge pull request #6976 from TatumCreative/geometry-transform-methods

Geometry transform methods docs
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
When set, it holds certain buffers in memory to have faster updates for this object. When unset, it deletes those buffers and saves memory. When set, it holds certain buffers in memory to have faster updates for this object. When unset, it deletes those buffers and saves memory.
</div> --> </div> -->
<h3>[property:Array drawCalls] (previously [property:Array offsets])</h3> <h3>[property:Array drawcalls] (previously [property:Array offsets])</h3>
<div> <div>
For geometries that use indexed triangles, this Array can be used to split the object into multiple WebGL draw calls. Each draw call will draw some subset of the vertices in this geometry using the configured [page:Material shader]. This may be necessary if, for instance, you have more than 65535 vertices in your object. For geometries that use indexed triangles, this Array can be used to split the object into multiple WebGL draw calls. Each draw call will draw some subset of the vertices in this geometry using the configured [page:Material shader]. This may be necessary if, for instance, you have more than 65535 vertices in your object.
Each element is an object of the form: Each element is an object of the form:
...@@ -176,14 +176,67 @@ ...@@ -176,14 +176,67 @@
<h3>[method:null addDrawCall]( [page:Integer start], [page:Integer count], [page:Integer indexOffset] )</h3> <h3>[method:null addDrawCall]( [page:Integer start], [page:Integer count], [page:Integer indexOffset] )</h3>
<div> <div>
Adds a draw call to this geometry; see the drawcalls property for details. Adds a draw call to this geometry; see the [page:BufferGeometry.drawcalls drawcalls] property for details.
</div>
<h3>[method:null clearDrawCalls]( )</h3>
<div>
Clears all draw calls.
</div> </div>
<h3>[method:null applyMatrix]( [page:Matrix4 matrix] )</h3> <h3>[method:null applyMatrix]( [page:Matrix4 matrix] )</h3>
<div> <div>
Bakes matrix transform directly into vertex coordinates. Bakes matrix transform directly into vertex coordinates.
</div> </div>
<h3>[method:null center] ()</h3>
<div>
Center the geometry based on the bounding box.
</div>
<h3>[method:BufferGeometry rotateX] ( [page:Float radians] )</h3>
<div>
Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop
Use [page:Object3D.rotation] for typical real-time mesh rotation.
</div>
<h3>[method:BufferGeometry rotateY] ( [page:Float radians] )</h3>
<div>
Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop
Use [page:Object3D.rotation] for typical real-time mesh rotation.
</div>
<h3>[method:BufferGeometry rotateZ] ( [page:Float radians] )</h3>
<div>
Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop
Use [page:Object3D.rotation] for typical real-time mesh rotation.
</div>
<h3>[method:BufferGeometry translate] ( [page:Float x], [page:Float y], [page:Float z] )</h3>
<div>
Translate the geometry. This is typically done as a one time operation, and not during a loop
Use [page:Object3D.position] for typical real-time mesh translation.
</div>
<h3>[method:BufferGeometry scale] ( [page:Float x], [page:Float y], [page:Float z] )</h3>
<div>
Scale the geometry data. This is typically done as a one time operation, and not during a loop
Use [page:Object3D.scale] for typical real-time mesh scaling.
</div>
<h3>[method:BufferGeometry lookAt] ( [page:Vector3 vector] )</h3>
<div>
vector - A world vector to look at.<br />
</div>
<div>
Rotates the geometry to face point in space. This is typically done as a one time operation, and not during a loop
Use [page:Object3D.lookAt] for typical real-time mesh usage.
</div>
<h3>[method:BufferGeometry setFromObject] ( [page:Object3D object] )</h3>
<div>
Sets the attributes for this BufferGeometry from an [page:Object3D].
</div>
<h3>[method:null computeVertexNormals]()</h3> <h3>[method:null computeVertexNormals]()</h3>
<div> <div>
...@@ -209,6 +262,19 @@ ...@@ -209,6 +262,19 @@
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are *null*. Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are *null*.
</div> </div>
<h3>[method:null computeOffsets] ( [page:Integer size] )</h3>
<div>
Compute the draw offset for large models by chunking the index buffer into chunks of 65k addressable vertices.
This method will effectively rewrite the index buffer and remap all attributes to match the new indices.
WARNING: This method will also expand the vertex count to prevent sprawled triangles across draw offsets.
size - Defaults to 65535 or 4294967296 if extension OES_element_index_uint supported, but allows for larger or smaller chunks.
</div>
<h3>[method:null merge]( [page:BufferGeometry bufferGeometry], [page:Integer offset] )</h3>
<div>
Merge in another BufferGeometry with an optional offset of where to start merging in.
</div>
<h3>[method:null dispose]()</h3> <h3>[method:null dispose]()</h3>
<div> <div>
Disposes the object from memory. <br /> Disposes the object from memory. <br />
...@@ -225,12 +291,34 @@ ...@@ -225,12 +291,34 @@
Returns the [page:BufferAttribute attribute] with the specified name. Returns the [page:BufferAttribute attribute] with the specified name.
</div> </div>
<h3>[method:BufferAttribute removeAttribute]( [page:String name] )</h3>
<div>
Removes the [page:BufferAttribute attribute] with the specified name.
</div>
<h3>[method:null normalizeNormals]()</h3> <h3>[method:null normalizeNormals]()</h3>
<div> <div>
Every normal vector in a geometry will have a magnitude of 1. Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces. This will correct lighting on the geometry surfaces.
</div> </div>
<h3>[method:Object toJSON]()</h3>
<div>
Returns a raw object representation of the BufferGeometry.
</div>
<h3>[method:BufferGeometry clone]()</h3>
<div>
Creates a clone of this BufferGeometry.
</div>
<h3>[method:BufferGeometry copy]( [page:BufferGeometry bufferGeometry] )</h3>
<div>
Copies another BufferGeometry to this BufferGeometry.
</div>
<h2>Source</h2> <h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
...@@ -204,10 +204,49 @@ ...@@ -204,10 +204,49 @@
Bakes matrix transform directly into vertex coordinates. Bakes matrix transform directly into vertex coordinates.
</div> </div>
<h3>[method:null center]()</h3> <h3>[method:null center] ()</h3>
<div> <div>
Center the geometry based on the bounding box. Center the geometry based on the bounding box.
</div> </div>
<h3>[method:Geometry rotateX] ( [page:Float radians] )</h3>
<div>
Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop
Use [page:Object3D.rotation] for typical real-time mesh rotation.
</div>
<h3>[method:Geometry rotateY] ( [page:Float radians] )</h3>
<div>
Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop
Use [page:Object3D.rotation] for typical real-time mesh rotation.
</div>
<h3>[method:Geometry rotateZ] ( [page:Float radians] )</h3>
<div>
Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop
Use [page:Object3D.rotation] for typical real-time mesh rotation.
</div>
<h3>[method:Geometry translate] ( [page:Float x], [page:Float y], [page:Float z] )</h3>
<div>
Translate the geometry. This is typically done as a one time operation, and not during a loop
Use [page:Object3D.position] for typical real-time mesh translation.
</div>
<h3>[method:Geometry scale] ( [page:Float x], [page:Float y], [page:Float z] )</h3>
<div>
Scale the geometry data. This is typically done as a one time operation, and not during a loop
Use [page:Object3D.scale] for typical real-time mesh scaling.
</div>
<h3>[method:Geometry lookAt] ( [page:Vector3 vector] )</h3>
<div>
vector - A world vector to look at.<br />
</div>
<div>
Rotates the geometry to face point in space. This is typically done as a one time operation, and not during a loop
Use [page:Object3D.lookAt] for typical real-time mesh usage.
</div>
<h3>[method:null computeFaceNormals]()</h3> <h3>[method:null computeFaceNormals]()</h3>
<div> <div>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册