All Projects → nytimes → three-loader-3dtiles

nytimes / three-loader-3dtiles

Licence: other
This is a Three.js loader module for handling OGC 3D Tiles, created by Cesium. It currently supports the two main formats, Batched 3D Model (b3dm) - based on glTF Point cloud.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to three-loader-3dtiles

3dtilesrendererjs
Renderer for 3D Tiles in Javascript using three.js
Stars: ✭ 333 (+86.03%)
Mutual labels:  threejs, cesium
TweetMigration
A WebGL heatmap of global Twitter activity
Stars: ✭ 42 (-76.54%)
Mutual labels:  threejs
three-orbitcontrols
is the three.js OrbitControls from official repo examples
Stars: ✭ 80 (-55.31%)
Mutual labels:  threejs
terkel.com-2016
My Personal website. Build with Vue and ThreeJS.
Stars: ✭ 38 (-78.77%)
Mutual labels:  threejs
voxelizer
👾 Voxelization of 3D models
Stars: ✭ 32 (-82.12%)
Mutual labels:  threejs
Depthkit.js
🎞 A plugin for using DepthKit's volumteric captures in Three.js
Stars: ✭ 64 (-64.25%)
Mutual labels:  threejs
three-earth
画“地图”
Stars: ✭ 15 (-91.62%)
Mutual labels:  threejs
three-laser-pointer
Interactive laser object for VR-like scenes
Stars: ✭ 26 (-85.47%)
Mutual labels:  threejs
typefaces
Collection of Google fonts as typeface data for usage with three.js, react-three-fiber, and other tools.
Stars: ✭ 53 (-70.39%)
Mutual labels:  threejs
three-onEvent
Add an EventListener for Object3d in your three.js project.(support click,hover or gaze)
Stars: ✭ 55 (-69.27%)
Mutual labels:  threejs
three-vrm
⚠️ [deprecated] VRM file loader for three.js
Stars: ✭ 44 (-75.42%)
Mutual labels:  threejs
THREE.WebGPURenderer
Experimental Three.js WebGPU renderer
Stars: ✭ 117 (-34.64%)
Mutual labels:  threejs
MAVCesium
An experimental web based map display for MAVProxy based on Cesium
Stars: ✭ 28 (-84.36%)
Mutual labels:  cesium
three.wasm-experimental
Experimental Three.js WASM (WIP)
Stars: ✭ 51 (-71.51%)
Mutual labels:  threejs
immersive-ar-emulation
A sort-of polyfill to emulate a fake AR environment which can be hit-tested against.
Stars: ✭ 26 (-85.47%)
Mutual labels:  threejs
three-jsm
Minimal three.js project setup using ES6 modules and rollup.
Stars: ✭ 74 (-58.66%)
Mutual labels:  threejs
cesium-particle
Visualize wind field(NC file) on Cesium
Stars: ✭ 25 (-86.03%)
Mutual labels:  cesium
solarsystemts
케플러 방정식을 이용한 태양계 행성들의 궤도 계산 시뮬레이터
Stars: ✭ 49 (-72.63%)
Mutual labels:  threejs
vue3-cesium-typescript-start-up-template
Vue3 cesium ts start up template. 有时候需要墙才能访问
Stars: ✭ 39 (-78.21%)
Mutual labels:  cesium
FairyGUI-threejs
A GUI Editor & framework for Three.js
Stars: ✭ 115 (-35.75%)
Mutual labels:  threejs

three-loader-3dtiles

license npm version Build Status

DemosUsageRoadmapContributingDocsAlternatives

This is a Three.js loader module for handling OGC 3D Tiles, created by Cesium. It currently supports the two main formats:

  1. Batched 3D Model (b3dm) - based on glTF.
  2. Point cloud.

Internally, the loader uses the loaders.gl library, which is part of the vis.gl platform, openly governed by the Urban Computing Foundation. Cesium has worked closely with loaders.gl to create a platform-independent implementation of their 3D Tiles viewer.

Development of this library started at The New York Times R&D as an effort to create a clean bridge between the 3D Tiles specification and the widely used 3D library Three.js. The library helps us deliver massive 3D and Geographical journalism to desktops and mobile readers alike. From Reporting to Teleporting!


Demos


Basic Usage

Here is a simple example using the Loader3DTiles module to view a tileset.json containing a 3d tile hierarchy.

import { 
  Scene, 
  PerspectiveCamera, 
  WebGLRenderer, 
  Clock 
} from 'three'
import { Loader3DTiles } from 'three-loader-3dtiles';

const scene = new Scene()
const camera = new PerspectiveCamera()
const renderer = new WebGLRenderer()
const clock = new Clock()

renderer.setSize(window.innerWidth, window.innerHeight)
document.body.appendChild(renderer.domElement)

let tilesRuntime = null;

async function loadTileset() {
  const result = await Loader3DTiles.load(
      url: 'https://<TILESET URL>/tileset.json',
      renderer: renderer,
      options: {
        dracoDecoderPath: 'https://unpkg.com/[email protected]/examples/js/libs/draco',
        basisTranscoderPath: 'https://unpkg.com/[email protected]/examples/js/libs/basis'        
      }
  )
  const {model, runtime} = result
  tilesRuntime = runtime
  scene.add(model)
}

function render() {
  const dt = clock.getDelta()
  if (tilesRuntime) {
    tilesRuntime.update(dt, renderer, camera)
  }
  renderer.render(scene, camera)
  window.requestAnimationFrame(render)
}

loadTileset()
render()

Installation

The library supports three.js r137 and uses its GLTF, Draco, and KTX2/Basis loaders. Refer to the browserslist field in package.json for target browsers.

1. ES Module

Download dist/three-loader-3dtiles.esm.min.js and use an importmap to import the dependencies. See here for a full example. The demos also use this method of installation:

index.html

<script async src="https://ga.jspm.io/npm:[email protected]/dist/es-module-shims.js"></script>
<script type="importmap">
  {
    "imports": {
      "three": "https://cdn.skypack.dev/[email protected]",
      "three/examples/jsm/loaders/GLTFLoader.js": "https://cdn.skypack.dev/[email protected]/examples/jsm/loaders/GLTFLoader",
      "three/examples/jsm/loaders/DRACOLoader.js": "https://cdn.skypack.dev/[email protected]/examples/jsm/loaders/DRACOLoader",
      "three/examples/jsm/loaders/KTX2Loader.js": "https://cdn.skypack.dev/[email protected]/examples/jsm/loaders/KTX2Loader",
      "three-loader-3dtiles" : "./three-loader-3dtiles.esm.min.js"
    }
  }
</script>
<script src='index.js' type='module'>

index.js

import { Scene, PerspectiveCamera } from 'three';
import { Loader3DTiles } from 'three-loader-3dtiles';

3. NPM

If you use a build system such as Webpack / Parcel / Rollup etc, you should also install the library along with three.js from npm:

npm install -s three three-loader-3dtiles

The application script would be the same as in the ES Module example (when using importmap).

See here for a complete webpack example.

4. A-Frame

Refer to our dedicated A-Frame component: aframe-loader-3dtiles-component.

5. React-Three-Fiber

Refer to examples/r3f.


Roadmap

Supporting 3D Tiles Next

The 3D Tiles Next specification is in the works, with some of the features already supported in loaders.gl. Supporting the new extensions opens up possibilities for new applications.

Skip-traversal

Implementing the Skip traversal mechanism could greatly improve performance of b3dm (mesh) tiles, but requires a shader/Stencil buffer-based implementation which manually manges Z-culling. This is a very wanted feature and contributions would be greatly appreciated.

Contributing

Refer to CONTRIBUTING.MD for general contribution instructions.

Developing

The library is built using rollup. To run a simple development server type:

npm run dev

It is also possible to develop the library while developing loaders.gl. Just clone the source of loaders.gl and run:

LOADERS_GL_SRC=<path to loaders.gl> npm run dev

Building

To build the library run:

npm run build

To build the production minified version run:

npm run build:production

And to build the API documentation run:

npm run docs

Tests

A rudimentary test spec is available at ./test. To run it type:

npm run test

Docs

Alternatives

To our knowledge, this is the only loaders.gl-based Three.js library, but there are several implementations of 3D Tiles for Three.js. Notable examples:


This repository is maintained by the Research & Development team at The New York Times and is provided as-is for your own use. For more information about R&D at the Times visit rd.nytimes.com

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].