You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Select all [glTF-Sample-Assets](https://github.com/KhronosGroup/glTF-Sample-Assets) directly via UI
48
46
- Load your own glTF/glb and HDR files via drag and drop
49
47
- Customize lighting and tone mapping
@@ -55,9 +53,7 @@ Features
55
53
- Show statistics about the currently loaded file
56
54
- Specify URL parameters to modify behavior on load
57
55
58
-
59
-
Usage
60
-
-----
56
+
## Usage
61
57
62
58
### Controls
63
59
@@ -73,50 +69,52 @@ Usage
73
69
74
70
### Change glTF model
75
71
76
-
* Choose one of the glTF models in the selection list
77
-
* Drag and drop glTF files into viewer
72
+
- Choose one of the glTF models in the selection list
73
+
- Drag and drop glTF files into viewer
78
74
79
75
### Change the environment map
80
-
* Drag and drop a .hdr panorama file
76
+
77
+
- Drag and drop a .hdr panorama file
81
78
82
79
### URL parameters
80
+
83
81
URL parameters are added at the end of the sample viewer URL: \
84
82
`?key=value&another_key=another_value`
85
83
86
84
Possible parameters:
85
+
87
86
-`model=URL_to_file`: Load glTF/glb from specified URL
88
-
-`noUI`: Disable UI
87
+
-`noUI`: Disable UI
89
88
-`yaw=90`: Orbit the camera around the model along the Y-axis in degrees. With 90 degrees you look at the model from the left side.
90
89
-`pitch=90`: Orbit the camera around the model along the X-axis in degrees. With 90 degrees you look at the model from the top. Value range: -90 to 90
91
90
-`distance=5`: The models gets smaller with positive and bigger with negative numbers. Relative to the initial camera position.
92
91
93
-
Setup
94
-
-----
92
+
## Setup
95
93
96
94
For local usage and debugging, please follow these instructions:
97
95
98
96
1. Checkout the [`main`](../../tree/main) branch
99
97
100
-
2. Pull the submodule for the required [glTF-Sample-Renderer](https://github.com/KhronosGroup/glTF-Sample-Renderer)`git submodule update --init --recursive`
98
+
2. Pull the submodule for the required [glTF-Sample-Renderer](https://github.com/KhronosGroup/glTF-Sample-Renderer)`git submodule update --init --recursive`
101
99
102
100
3. Build the web app
103
-
- run `npm install`
104
-
- start a demo in the browser with `npm run dev`, and open http://localhost:8000.
101
+
- run `npm install`
102
+
- start a demo in the browser with `npm run dev`, and open http://localhost:8000.
105
103
106
104
When making changes, the project is automatically rebuilt and the `./dist` directory is populated with the web app. This directory contains all files necessary for deployment to a webserver.
107
105
108
-
Debugging
109
-
---------
106
+
## Debugging
110
107
111
-
* Requirements
112
-
*[Visual Studio Code](https://code.visualstudio.com/) or [vscodium](https://github.com/VSCodium/vscodium)
113
-
*[Chrome](https://www.google.com/chrome/) or [Firefox](https://www.mozilla.org/en-US/firefox/new/)
114
-
* Install the [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) or [Debugger for Firefox](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-firefox-debug) extension for Visual Studio Code
115
-
* Open the project directory in Visual Studio Code and select `Debug->Add Configuration->Chrome` or `Debug->Add Configuration->Firefox` so the `.vscode/launch.json` file is created.
116
-
* For chrome: Append `/dist` to `${workspaceFolder}` in the `launch.json` file
117
-
*`Debug->Start Debugging` should now launch a Chrome or Firefox window with the sample viewer and VS Code breakpoints should be hit.
108
+
- Requirements
109
+
-[Visual Studio Code](https://code.visualstudio.com/) or [vscodium](https://github.com/VSCodium/vscodium)
110
+
-[Chrome](https://www.google.com/chrome/) or [Firefox](https://www.mozilla.org/en-US/firefox/new/)
111
+
- Install the [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) or [Debugger for Firefox](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-firefox-debug) extension for Visual Studio Code
112
+
- Open the project directory in Visual Studio Code and select `Debug->Add Configuration->Chrome` or `Debug->Add Configuration->Firefox` so the `.vscode/launch.json` file is created.
113
+
- For chrome: Append `/dist` to `${workspaceFolder}` in the `launch.json` file
114
+
-`Debug->Start Debugging` should now launch a Chrome or Firefox window with the sample viewer and VS Code breakpoints should be hit.
118
115
119
116
### Known Issues
117
+
120
118
npm install / npm run dev give the following warnings:
121
119
122
120
The following warning comes from a thirdparty and does not affect sample viewer since the mentioned line 179 is never executed.
@@ -167,4 +165,25 @@ npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supporte
167
165
npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
168
166
npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
169
167
npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
170
-
```
168
+
```
169
+
170
+
## Formatting
171
+
172
+
This repository uses [Prettier](https://prettier.io/) for code formatting and [ESLint](https://eslint.org/) for linting.
173
+
174
+
To check the formatting and linting of the code run:
175
+
176
+
```bash
177
+
npm run format
178
+
```
179
+
180
+
Prettier and ESLint are configured to only run on files in the "source" folder and ignore files in "source/libs".
181
+
182
+
#### Visual Studio Code
183
+
184
+
There are extensions for both Prettier and ESLint in Visual Studio Code. They can be found in the marketplace:
0 commit comments