Inheritance: EventDispatcher → BufferGeometry →
This class can be used to create a decal mesh that serves different kinds of purposes e.g. adding unique details to models, performing dynamic visual environmental changes or covering seams.
Please not that decal projections can be distorted when used around corners. More information at this GitHub issue: Decal projections without distortions.
Reference: How to project decals
const geometry = new DecalGeometry( mesh, position, orientation, size );
const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
const mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );
DecalGeometry is an addon, and must be imported explicitly, see Installation#Addons.
import { DecalGeometry } from 'three/addons/geometries/DecalGeometry.js';
Constructs a new decal geometry.
mesh
The base mesh the decal should be projected on.
position
The position of the decal projector.
orientation
The orientation of the decal projector.
size
The scale of the decal projector.