Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

website: Add hello gltf example #2192

Open
wants to merge 9 commits into
base: 9.0-release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/tutorials/hello-gltf/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
super();
this.device = device;
this.loadGLTF('Avocado');
const modelSelector = document.getElementById('model-select');

Check failure on line 29 in examples/tutorials/hello-gltf/app.ts

View workflow job for this annotation

GitHub Actions / test (18)

'modelSelector' is declared but its value is never read.

modelSelector.addEventListener('change', e => {
this.loadGLTF((e.target as HTMLSelectElement).value);
});
// modelSelector.addEventListener('change', e => {
felixpalmer marked this conversation as resolved.
Show resolved Hide resolved
// this.loadGLTF((e.target as HTMLSelectElement).value);
// });
}

onFinalize() {
Expand Down
7 changes: 7 additions & 0 deletions website/content/examples/tutorials/hello-gltf.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {DeviceTabs} from '@site/src/react-luma';
import {HelloGltfExample} from '@site';

# Hello Gltf

<DeviceTabs />
<HelloGltfExample />
1 change: 1 addition & 0 deletions website/content/sidebar-examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const sidebars = {
'tutorials/hello-cube',
'tutorials/lighting',
'tutorials/hello-instancing',
'tutorials/hello-gltf',
'tutorials/shader-modules',
'tutorials/shader-hooks'
]
Expand Down
1 change: 1 addition & 0 deletions website/content/sidebar-examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"tutorials/hello-cube",
"tutorials/lighting",
"tutorials/hello-instancing",
"tutorials/hello-gltf",
felixpalmer marked this conversation as resolved.
Show resolved Hide resolved
"tutorials/shader-modules",
"tutorials/shader-hooks"
]
Expand Down
3 changes: 1 addition & 2 deletions website/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
export {
HelloTriangleExample,
HelloCubeExample,
HelloGltfExample,
LightingExample,
HelloInstancingExample,
InstancedTransformExample,
Expand All @@ -13,11 +14,9 @@ export {
// GeospatialExample
InstancingExample,
PersistenceExample,

AnimationExample,
CubemapExample,
Texture3DExample,

HelloTriangleWebGPUExample,
InstancedCubesWebGPUExample,
RotatingCubeWebGPUExample,
Expand Down
10 changes: 10 additions & 0 deletions website/src/examples/templates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import PersistenceApp from '../../../examples/showcase/persistence/app';
// import WanderingApp from '../../../examples/showcase/wandering/app';

import HelloCubeApp from '../../../examples/tutorials/hello-cube/app';
import HelloGltfApp from '../../../examples/tutorials/hello-gltf/app';
import HelloInstancingApp from '../../../examples/tutorials/hello-instancing/app';
import HelloTriangleApp from '../../../examples/tutorials/hello-triangle/app';
import LightingApp from '../../../examples/tutorials/lighting/app';
Expand Down Expand Up @@ -128,6 +129,15 @@ export const HelloCubeExample: React.FC = () => (
/>
);

export const HelloGltfExample: React.FC = () => (
<LumaExample
id="hello-gltf"
directory="tutorials"
template={HelloGltfApp}
config={exampleConfig}
/>
);

export const HelloInstancingExample: React.FC = () => (
<LumaExample
id="hello-instancing"
Expand Down
Loading