BillboardCollection
A renderable collection of billboards. Billboards are viewport-aligned images positioned in the 3D scene.
Billboards are added and removed from the collection using BillboardCollection.add and BillboardCollection.remove. Billboards in a collection automatically share textures for images with the same identifier.
// Create a billboard collection with two billboards
const billboards = scene.primitives.add(new BillboardCollection());
billboards.add({
position : new Cartesian3(1.0, 2.0, 3.0),
image : 'url/to/image'
});
billboards.add({
position : new Cartesian3(4.0, 5.0, 6.0),
image : 'url/to/another/image'
});
See also
Types
Properties
The billboard blending option. The default is used for rendering both opaque and translucent billboards. However, if either all of the billboards are completely opaque or all are completely translucent, setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
This property is for debugging only; it is not for production use nor is it optimized.
This property is for debugging only; it is not for production use nor is it optimized.
Returns the number of billboards in this collection. This is commonly used with BillboardCollection.get to iterate over all the billboards in the collection.
The 4x4 transformation matrix that transforms each billboard in this collection from model to world coordinates. When this is the identity matrix, the billboards are drawn in world coordinates, i.e., Earth's WGS84 coordinates. Local reference frames can be used by providing a different transformation matrix, like that returned by Transforms.eastNorthUpToFixedFrame.
Functions
Creates and adds a billboard with the specified initial properties to the collection. The added billboard is returned so it can be modified or removed from the collection later.
Returns the billboard in the collection at the specified index. Indices are zero-based and increase as billboards are added. Removing a billboard shifts all billboards after it to the left, changing their indices. This function is commonly used with BillboardCollection.length to iterate over all the billboards in the collection.
Returns true if this object was destroyed; otherwise, false.
Called when Viewer or CesiumWidget render the scene to get the draw commands needed to render this primitive.