Billboard
Parameters
Instance of BillboardCollection
See also
Types
Initialization options for the first param of Billboard constructor
Properties
Gets or sets the aligned axis in world space. The aligned axis is the unit vector that the billboard up vector points towards. The default is the zero vector, which means the billboard is aligned to the screen up vector.
Gets or sets the color that is multiplied with the billboard's texture. This has two common use cases. First, the same white texture may be used by many different billboards, each with a different color, to create colored billboards. Second, the color's alpha component can be used to make the billboard translucent as shown below. An alpha of 0.0
makes the billboard transparent, and 1.0
makes the billboard opaque.
Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
Gets or sets the condition specifying at what distance from the camera that this billboard will be displayed.
Gets or sets the 3D Cartesian offset applied to this billboard in eye coordinates. Eye coordinates is a left-handed coordinate system, where x
points towards the viewer's right, y
points up, and z
points into the screen. Eye coordinates use the same scale as world and model coordinates, which is typically meters.
Gets or sets the height reference of this billboard.
Gets or sets the horizontal origin of this billboard, which determines if the billboard is to the left, center, or right of its anchor position.
Gets or sets the pixel offset in screen space from the origin of this billboard. This is commonly used to align multiple billboards and labels at the same position, e.g., an image and text. The screen space origin is the top, left corner of the canvas; x
increases from left to right, and y
increases from top to bottom.
Gets or sets near and far pixel offset scaling properties of a Billboard based on the billboard's distance from the camera. A billboard's pixel offset will be scaled between the NearFarScalar.nearValue and NearFarScalar.farValue while the camera distance falls within the lower and upper bounds of the specified NearFarScalar.near and NearFarScalar.far. Outside of these ranges the billboard's pixel offset scale remains clamped to the nearest bound. If undefined, pixelOffsetScaleByDistance will be disabled.
Gets or sets the Cartesian position of this billboard.
Gets or sets near and far scaling properties of a Billboard based on the billboard's distance from the camera. A billboard's scale will interpolate between the NearFarScalar.nearValue and NearFarScalar.farValue while the camera distance falls within the lower and upper bounds of the specified NearFarScalar.near and NearFarScalar.far. Outside of these ranges the billboard's scale remains clamped to the nearest bound. If undefined, scaleByDistance will be disabled.
Gets or sets if the billboard size is in meters or pixels. true
to size the billboard in meters; otherwise, the size is in pixels.
Gets or sets the SplitDirection of this billboard.
Gets or sets near and far translucency properties of a Billboard based on the billboard's distance from the camera. A billboard's translucency will interpolate between the NearFarScalar.nearValue and NearFarScalar.farValue while the camera distance falls within the lower and upper bounds of the specified NearFarScalar.near and NearFarScalar.far. Outside of these ranges the billboard's translucency remains clamped to the nearest bound. If undefined, translucencyByDistance will be disabled.
Gets or sets the vertical origin of this billboard, which determines if the billboard is to the above, below, or at the center of its anchor position.
Functions
Computes the screen-space position of the billboard's origin, taking into account eye and pixel offsets. The screen space origin is the top, left corner of the canvas; x
increases from left to right, and y
increases from top to bottom.
Sets the image to be used for this billboard. If a texture has already been created for the given id, the existing texture is used.
Uses a sub-region of the image with the given id as the image for this billboard, measured in pixels from the bottom-left.