new WallGeometry()
Used to generate solid wall geometry, constructing a three-dimensional structure through a series of vertically stretched points, suitable for building volume models, terrain fences, and other scene walls defined by a series of points that are vertically stretched downwards to the ground. In addition, it can be further stretched down to a specified height (such as customizing the base or limiting the maximum/minimum extension range).
| Name | Type | Default | Description |
|---|---|---|---|
options.positions |
Array.<Cartesian3> |
Cartesian object array, which refers to the points of the wall. |
|
options.granularity |
Number | Math.RADIANS_PER_DEGREE |
optional
The distance between each latitude and longitude (in radians). Determine the number of positions in the buffer. |
options.maximumHeights |
Array.<Number> |
optional
An array parallel to the position, which gives the maximum height of the wall at each position. If not defined, use the height of each position. |
|
options.minimumHeights |
Array.<Number> |
optional
An array parallel to the position, which gives the minimum height of the wall at each position. If not defined, the height of each position is 0.0. |
|
options.ellipsoid |
Ellipsoid | Ellipsoid.WGS84 |
optional
Ellipsoid used for coordinate operations |
options.vertexFormat |
VertexFormat | VertexFormat.DEFAULT |
optional
The vertex attributes to be calculated. |
- See:
-
- WallGeometry#createGeometry
- WallGeometry#fromConstantHeight
Throws:
-
-
The length of positions must be greater than or equal to 2.
- Type
- DeveloperError
-
-
-
The lengths of positions and maximumHeights must be the same.
- Type
- DeveloperError
-
-
-
The lengths of positions and minimum heights must be the same.
- Type
- DeveloperError
-
Example
// create a wall that spans from ground level to 10000 meters
var wall = new SuperMap3D.WallGeometry({
positions : SuperMap3D.Cartesian3.fromDegreesArrayHeights([
19.0, 47.0, 10000.0,
19.0, 48.0, 10000.0,
20.0, 48.0, 10000.0,
20.0, 47.0, 10000.0,
19.0, 47.0, 10000.0
])
});
var geometry = SuperMap3D.WallGeometry.createGeometry(wall);
Members
-
packedLengthNumber
-
The number of elements used to package an object into an array.
Methods
-
static createGeometry(wallGeometry){Geometry|undefined}
-
Calculate the geometric representation of the wall, including its vertices, indices, and enclosing spheres.
Name Type Description wallGeometryWallGeometry Description of the wall.
Returns:
Type Description Geometry | undefined Calculated vertices and indices. -
static fromConstantHeights(){WallGeometry}
-
The wall is defined by a series of coordinate points, which by default stretch vertically downwards to the ground, forming a continuous three-dimensional structure. In addition, each point can be stretched down to a custom height through parameter settings (such as limiting the base depth or dynamically adjusting the extension range).
Name Type Default Description options.positionsArray.<Cartesian3> Cartesian object array, which refers to the points of the wall.
options.maximumHeightNumber optional A constant used to define the maximum height of the wall at various positions. If not defined, use the height of each position.
options.minimumHeightNumber optional A constant used to define the minimum height of the wall at various positions. If not defined, the height of each position is 0.0.
options.ellipsoidEllipsoid Ellipsoid.WGS84 optional Ellipsoid used for coordinate operations
options.vertexFormatVertexFormat VertexFormat.DEFAULT optional Calculated vertex attributes.
- See:
-
- WallGeometry#createGeometry
Returns:
Type Description WallGeometry Example
// create a wall that spans from 10000 meters to 20000 meters var wall = SuperMap3D.WallGeometry.fromConstantHeights({ positions : SuperMap3D.Cartesian3.fromDegreesArray([ 19.0, 47.0, 19.0, 48.0, 20.0, 48.0, 20.0, 47.0, 19.0, 47.0, ]), minimumHeight : 20000.0, maximumHeight : 10000.0 }); var geometry = SuperMap3D.WallGeometry.createGeometry(wall); -
static pack(value, array, startingIndex){Array.<Number>}
-
Store the provided instance in the provided array.
Name Type Default Description valueWallGeometry The value of packaging.
arrayArray.<Number> The array to be loaded.
startingIndexNumber 0 optional Start packaging the array index of elements.
Returns:
Type Description Array.<Number> The array that was packed into -
static unpack(array, startingIndex, result){WallGeometry}
-
Read instances from the packaged array.
Name Type Default Description arrayArray.<Number> Packaged array.
startingIndexNumber 0 optional The starting index of the element to be decompressed.
resultWallGeometry optional The object that stores the results.
Returns:
Type Description WallGeometry The modified result parameters, or a new WallGeometry instance (if not provided).