Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 1.86 KB

File metadata and controls

43 lines (32 loc) · 1.86 KB

CesiumJS GLB Injector

This project demonstrates how GLB assets can be configurably injected into Cesium. Out of the box, this example will spawn Godzilla in several locations around the world. However, any asset can be spawned provided its GLB exists in the assets/glb directory and it has been fully specified in glb-config.json.

Setup

  1. Create a free Cesium Account

  2. Go to Cesium Ion and select Access Tokens

  3. Create or reuse an existing access token with the following access:

    • assets:read
    • geocode
  4. Copy the value under Token

  5. Create a .env file in the root directory of this repository containing the following, where <Token Value> is replaced by the token copied in the previous step:

    CESIUM_TOKEN=<Token Value>
    

Usage

  1. Open this project in the provided devcontainer:

    F1-> DevContainers: Rebuild and Reopen in Container
    
  2. Add or Remove GLB Assets to ./glb-injector/assets/glb. Sketchfab is an excellent resource for GLB assets.

  3. Update glb-config.json with the asset information required for your scene

  4. Launch the application via F5 or:

    Run and Debug -> Run Application
    
  5. Once webpack has built and deployed the application, it can be accessed at:

    http://localhost:8080
    

Attribution