ImageElement
ImageElement
represents a 2D image in the scene. Supports billboard behavior, clickable links, alpha transparency, projection modes, and network synchronization.
src: string
The source URL or file path of the image asset to display.
Example:
const image = new ImageElement();
image.src = "assets/images/photo.png";
scene.add(image);
controls: boolean
Enables or disables playback controls if the image element supports interactive or animated content.
Example:
image.controls = true;
billboard: boolean
When true, the image will always face the camera.
Example:
image.billboard = true;
href: string
Optional hyperlink URL associated with the image.
Example:
image.href = "https://example.com";
hideHref: boolean
Determines whether the hyperlink (href) should be visually hidden.
Example:
image.hideHref = false;
alphaMode: ImageAlphaMode
Defines how alpha transparency is handled during rendering (opaque
, blend
, mask
).
opaque
No transparency; image pixels are fully solid, ignoring alpha channel.blend
Standard alpha blending; pixels rendered with varying transparency based on alpha.mask
Alpha testing (cutout); pixels below a cutoff threshold are discarded (fully transparent), others fully opaque.
Example:
image.alphaMode = "mask";
projection: string
Specifies the projection mode applied to the image (flat
, spherical
, equirectangular
).
Example:
image.projection = "flat";
alphaCutoff: number
Threshold for alpha cutoff when using mask-based transparency (0–1).
Example:
image.alphaCutoff = 0.5;
networkable: boolean
Indicates whether the image element’s state and appearance should be synchronized over the network.
Example:
image.networkable = true;