|
@@ -14,15 +14,15 @@
|
|
<p>
|
|
<p>
|
|
This class is an efficient alternative to [page:Geometry], because it stores all data, including
|
|
This class is an efficient alternative to [page:Geometry], because it stores all data, including
|
|
vertex positions, face indices, normals, colors, UVs, and custom attributes within buffers; this
|
|
vertex positions, face indices, normals, colors, UVs, and custom attributes within buffers; this
|
|
- reduces the cost of passing all this data to the GPU.
|
|
|
|
|
|
+ reduces the cost of passing all this data to the GPU.<br />
|
|
This also makes BufferGeometry harder to work with than [page:Geometry]; rather than accessing
|
|
This also makes BufferGeometry harder to work with than [page:Geometry]; rather than accessing
|
|
position data as [page:Vector3] objects, color data as [page:Color] objects, and so on, you have to
|
|
position data as [page:Vector3] objects, color data as [page:Color] objects, and so on, you have to
|
|
- access the raw data from the appropriate [page:BufferAttribute attribute] buffer. This makes
|
|
|
|
|
|
+ access the raw data from the appropriate [page:BufferAttribute attribute buffer]. This makes
|
|
BufferGeometry best-suited for static objects where you don't need to manipulate the geometry much
|
|
BufferGeometry best-suited for static objects where you don't need to manipulate the geometry much
|
|
after instantiating it.
|
|
after instantiating it.
|
|
</p>
|
|
</p>
|
|
|
|
|
|
- <h3>Example</h3>
|
|
|
|
|
|
+ <h2>Example</h2>
|
|
<code>
|
|
<code>
|
|
var geometry = new THREE.BufferGeometry();
|
|
var geometry = new THREE.BufferGeometry();
|
|
// create a simple square shape. We duplicate the top left and bottom right
|
|
// create a simple square shape. We duplicate the top left and bottom right
|
|
@@ -42,16 +42,23 @@
|
|
var material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
|
|
var material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
|
|
var mesh = new THREE.Mesh( geometry, material );
|
|
var mesh = new THREE.Mesh( geometry, material );
|
|
</code>
|
|
</code>
|
|
- <p>More examples: [example:webgl_buffergeometry Complex mesh with non-indexed faces], [example:webgl_buffergeometry_uint Complex mesh with indexed faces], [example:webgl_buffergeometry_lines Lines], [example:webgl_buffergeometry_lines_indexed Indexed Lines], [example:webgl_buffergeometry_custom_attributes_particles Particles], and [example:webgl_buffergeometry_rawshader Raw Shaders].</p>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ [example:webgl_buffergeometry Complex mesh with non-indexed faces]<br />
|
|
|
|
+ [example:webgl_buffergeometry_uint Complex mesh with indexed faces]<br />
|
|
|
|
+ [example:webgl_buffergeometry_lines Lines]<br />
|
|
|
|
+ [example:webgl_buffergeometry_lines_indexed Indexed Lines]<br />
|
|
|
|
+ [example:webgl_buffergeometry_custom_attributes_particles Particles]<br />
|
|
|
|
+ [example:webgl_buffergeometry_rawshader Raw Shaders]
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
|
|
- <h3>Accessing attributes</h3>
|
|
|
|
|
|
+ <h2>Accessing Attributes</h2>
|
|
<p>
|
|
<p>
|
|
- WebGL stores data associated with individual vertices of a geometry in <emph>attributes</emph>.
|
|
|
|
|
|
+ WebGL stores data associated with individual vertices of a geometry in <em>attributes</em>.
|
|
Examples include the position of the vertex, the normal vector for the vertex, the vertex color,
|
|
Examples include the position of the vertex, the normal vector for the vertex, the vertex color,
|
|
and so on. When using [page:Geometry], the [page:WebGLRenderer renderer] takes care of wrapping
|
|
and so on. When using [page:Geometry], the [page:WebGLRenderer renderer] takes care of wrapping
|
|
up this information into typed array buffers and sending this data to the shader. With
|
|
up this information into typed array buffers and sending this data to the shader. With
|
|
- BufferGeometry, all of this data is stored in buffers associated with an individual attributes.
|
|
|
|
|
|
+ BufferGeometry, all of this data is stored in buffers associated with individual attributes.
|
|
This means that to get the position data associated with a vertex (for instance), you must call
|
|
This means that to get the position data associated with a vertex (for instance), you must call
|
|
[page:.getAttribute] to access the 'position' [page:BufferAttribute attribute], then access the individual
|
|
[page:.getAttribute] to access the 'position' [page:BufferAttribute attribute], then access the individual
|
|
x, y, and z coordinates of the position.
|
|
x, y, and z coordinates of the position.
|
|
@@ -59,27 +66,30 @@
|
|
<p>
|
|
<p>
|
|
The following attributes are set by various members of this class:
|
|
The following attributes are set by various members of this class:
|
|
</p>
|
|
</p>
|
|
- <h4>[page:BufferAttribute position] (itemSize: 3)</h4>
|
|
|
|
|
|
+ <h3>[page:BufferAttribute position] (itemSize: 3)</h3>
|
|
<div>
|
|
<div>
|
|
Stores the x, y, and z coordinates of each vertex in this geometry. Set by [page:.fromGeometry]().
|
|
Stores the x, y, and z coordinates of each vertex in this geometry. Set by [page:.fromGeometry]().
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h4>[page:BufferAttribute normal] (itemSize: 3)</h4>
|
|
|
|
|
|
+ <h3>[page:BufferAttribute normal] (itemSize: 3)</h3>
|
|
<div>
|
|
<div>
|
|
Stores the x, y, and z components of the face or vertex normal vector of each vertex in this geometry.
|
|
Stores the x, y, and z components of the face or vertex normal vector of each vertex in this geometry.
|
|
Set by [page:.fromGeometry]().
|
|
Set by [page:.fromGeometry]().
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h4>[page:BufferAttribute color] (itemSize: 3)</h4>
|
|
|
|
|
|
+ <h3>[page:BufferAttribute color] (itemSize: 3)</h3>
|
|
<div>
|
|
<div>
|
|
Stores the red, green, and blue channels of vertex color of each vertex in this geometry.
|
|
Stores the red, green, and blue channels of vertex color of each vertex in this geometry.
|
|
Set by [page:.fromGeometry]().
|
|
Set by [page:.fromGeometry]().
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h4>[page:BufferAttribute index] (itemSize: 3)</h4>
|
|
|
|
- Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles," and works much the same as it does in [page:Geometry]: each triangle is associated with the index of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
|
|
|
|
|
|
+ <h3>[page:BufferAttribute index] (itemSize: 1)</h3>
|
|
|
|
+ Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles" and
|
|
|
|
+ works much the same as it does in [page:Geometry]: each triangle is associated with the indices of three vertices.
|
|
|
|
+ This attribute therefore stores the index of each vertex for each triangular face.
|
|
|
|
|
|
- If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
|
|
|
|
|
|
+ If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous
|
|
|
|
+ positions represent a single triangle.
|
|
</div>
|
|
</div>
|
|
<p>
|
|
<p>
|
|
In addition to the the built-in attributes, you can set your own custom attributes using the addAttribute method. With [page:Geometry], these attributes are set and stored on the [page:Material]. In BufferGeometry, the attributes are stored with the geometry itself. Note that you still need to set the attributes information on the material as well, but the value of each attribute is stored in the BufferGeometry.
|
|
In addition to the the built-in attributes, you can set your own custom attributes using the addAttribute method. With [page:Geometry], these attributes are set and stored on the [page:Material]. In BufferGeometry, the attributes are stored with the geometry itself. Note that you still need to set the attributes information on the material as well, but the value of each attribute is stored in the BufferGeometry.
|
|
@@ -97,149 +107,141 @@
|
|
|
|
|
|
<h2>Properties</h2>
|
|
<h2>Properties</h2>
|
|
|
|
|
|
- <h3>[property:Integer id]</h3>
|
|
|
|
- <div>
|
|
|
|
- Unique number for this buffergeometry instance.
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
<h3>[property:Hashmap attributes]</h3>
|
|
<h3>[property:Hashmap attributes]</h3>
|
|
<div>
|
|
<div>
|
|
This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
|
|
This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
|
|
Rather than accessing this property directly, use addAttribute and getAttribute to access attributes of this geometry.
|
|
Rather than accessing this property directly, use addAttribute and getAttribute to access attributes of this geometry.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <!--
|
|
|
|
- <h3>[property:Boolean dynamic]</h3>
|
|
|
|
|
|
+ <h3>[property:Box3 boundingBox]</h3>
|
|
<div>
|
|
<div>
|
|
- 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> -->
|
|
|
|
|
|
+ Bounding box for the bufferGeometry, which can be calculated with
|
|
|
|
+ [page:.computeBoundingBox](). Default is *null*.
|
|
|
|
+ </div>
|
|
|
|
|
|
- <h3>[property:Array drawcalls] (previously [property:Array offsets])</h3>
|
|
|
|
|
|
+ <h3>[property:Sphere boundingSphere]</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.
|
|
|
|
- Each element is an object of the form:
|
|
|
|
- <code>{ start: Integer, count: Integer, index: Integer }</code>
|
|
|
|
- where start specifies the index of the first vertex in this draw call, count specifies how many vertices are included, and index specifies an optional offset.
|
|
|
|
-
|
|
|
|
- Use addDrawCall to add draw calls, rather than modifying this array directly.
|
|
|
|
|
|
+ Bounding sphere for the bufferGeometry, which can be calculated with
|
|
|
|
+ [page:.computeBoundingSphere](). Default is *null*.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Box3 boundingBox]</h3>
|
|
|
|
|
|
+ <h3>[property:Object drawRange]</h3>
|
|
<div>
|
|
<div>
|
|
- Bounding box.
|
|
|
|
- <code>{ min: new THREE.Vector3(), max: new THREE.Vector3() }</code>
|
|
|
|
|
|
+ Used to determine what part of the geometry should be rendered. This should not
|
|
|
|
+ be set directly, instead use [page:.setDrawRange].<br />
|
|
|
|
+ Default is
|
|
|
|
+ <code>
|
|
|
|
+ { start: 0, count: Infinity }
|
|
|
|
+ </code>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Sphere boundingSphere]</h3>
|
|
|
|
|
|
+ <h3>[property:Array groups]</h3>
|
|
<div>
|
|
<div>
|
|
- Bounding sphere.
|
|
|
|
- <code>{ radius: float }</code>
|
|
|
|
|
|
+ Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
|
|
|
|
+ This allows a [page:MultiMaterial] to be used with the bufferGeometry.<br /><br />
|
|
|
|
+
|
|
|
|
+ Each group is an object of the form:
|
|
|
|
+ <code>{ start: Integer, count: Integer, materialIndex: Integer }</code>
|
|
|
|
+ where start specifies the index of the first vertex in this draw call, count specifies
|
|
|
|
+ how many vertices are included, and materialIndex specifies the [page:MultiMaterial] index to use.<br /><br />
|
|
|
|
+
|
|
|
|
+ Use [page:.addGroup] to add groups, rather than modifying this array directly.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h2>Methods</h2>
|
|
|
|
|
|
|
|
- <h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
|
|
|
|
|
|
+ <!-- Note: groups used to be called drawCalls
|
|
|
|
|
|
- <h3>[property:null addAttribute]( [page:String name], [page:BufferAttribute attribute] )</h3>
|
|
|
|
|
|
+ <h3>[property:Array drawcalls]</h3>
|
|
<div>
|
|
<div>
|
|
- Adds an attribute to this geometry. Use this rather than the attributes property,
|
|
|
|
- because an internal array of attributes is maintained to speed up iterating over
|
|
|
|
- attributes.
|
|
|
|
- </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.
|
|
|
|
+ </div> -->
|
|
|
|
|
|
- <h3>[method:null addDrawCall]( [page:Integer start], [page:Integer count], [page:Integer indexOffset] )</h3>
|
|
|
|
- <div>
|
|
|
|
- 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>
|
|
|
|
|
|
+ <h3>[property:Integer id]</h3>
|
|
|
|
+ <div>Unique number for this bufferGeometry instance.</div>
|
|
|
|
|
|
- <h3>[method:null applyMatrix]( [page:Matrix4 matrix] )</h3>
|
|
|
|
|
|
+ <h3>[property:BufferAttribute index]</h3>
|
|
<div>
|
|
<div>
|
|
- Bakes matrix transform directly into vertex coordinates.
|
|
|
|
|
|
+ See "Accessing Attributes" section above for a description of this property.
|
|
|
|
+ Default is *null*.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:null center] ()</h3>
|
|
|
|
|
|
+ <h3>[property:Boolean isBufferGeometry]</h3>
|
|
<div>
|
|
<div>
|
|
- Center the geometry based on the bounding box.
|
|
|
|
- </div>
|
|
|
|
|
|
+ Used to check whether this or derived classes are BufferGeometries. Default is *true*.<br /><br />
|
|
|
|
|
|
- <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.
|
|
|
|
|
|
+ You should not change this, as it used internally for optimisation.
|
|
</div>
|
|
</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>[property:Integer MaxIndex]</h3>
|
|
|
|
+ <div>Maximum number of vertices allowed, set to *65535*.</div>
|
|
|
|
|
|
- <h3>[method:BufferGeometry rotateZ] ( [page:Float radians] )</h3>
|
|
|
|
|
|
+ <h3>[property:Object morphAttributes]</h3>
|
|
<div>
|
|
<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.
|
|
|
|
|
|
+ Hashmap of [page:BufferAttribute]s holding details of the geometry's [page:Geometry.morphTargets morphTargets].
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:BufferGeometry translate] ( [page:Float x], [page:Float y], [page:Float z] )</h3>
|
|
|
|
|
|
+ <h3>[property:String name]</h3>
|
|
<div>
|
|
<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.
|
|
|
|
|
|
+ Optional name for this bufferGeometry instance. Default is an empty string.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:BufferGeometry scale] ( [page:Float x], [page:Float y], [page:Float z] )</h3>
|
|
|
|
|
|
+ <h3>[property:String uuid]</h3>
|
|
<div>
|
|
<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.
|
|
|
|
|
|
+ [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
|
|
|
|
+ This gets automatically assigned and shouldn't be edited.
|
|
</div>
|
|
</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>
|
|
|
|
|
|
+ <h2>Methods</h2>
|
|
|
|
|
|
- <h3>[method:BufferGeometry setFromObject] ( [page:Object3D object] )</h3>
|
|
|
|
|
|
+ <h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
|
|
|
|
+
|
|
|
|
+ <h3>[property:null addAttribute]( [page:String name], [page:BufferAttribute attribute] )</h3>
|
|
<div>
|
|
<div>
|
|
- Sets the attributes for this BufferGeometry from an [page:Object3D].
|
|
|
|
|
|
+ Adds an attribute to this geometry. Use this rather than the attributes property,
|
|
|
|
+ because an internal hashmap of [page:.attributes] is maintained to speed up iterating over
|
|
|
|
+ attributes.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:null computeVertexNormals]()</h3>
|
|
|
|
|
|
+ <h3>[method:null addGroup]( [page:Integer start], [page:Integer count], [page:Integer materialIndex] )</h3>
|
|
<div>
|
|
<div>
|
|
- Computes vertex normals by averaging face normals.<br />
|
|
|
|
|
|
+ Adds a group to this geometry; see the [page:BufferGeometry.groups groups]
|
|
|
|
+ property for details.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
+
|
|
|
|
+ <h3>[method:null applyMatrix]( [page:Matrix4 matrix] )</h3>
|
|
|
|
+ <div>Bakes matrix transform directly into vertex coordinates.</div>
|
|
|
|
+
|
|
|
|
+ <h3>[method:null center] ()</h3>
|
|
|
|
+ <div>Center the geometry based on the bounding box.</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>
|
|
|
|
+
|
|
|
|
+ <h3>[method:null clearGroups]( )</h3>
|
|
|
|
+ <div>Clears all groups.</div>
|
|
|
|
+
|
|
<h3>[method:null computeBoundingBox]()</h3>
|
|
<h3>[method:null computeBoundingBox]()</h3>
|
|
<div>
|
|
<div>
|
|
- Computes bounding box of the geometry, updating [page:Geometry Geometry.boundingBox] attribute.<br />
|
|
|
|
|
|
+ Computes bounding box of the geometry, updating [page:.boundingBox] attribute.<br />
|
|
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are *null*.
|
|
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are *null*.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<h3>[method:null computeBoundingSphere]()</h3>
|
|
<h3>[method:null computeBoundingSphere]()</h3>
|
|
<div>
|
|
<div>
|
|
- Computes bounding sphere of the geometry, updating [page:Geometry Geometry.boundingSphere] attribute.<br />
|
|
|
|
|
|
+ Computes bounding sphere of the geometry, updating [page:.boundingSphere] attribute.<br />
|
|
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 computeVertexNormals]()</h3>
|
|
|
|
+ <div>Computes vertex normals by averaging face normals.</div>
|
|
|
|
|
|
<h3>[method:null dispose]()</h3>
|
|
<h3>[method:null dispose]()</h3>
|
|
<div>
|
|
<div>
|
|
@@ -247,42 +249,105 @@
|
|
You need to call this when you want the bufferGeometry removed while the application is running.
|
|
You need to call this when you want the bufferGeometry removed while the application is running.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:null fromGeometry]( [page:Geometry] )</h3>
|
|
|
|
|
|
+ <h3>[method:BufferGeometry fromDirectGeometry]( [page:Geometry] )</h3>
|
|
<div>
|
|
<div>
|
|
- Populates this BufferGeometry with data from a [page:Geometry] object.
|
|
|
|
|
|
+ Populates this BufferGeometry with data from a [page:DirectGeometry] object.<br /><br />
|
|
|
|
+
|
|
|
|
+ Note: [page:DirectGeometry] is mainly used as an intermediary object for converting between [page:Geometry]
|
|
|
|
+ and BufferGeometry.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
+ <h3>[method:BufferGeometry fromGeometry]( [page:Geometry] )</h3>
|
|
|
|
+ <div>Populates this BufferGeometry with data from a [page:Geometry] object.</div>
|
|
|
|
+
|
|
<h3>[method:BufferAttribute getAttribute]( [page:String name] )</h3>
|
|
<h3>[method:BufferAttribute getAttribute]( [page:String name] )</h3>
|
|
- <div>
|
|
|
|
- Returns the [page:BufferAttribute attribute] with the specified name.
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div>Returns the [page:BufferAttribute attribute] with the specified name.</div>
|
|
|
|
|
|
- <h3>[method:BufferAttribute removeAttribute]( [page:String name] )</h3>
|
|
|
|
|
|
+ <h3>[method:BufferAttribute getIndex] ()</h3>
|
|
|
|
+ <div>Return the [page:.index] buffer.</div>
|
|
|
|
+
|
|
|
|
+ <h3>[method:BufferGeometry lookAt] ( [page:Vector3 vector] )</h3>
|
|
<div>
|
|
<div>
|
|
- Removes the [page:BufferAttribute attribute] with the specified name.
|
|
|
|
|
|
+ vector - A world vector to look at.<br /><br />
|
|
|
|
+
|
|
|
|
+ Rotates the geometry to face a 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>
|
|
</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 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>
|
|
|
|
|
|
+ <h3>[method:BufferAttribute removeAttribute]( [page:String name] )</h3>
|
|
|
|
+ <div>Removes the [page:BufferAttribute attribute] with the specified name.</div>
|
|
|
|
+
|
|
|
|
+ <h3>[method:BufferGeometry rotateX] ( [page:Float radians] )</h3>
|
|
<div>
|
|
<div>
|
|
- Returns a raw object representation of the BufferGeometry.
|
|
|
|
|
|
+ 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>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:BufferGeometry clone]()</h3>
|
|
|
|
|
|
+ <h3>[method:BufferGeometry rotateY] ( [page:Float radians] )</h3>
|
|
<div>
|
|
<div>
|
|
- Creates a clone of this BufferGeometry.
|
|
|
|
|
|
+ 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>
|
|
</div>
|
|
|
|
|
|
- <h3>[method:BufferGeometry copy]( [page:BufferGeometry bufferGeometry] )</h3>
|
|
|
|
|
|
+ <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 scale] ( [page:Float x], [page:Float y], [page:Float z] )</h3>
|
|
<div>
|
|
<div>
|
|
- Copies another BufferGeometry to this BufferGeometry.
|
|
|
|
|
|
+ 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>
|
|
</div>
|
|
|
|
|
|
|
|
+ <h3>[method:null setIndex] ( [page:BufferAttribute index] )</h3>
|
|
|
|
+ <div>Set the [page:.index] buffer.</div>
|
|
|
|
+
|
|
|
|
+ <h3>[method:null setDrawRange] ( [page:Integer start], [page:Integer count] )</h3>
|
|
|
|
+ <div>Set the [page:.drawRange] buffer. See that property for details.</div>
|
|
|
|
+
|
|
|
|
+ <h3>[method:BufferGeometry setFromObject] ( [page:Object3D object] )</h3>
|
|
|
|
+ <div>Sets the attributes for this BufferGeometry from an [page:Object3D].</div>
|
|
|
|
+
|
|
|
|
+ <h3>[method:Object toJSON]()</h3>
|
|
|
|
+ <div>Returns a JSON object representation of the BufferGeometry.</div>
|
|
|
|
+
|
|
|
|
+ <h3>[method:BufferGeometry toNonIndexed]()</h3>
|
|
|
|
+ <div>Return a non-index version of an indexed BufferGeometry.</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 updateFromObject] ( [page:Object3D object] )</h3>
|
|
|
|
+ <div>Updates the attributes for this BufferGeometry from an [page:Object3D].</div>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
<h2>Source</h2>
|
|
<h2>Source</h2>
|