Constructor
new CylinderGeometry(radiusTopopt, radiusBottomopt, heightopt, radialSegmentsopt, heightSegmentsopt, openEndedopt, thetaStartopt, thetaLengthopt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
radiusTop | Number | <optional> | 1 | — Radius of the cylinder at the top. |
radiusBottom | Number | <optional> | 1 | — Radius of the cylinder at the bottom. |
height | Number | <optional> | 1 | — Height of the cylinder. |
radialSegments | Number | <optional> | 8 | — Number of segmented faces around the circumference of the cylinder. |
heightSegments | Number | <optional> | 1 | — Number of rows of faces along the height of the cylinder. |
openEnded | Number | <optional> | false | — A Boolean indicating whether the ends of the cylinder are open or capped. Default is false, meaning capped. |
thetaStart | Number | <optional> | 0 | — Start angle for first segment, default = 0 (three o'clock position). |
thetaLength | Number | <optional> | 2*Pi | — The central angle, often called theta, of the circular sector. The default is 2*Pi, which makes for a complete cylinder. |
Extends
Members
attributes :Object
This hashmap has as id the name of the attribute to be set and as value the buffer to set it to. Rather than accessing this property directly, use t3d.Geometry#addAttribute and t3d.Geometry#getAttribute to access attributes of this geometry.
Type:
- Object
- Overrides
boundingBox :t3d.Box3
Bounding box for the bufferGeometry, which can be calculated with t3d.Geometry#computeBoundingBox.
Type:
- Overrides
- Default Value
- t3d.Box3()
boundingSphere :t3d.Sphere
Bounding sphere for the bufferGeometry, which can be calculated with t3d.Geometry#computeBoundingSphere.
Type:
- Overrides
- Default Value
- t3d.Sphere()
groups :Array
Split the geometry into groups, each of which will be rendered in a separate WebGL draw call. This allows an array of materials to be used with the geometry. Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer }, or { multiDrawStarts: Integer[], multiDrawCounts: Integer[], multiDrawCount: Integer, materialIndex: Integer } if multiDraw is available.
Type:
- Array
- Overrides
- Default Value
- []
(readonly) id :Number
Unique number for this geometry instance.
Type:
- Number
- Overrides
index :t3d.Attribute|Null
Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles" and 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 renderer assumes that each three contiguous positions represent a single triangle.
Type:
- t3d.
Attribute |Null
- Overrides
instanceCount :Number
The number of instances to be rendered. If set to -1 (default), instanced rendering is disabled. This property is used for instanced rendering, where multiple copies of the geometry are drawn with a single draw call.
Type:
- Number
- Overrides
- Default Value
- -1
morphAttributes :Object
Hashmap of Attributes Array for morph targets.
Type:
- Object
- Overrides
(readonly) uuid :String
UUID of this geometry instance. This gets automatically assigned, so this shouldn't be edited.
Type:
- String
- Overrides
version :Number
A version number, incremented every time the attribute object or index object changes to mark VAO drity.
Type:
- Number
- Overrides
- Default Value
- 0
Methods
addAttribute(name, attribute)
Adds an attribute to this geometry. Use this rather than the attributes property.
Parameters:
Name | Type | Description |
---|---|---|
name | String | |
attribute | t3d. |
- Overrides
addEventListener(type, listener, thisObjectopt)
Adds a listener to an event type.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type | String | The type of event to listen to. | ||
listener | function | The function that gets called when the event is fired. | ||
thisObject | Object | <optional> | this | The Object of calling listener method. |
- Overrides
addGroup(start, count, materialIndexopt)
Adds a group to this geometry; see the t3d.Geometry#groups for details.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
start | Number | |||
count | Number | |||
materialIndex | Number | <optional> | 0 |
- Overrides
clearGroups()
Clears all groups.
- Overrides
clone() → {t3d.Geometry}
Creates a clone of this Geometry.
- Overrides
Returns:
- Type:
- t3d.
Geometry
computeBoundingBox()
Computes bounding box of the geometry, updating t3d.Geometry#boundingBox. Bounding boxes aren't computed by default. They need to be explicitly computed.
- Overrides
computeBoundingSphere()
Computes bounding sphere of the geometry, updating t3d.Geometry#boundingSphere. Bounding spheres aren't computed by default. They need to be explicitly computed.
- Overrides
copy(source) → {t3d.Geometry}
Copies another Geometry to this Geometry.
Parameters:
Name | Type | Description |
---|---|---|
source | t3d. | The geometry to be copied. |
- Overrides
Returns:
- Type:
- t3d.
Geometry
dispatchEvent(event)
Fire an event.
Parameters:
Name | Type | Description |
---|---|---|
event | Object | The event that gets fired. |
- Overrides
dispose()
Disposes the object from memory. You need to call this when you want the BufferGeometry removed while the application is running.
- Overrides
getAttribute(name) → {t3d.Attribute}
Returns the attribute with the specified name.
Parameters:
Name | Type | Description |
---|---|---|
name | String |
- Overrides
Returns:
- Type:
- t3d.
Attribute
removeAttribute(name)
Removes the attribute with the specified name.
Parameters:
Name | Type | Description |
---|---|---|
name | String |
- Overrides
removeEventListener(type, listener, thisObjectopt)
Removes a listener from an event type.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type | String | The type of the listener that gets removed. | ||
listener | function | The listener function that gets removed. | ||
thisObject | Object | <optional> | this | thisObject - The Object of calling listener method. |
- Overrides
setIndex(index)
Set the t3d.Geometry#index buffer.
Parameters:
Name | Type | Description |
---|---|---|
index | Array | |
- Overrides