Capítulo 14 de 859
A sprite is a plane that always faces towards the camera, generally with a partially transparent texture applied.
Sprites do not cast shadows, setting Object3D#castShadow to true will have no effect.
(0.5, 0.5) corresponds to the midpoint of the sprite…const map = new THREE.TextureLoader().load( 'sprite.png' );
const material = new THREE.SpriteMaterial( { map: map } );
const sprite = new THREE.Sprite( material );
scene.add( sprite );
Constructor
| Signature |
|---|
| `new Sprite( material : SpriteMaterial |
Properties
| Property | Description |
|---|---|
.center : Vector2 | The sprite's anchor point, and the point around which the sprite rotates. A value of (0.5, 0.5) corresponds to the midpoint of the sprite. A value of (0, 0) corresponds to the lower left corner o… |
.count : number | The number of instances of this sprite. Can only be used with WebGPURenderer. |
.geometry : BufferGeometry | The sprite geometry. |
.isSprite : boolean (readonly) | This flag can be used for type testing. |
| `.material : SpriteMaterial | SpriteNodeMaterial` |
Methods
| Method | Description |
|---|---|
.raycast( raycaster : Raycaster, intersects : Array.<Object> ) | Computes intersection points between a casted ray and this sprite. |