A sprite is a plane that always faces towards the camera, generally with a partially transparent texture applied.
Sprites do not cast shadows, setting castShadow = true
will have no effect.
const map = new v3d.TextureLoader().load('sprite.png');
const material = new v3d.SpriteMaterial({ map: map });
const sprite = new v3d.Sprite(material);
app.scene.add(sprite);
material — (optional) an instance of SpriteMaterial. Default is a white SpriteMaterial.
Creates a new Sprite.
See the base Object3D class for common properties.
Read-only flag to check if a given object is of type Sprite.
An instance of SpriteMaterial, defining the object's appearance. Default is a white SpriteMaterial.
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 of the sprite. The default is (0.5, 0.5).
See the base Object3D class for common methods.
Returns a clone of this Sprite object and any descendants.
Copies the properties of the passed sprite to this one.
Get intersections between a casted ray and this sprite. Raycaster.intersectObject() will call this method. The raycaster must be initialized by calling Raycaster.setFromCamera() before raycasting against sprites.
For more info on how to obtain the source code of this module see this page.