• Stars
    star
    187
  • Rank 199,897 (Top 5 %)
  • Language
    JavaScript
  • License
    Other
  • Created over 2 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A-Frame component using 3D-Tiles

aframe-loader-3dtiles-component

Version License Build Status

An A-Frame component for displaying OGC 3D Tiles based on nytimes/three-loader-3dtiles.

Demos β€” API β€” Installation β€” Usage β€” Contributing β€” Roadmap

The loader uses the loaders.gl library, which is part of the vis.gl platform, openly governed by the Urban Computing Foundation. Development of the loader started at The New York Times R&D as an effort deliver massive 3D and Geographical journalism to readers. This A-Frame components makes 3D Tiles more accessible to creators and brings immersitve journalism into mixed realities on the web.

Demos

Demos are available here.

Installation

Browser

The following example loads the library from CDN, as well as missing required components for handling KTX2/basis_universal glTFs.

<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
  <script src='https://cdn.jsdelivr.net/npm/[email protected]/examples/js/utils/WorkerPool.js'></script>
  <script src='https://cdn.jsdelivr.net/npm/[email protected]/examples/js/loaders/KTX2Loader.js'></script>
  <script src="https://cdn.jsdelivr.net/npm/aframe-loader-3dtiles-component/dist/aframe-loader-3dtiles-component.min.js"></script>
</head>

Usage

The following example sets up a basic scene with a RealityCapture photogrammetry model.

<body>
    <a-scene environment="preset: default">
      <a-camera id="camera"></a-camera>
      <a-entity
        id="freeman-tiles"
        position="0 2.6 0"
        rotation="-90 180 0"
        scale="2 2 2"
        loader-3dtiles="
         url: https://int.nyt.com/data/3dscenes/ONA360/TILESET/0731_FREEMAN_ALLEY_10M_A_36x8K__10K-PN_50P_DB/tileset_tileset.json; 
         maximumSSE: 48;
         cameraEl: #camera;
        "
      >
      </a-entity>
    </a-scene>
</body>

npm

Install via npm:

npm install aframe-loader-3dtiles-component

Then require and use.

require('aframe');
require('aframe-loader-3dtiles-component');

API

Property Type Description Default Value
url string The URL of the tileset. For example if using Cesium ION, it would have the form: https://assets.cesium.com/[ASSET_ID]/tileset.json. Can be updated at runtime. ''
cameraEl selector A selector for the camera whose position is used to determine which tiles to display at which LOD. If a cameraEl value is not provided then component uses document.querySelector('a-scene').camera to find a-camera primitive or entity with camera component. For more info see Camera Requirement note below. The component automatically switches the camera in response to the camera-set-active event. ''
maximumSSE int maximumScreenSpaceError (Optional) determines the distance from tiles in which they are refined, depending on their geometrical size. Increase the value to load lower LOD tiles from the same view distance (increases performance). Cannot be updated at runtime. 16
maximumMem int maximumMemoryUsage (Optional) determines maximum GPU memory (MB) to use for displaying tiles. May go over the limit if tiles within the camera viewport exceed that amount. Cannot be updated at runtime. 32
distanceScale number (Optional) 0-1 scale for the LOD quality. A lower value loads tiles from lower LODs (increases performance). Can be updated at runtime. 1.0
pointcloudColoring string (Optional) When viewing point clouds, which datum determines the color of a point. Possible values: 'white', 'intensity', 'classification', 'elevation', 'rgb'. 'white'
pointcloudElevationRange array (Optional) When viewing point clouds colored by their elevation, what are the minimum and maximum height values. 0, 400
wireframe boolean (Optional) When viewing b3dm (mesh) tiles, show meshes as wireframe. Can be updated at runtime. false
showStats boolean (Optional) Attaches a box with tilestats to the scene, useful for debugging. false
cesiumIONToken string (Optional) A Cesium ION access token when loading tilesets from Cesium ION. ''

Camera Requirement

To use the loader-3dtiles component, your A-Frame scene must have a camera defined using <a-camera> or the camera component . The component will attempt to use one of these automatically, or you can specify your own selector with the cameraEl property.

The camera is used to provide dynamic levels of detail (LOD) for 3D tiles. If no suitable camera is found the tiles will not display and an error is shown on the console 3D Tiles: Please add an active camera or specify the target camera via the cameraEl property.

Compatability with THREE.Cache

Currently, three-loader-3dtiles does not support the use of THREE.Cache which is enabled by default in A-Frame. In its default setting, the cache does not recognize repeated loads of tiles, which causes the cache to overflow. Therefore, the loader-3dtiles component disables THREE.Cache if it is enabled and displays a warning: 3D Tiles loader cannot work with THREE.Cache, disabling.

Contributing

Refer to CONTRIBUTING.MD for general contribution instructions.

Roadmap

Suggestions for future work include:

  • More elaborate test cases.
  • Better integration with the inspector.
  • Test AR scenarios.
  • Test point-cloud scenarios.
  • Could THREE.Cache be used manually?
  • Conversion to Typescript.

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

More Repositories

1

covid-19-data

A repository of data on coronavirus cases and deaths in the U.S.
6,990
star
2

objective-c-style-guide

The Objective-C Style Guide used by The New York Times
5,848
star
3

gizmo

A Microservice Toolkit from The New York Times
Go
3,753
star
4

Store

Android Library for Async Data Loading and Caching
Java
3,531
star
5

NYTPhotoViewer

A modern photo viewing experience for iOS.
Objective-C
2,847
star
6

pourover

A library for simple, fast filtering and sorting of large collections in the browser. There is a community-maintained fork that addresses a handful of post-NYT issues available via @hhsnopek's https://github.com/hhsnopek/pourover
JavaScript
2,393
star
7

kyt

Starting a new JS app? Build, test and run advanced apps with kyt πŸ”₯
JavaScript
1,922
star
8

react-tracking

🎯 Declarative tracking for React apps.
JavaScript
1,862
star
9

ice

track changes with javascript
JavaScript
1,708
star
10

backbone.stickit

Backbone data binding, model binding plugin. The real logic-less templates.
JavaScript
1,641
star
11

library

A collaborative documentation site, powered by Google Docs.
JavaScript
1,132
star
12

openapi2proto

A tool for generating Protobuf v3 schemas and gRPC service definitions from OpenAPI specifications
Go
940
star
13

gziphandler

Go middleware to gzip HTTP responses
Go
857
star
14

svg-crowbar

Extracts an SVG node and accompanying styles from an HTML document and allows you to download it all as an SVG file.
JavaScript
840
star
15

ingredient-phrase-tagger

Extract structured data from ingredient phrases using conditional random fields
Python
784
star
16

Emphasis

Dynamic Deep-Linking and Highlighting
JavaScript
576
star
17

tamper

Ruby
499
star
18

three-loader-3dtiles

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.
TypeScript
421
star
19

rd-blender-docker

A collection of Docker containers for running Blender headless or distributed ✨
Python
415
star
20

react-prosemirror

A library for safely integrating ProseMirror and React.
TypeScript
389
star
21

Register

Android Library and App for testing Play Store billing
Kotlin
380
star
22

text-balancer

Eliminate typographic widows and other type crimes with this javascript module
JavaScript
373
star
23

document-viewer

The NYTimes Document Viewer
JavaScript
310
star
24

ios-360-videos

NYT360Video plays 360-degree video streamed from an AVPlayer on iOS.
Objective-C
273
star
25

three-story-controls

A three.js camera toolkit for creating interactive 3d stories
TypeScript
247
star
26

backbone.trackit

Manage unsaved changes in a Backbone Model.
JavaScript
202
star
27

marvin

A go-kit HTTP server for the App Engine Standard Environment
Go
177
star
28

drone-gke

Drone plugin for deploying containers to Google Kubernetes Engine (GKE)
Go
165
star
29

Chronicler

A better way to write your release notes.
JavaScript
162
star
30

nginx-vod-module-docker

Docker image for nginx with Kaltura's VoD module used by The New York Times
Dockerfile
161
star
31

collectd-rabbitmq

A collected plugin, written in python, to collect statistics from RabbitMQ.
Python
143
star
32

public_api_specs

The API Specs (in OpenAPI/Swagger) for the APIs available from developer.nytimes.com
136
star
33

gunsales

Statistical analysis of monthly background checks of gun purchases
R
130
star
34

rd-bundler-3d-plugins

Bundler plugins for optimizing glTF 3D models
JavaScript
119
star
35

gcp-vault

A client for securely retrieving secrets from Vault in Google Cloud infrastructure
Go
119
star
36

Fech

Deprecated. Please see https://github.com/dwillis/Fech for a maintained fork.
Ruby
115
star
37

data-training

Files from the NYT data training program, available for public use.
114
star
38

drone-gae

Drone plugin for managing deployments and services on Google App Engine (GAE)
Go
97
star
39

mock-ec2-metadata

Go
95
star
40

encoding-wrapper

Collection of Go wrappers for Video encoding cloud providers (moved to @video-dev)
Go
85
star
41

redux-taxi

πŸš• Component-driven asynchronous SSR in isomorphic Redux apps
JavaScript
70
star
42

video-captions-api

Agnostic API to generate captions for media assets across different transcription services.
Go
61
star
43

lifeline

A cron-based alternative to running daemons
Ruby
58
star
44

gcs-helper

Tool for proxying and mapping HTTP requests to Google Cloud Storage (GCS).
Go
54
star
45

logrotate

Go
54
star
46

httptest

A simple concurrent HTTP testing tool
Go
48
star
47

vault-fastly-secret-engine

Vault plugin to generate short lived Fastly API tokens
Go
37
star
48

kyt-starter-universal

Deprecated, see: https://github.com/NYTimes/kyt/tree/master/packages/kyt-starter-universal
JavaScript
33
star
49

nytcampfin

A thin Python client for The New York Times Campaign Finance API
Python
27
star
50

safejson

safeJSON provides replacements for the 'load' and 'loads' methods in the standard Python 'json' module.
Python
27
star
51

thumbor-docker-image

Docker image for Thumbor smart imaging service
26
star
52

times_wire

A thin Ruby client for The New York Times Newswire API
Ruby
26
star
53

haiti-debt

Historical data on Haiti’s debt payments to France collected by The New York Times.
21
star
54

jsonlogic

Clojure
20
star
55

elemental-live-client

JS library to communicate with Elemental live API.
JavaScript
19
star
56

Open-Source-Science-Fair

The New York Times Open Source Science Fair
JavaScript
19
star
57

tweetftp

Ruby Implementation of the Tweet File Transfer Protocol (APRIL FOOLS JOKE)
Ruby
19
star
58

prosemirror-change-tracking-prototype

JavaScript
18
star
59

plumbook

Data from the Plum Book, published by the GPO every 4 years
17
star
60

libvmod-queryfilter

Simple querystring filter/sort module for Varnish Cache v3-v6
M4
16
star
61

sneeze

Python
16
star
62

hhs-child-migrant-data

Data from the U.S. Department of Human Health and Services on children who have migrated to the United States without an adult.
15
star
63

querqy-clj

Search Query Rewriting for Elasticsearch and more! Built on Querqy.
Clojure
14
star
64

sqliface

handy interfaces and test implementations for Go's database/sql package
Go
14
star
65

grocery

The grocery package provides easy mechanisms for storing, loading, and updating Go structs in Redis.
Go
13
star
66

oak-byo-react-prosemirror-redux

JavaScript
13
star
67

vase.elasticsearch

Vase Bindings for Elasticsearch
Clojure
11
star
68

library-customization-example

An example repo that customizes Library behavior
SCSS
11
star
69

counter

count things, either as a one-off or aggregated over time
Ruby
11
star
70

kyt-starter

The default starter-kyt for kyt apps.
JavaScript
10
star
71

open-blog-projects

A repository for code examples that are paired with our Open Blog posts
Swift
9
star
72

rd-mobile-pg-demos

HTML
9
star
73

pocket_change

Python
9
star
74

mentorship

7
star
75

tulsa-1921-data

Data files associated with our story on the 1921 race massacre in Tulsa, Oklahoma.
7
star
76

sort_by_str

SQL-like sorts on your Enumerables
Ruby
7
star
77

drone-gdm

Drone.io plugin to facilitate the use of Google Deployment Manager in drone deploy phase.
Go
6
star
78

kyt-starter-static

Deprecated, see: https://github.com/NYTimes/kyt/tree/master/packages/kyt-starter-static
JavaScript
6
star
79

s3yum

Python
5
star
80

pocket

Python
5
star
81

drone-openapi

A Drone plugin for publishing Open API service specifications
Go
5
star
82

threeplay

Go client for the 3Play API.
Go
4
star
83

amara

Amara client for Go
Go
4
star
84

go-compare-expressions

Go
3
star
85

kaichu

Python
3
star
86

license

NYT Apache 2.0 license
3
star
87

prosemirror-tooltip

JavaScript
2
star
88

photon-dev_demo

A "Sustainable Systems, Powered By Python" Demo Repository (1 of 3)
Shell
2
star
89

std-cat

Content Aggregation Technology β€” a standard for content aggregation on the Web
HTML
1
star