A overview of 3DTiles
Overview
- Open and interoperable 开放和互操作
- Heterogeneous 多源异构的数据
- Designed for 3D 专为 3D 设计的流式渲染
- Semantic, interactive, and styleable 语义化、交互性和可样式化
An Example Tileset
namespace Cesium3DTiles {
/**
* @brief A <a
* href="https://github.com/CesiumGS/3d-tiles/tree/master/specification">3D
* Tiles tileset</a>, used for streaming massive heterogeneous 3D geospatial
* datasets.
*/
class CESIUM3DTILES_API Tileset final {
public:
/**
* @brief Constructs a new instance with a given `tileset.json` URL.
* @param externals The external interfaces to use.
* @param url The URL of the `tileset.json`.
* @param options Additional options for the tileset.
*/
Tileset(
const TilesetExternals& externals,
const std::string& url,
const TilesetOptions& options = TilesetOptions());
};
Tilesets and Tiles
namespace Cesium3DTiles {
class Tileset;
class TileContent;
struct TileContentLoadResult;
/**
* @brief A tile in a {@link Tileset}.
*
* The tiles of a tileset form a hierarchy, where each tile may contain
* renderable content, and each tile has an associated bounding volume.
*
* The actual hierarchy is represented with the {@link Tile::getParent}
* and {@link Tile::getChildren} functions.
*
* The renderable content is provided as a {@link TileContentLoadResult}
* from the {@link Tile::getContent} function.
* The {@link Tile::getGeometricError} function returns the geometric
* error of the representation of the renderable content of a tile.
*
* The {@link BoundingVolume} is given by the {@link Tile::getBoundingVolume}
* function. This bounding volume encloses the renderable content of the
* tile itself, as well as the renderable content of all children, yielding
* a spatially coherent hierarchy of bounding volumes.
*
* The bounding volume of the content of an individual tile is given
* by the {@link Tile::getContentBoundingVolume} function.
*
*/
class CESIUM3DTILES_API Tile final {
};
}
Bounding Volumes
namespace Cesium3DTiles {
/**
* @brief A bounding volume.
*
* This is a `std::variant` for different types of bounding volumes.
*
* @see CesiumGeometry::BoundingSphere
* @see CesiumGeometry::OrientedBoundingBox
* @see CesiumGeospatial::BoundingRegion
* @see CesiumGeospatial::BoundingRegionWithLooseFittingHeights
*/
typedef std::variant<
CesiumGeometry::BoundingSphere,
CesiumGeometry::OrientedBoundingBox,
CesiumGeospatial::BoundingRegion,
CesiumGeospatial::BoundingRegionWithLooseFittingHeights>
BoundingVolume;
/**
* @brief Transform the given {@link BoundingVolume} with the given matrix.
*
* If the given bounding volume is a {@link CesiumGeometry::BoundingSphere}
* or {@link CesiumGeometry::OrientedBoundingBox}, then it will be transformed
* with the given matrix. Bounding regions will not be transformed.
*
* @param transform The transform matrix.
* @param boundingVolume The bounding volume.
* @return The transformed bounding volume.
*/
CESIUM3DTILES_API BoundingVolume transformBoundingVolume(
const glm::dmat4x4& transform,
const BoundingVolume& boundingVolume);
/**
* @brief Returns the center of the given {@link BoundingVolume}.
*
* @param boundingVolume The bounding volume.
* @return The center point.
*/
CESIUM3DTILES_API glm::dvec3
getBoundingVolumeCenter(const BoundingVolume& boundingVolume);
}
Spatial Data Structures
Geometric Error
Screen Space Error
Refinement Strategies
namespace Cesium3DTiles {
/**
* @brief Refinement strategies for a {@link Cesium3DTiles::Tile}.
*/
enum class TileRefine {
/**
* @brief The content of the child tiles will be added to the content of the
* parent tile.
*/
Add = 0,
/**
* @brief The content of the child tiles will replace the content of the
* parent tile.
*/
Replace = 1
};
} // namespace Cesium3DTiles