A renderable collection of billboards. Billboards are viewport-aligned
images positioned in the 3D scene.
Example billboards
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.
alias BillboardCollection
- The options object takes the following properties
- {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms each billboard from model to world coordinates.
- {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.
- {Scene} [options.scene] Must be passed in for billboards that use the height reference property or will be depth tested against the globe.
performance For best performance, prefer a few collections, each with many billboards, to
many collections with only a few billboards each. Organize collections so that billboards
with the same update frequency are in the same collection, i.e., billboards that do not
change should be in one collection; billboards that change every frame should be in another
collection; and so on.
// Create a billboard collection with two billboards
var billboards = scene.primitives.add(new Cesium.BillboardCollection());
billboards.add({
position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
image : 'url/to/image'
});
billboards.add({
position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
image : 'url/to/another/image'
});
A renderable collection of billboards. Billboards are viewport-aligned images positioned in the 3D scene.
Example billboards
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.
alias BillboardCollection
- The options object takes the following properties - {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms each billboard from model to world coordinates. - {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown. - {Scene} [options.scene] Must be passed in for billboards that use the height reference property or will be depth tested against the globe.
performance For best performance, prefer a few collections, each with many billboards, to many collections with only a few billboards each. Organize collections so that billboards with the same update frequency are in the same collection, i.e., billboards that do not change should be in one collection; billboards that change every frame should be in another collection; and so on.
// Create a billboard collection with two billboards var billboards = scene.primitives.add(new Cesium.BillboardCollection()); billboards.add({ position : new Cesium.Cartesian3(1.0, 2.0, 3.0), image : 'url/to/image' }); billboards.add({ position : new Cesium.Cartesian3(4.0, 5.0, 6.0), image : 'url/to/another/image' });
LabelCollection demo Sandcastle Billboard Demo
Billboard
BillboardCollection#remove
BillboardCollection#add