What is @loaders.gl/3d-tiles?
@loaders.gl/3d-tiles is a module within the loaders.gl framework that provides support for loading and parsing 3D Tiles, a format for streaming massive heterogeneous 3D geospatial datasets. It is designed to handle large-scale 3D models, point clouds, and other geospatial data efficiently.
What are @loaders.gl/3d-tiles's main functionalities?
Loading 3D Tiles
This feature allows you to load 3D Tiles from a given URL. The code sample demonstrates how to use the `load` function from `@loaders.gl/core` along with the `Tiles3DLoader` to load a tileset and log it to the console.
const { load } = require('@loaders.gl/core');
const { Tiles3DLoader } = require('@loaders.gl/3d-tiles');
async function load3DTiles(url) {
const tileset = await load(url, Tiles3DLoader);
console.log(tileset);
}
load3DTiles('https://example.com/tileset.json');
Parsing 3D Tiles
This feature allows you to parse 3D Tiles data from a binary buffer. The code sample demonstrates how to use the `parse` function from `@loaders.gl/core` along with the `Tiles3DLoader` to parse the data and log the resulting tileset to the console.
const { parse } = require('@loaders.gl/core');
const { Tiles3DLoader } = require('@loaders.gl/3d-tiles');
async function parse3DTiles(data) {
const tileset = await parse(data, Tiles3DLoader);
console.log(tileset);
}
// Assuming `data` is a binary buffer containing 3D Tiles data
parse3DTiles(data);
Handling Point Clouds
This feature allows you to load point clouds that are part of a 3D Tileset. The code sample demonstrates how to use the `load` function from `@loaders.gl/core` along with the `Tiles3DLoader` to load a point cloud and log it to the console.
const { load } = require('@loaders.gl/core');
const { Tiles3DLoader } = require('@loaders.gl/3d-tiles');
async function loadPointCloud(url) {
const pointCloud = await load(url, Tiles3DLoader);
console.log(pointCloud);
}
loadPointCloud('https://example.com/pointcloud.json');
Other packages similar to @loaders.gl/3d-tiles
cesium
Cesium is a JavaScript library for creating 3D globes and maps. It supports 3D Tiles and provides extensive functionality for visualizing and interacting with geospatial data. Compared to @loaders.gl/3d-tiles, Cesium offers a more comprehensive suite of tools for rendering and interacting with 3D Tiles, but it is also a larger and more complex library.
potree
Potree is a WebGL based point cloud renderer for large point clouds. It supports various point cloud formats, including 3D Tiles. Compared to @loaders.gl/3d-tiles, Potree is more specialized in rendering point clouds and provides more advanced features for point cloud visualization.
three
Three.js is a popular JavaScript library for 3D graphics on the web. While it does not natively support 3D Tiles, there are extensions and plugins available that add this functionality. Compared to @loaders.gl/3d-tiles, Three.js is a more general-purpose 3D graphics library and requires additional plugins for 3D Tiles support.
@loaders.gl/3d-tiles (Experimental)
This module contains a loader for 3D tiles.
loaders.gl is a collection of loaders for big data visualizations.
For documentation please visit the website.