BoxGeometry

new BoxGeometry(options)

Describes a cube centered at the origin.
Name Type Description
options Object Object with the following properties:
Name Type Default Description
minimumCorner Cartesian3 The minimum x, y, and z coordinates of the box.
maximumCorner Cartesian3 The maximum x, y, and z coordinates of the box.
vertexFormat VertexFormat VertexFormat.DEFAULT optional The vertex attributes to be computed.
Example:
var box = new Cesium.BoxGeometry({
  vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  maximumCorner : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
  minimumCorner : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
});
var geometry = Cesium.BoxGeometry.createGeometry(box);
Demo:
See:

Methods

staticBoxGeometry.createGeometry(boxGeometry)Geometry

Computes the geometric representation of a box, including its vertices, indices, and a bounding sphere.
Name Type Description
boxGeometry BoxGeometry A description of the box.
Returns:
The computed vertices and indices.

staticBoxGeometry.fromDimensions()

Creates a cube centered at the origin given its dimensions.
Name Type Default Description
options.dimensions Cartesian3 The width, depth, and height of the box stored in the x, y, and z coordinates of the Cartesian3, respectively.
options.vertexFormat VertexFormat VertexFormat.DEFAULT optional The vertex attributes to be computed.
Throws:
  • DeveloperError : All dimensions components must be greater than or equal to zero.
Example:
var box = Cesium.BoxGeometry.fromDimensions({
  vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
});
var geometry = Cesium.BoxGeometry.createGeometry(box);
See: