Capítulo 24 de 859

Chapter 24: CapsuleGeometry

Core Idea

A geometry class for representing a capsule.

Key Concepts

  • parameters : Object: Holds the constructor parameters that have been used to generate the geometry. Any modification after instantiation does not change the geo…

Code Examples

const geometry = new THREE.CapsuleGeometry( 1, 1, 4, 8, 1 );
const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
const capsule = new THREE.Mesh( geometry, material );
scene.add( capsule );
  • What it demonstrates: Typical usage of CapsuleGeometry.

Reference Tables

Constructor

Signature
new CapsuleGeometry( radius : number, height : number, capSegments : number, radialSegments : number, heightSegments : number )

Properties

PropertyDescription
.parameters : ObjectHolds the constructor parameters that have been used to generate the geometry. Any modification after instantiation does not change the geometry.

Key Takeaways

  1. CapsuleGeometry extends: EventDispatcher → BufferGeometry
  2. Most relevant properties: parameters.

Connects To