This is the official Khronos glTF 2.0 Sample Viewer using WebGL: glTF 2.0 Sample Viewer
Link to the live glTF 2.0 Sample Viewer.
click + drag
: Rotate model
scroll
: Zoom camera
GUI
: Use to change models and settings
- Choose one of the glTF models in the selection list
- Drag and drop glTF files into viewer
- Drag and drop a .hdr panorama file
For local usage and debugging, please follow these instructions:
-
Make sure Git LFS is installed.
-
Checkout the
master
branch -
Pull the submodules for the required glTF sample models and environments
git submodule update --init --recursive
-
Build the web app
cd app_web
- run
npm install
- start a demo in the browser with
npm run dev
, and open http://localhost:8000.
When making changes, the project is automatically rebuilt and the app_web/dist/
directory is populated with the web app. This directory contains all files necessary for deployment to a webserver.
- Requirements
- Install the Debugger for Chrome or Debugger for Firefox extension for Visual Studio Code
- Open the project directory in Visual Studio Code and select
Debug->Add Configuration->Chrome
orDebug->Add Configuration->Firefox
so the.vscode/launch.json
file is created. - Append
/app_web/dist
to${workspaceFolder}
in thelaunch.json
file Debug->Start Debugging
should now launch a Chrome or Firefox window with the sample viewer and VS Code breakpoints should be hit.