Skip to content

Latest commit

 

History

History

threejs-sample

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

threejs-3d-tiles-sample

This is a sample that demonstrates how to view a tileset in the Cesium 3D Tiles format from the iTwin platform cesium curated content in three.js. This is done using 3DTilesRendererJS, a package that implements a three.js renderer for 3D Tiles. For this sample, the Cesium Moon Terrian will be rendered.

The Cesium Curated Content is an API available through the iTwin Platform.

Environment variables

In a .env file in the threejs-sample directory:

  • VITE_CLIENT_ID - SPA Application Client ID needed to sign in with Bentley IMS (required)
  • VITE_IMS_PREFIX - Bentley IMS authority prefix (optional)

For an example of the .env file, one has been provided here

Authentication

This samples uses the @itwin/auth-clients package to handle authentication. It requires a SPA Application to be registered on the iTwin Platform. This can be done here (click the "+ Register Now" button in the top right). During registration http://localhost:8080 should be added to the list of valid Redirect URIs.

The environment variable VITE_CLIENT_ID should be set to the client id of this newly registered SPA Application.

Steps to run

In the root directory:

pnpm install
pnpm build
cd threejs-sample
pnpm dev