model-viewer web component custom modifications
Starting from scene code generated by the model-viewer Editor at https://modelviewer.dev/editor/, this adds the ability to parse query parameters so that new models and posters placed in a models/
subdirectory can be loaded via queries following the format
?model=model-name
Try it out by loading the included horse or dog models,e.g.
mywebsite.com/model/?model=horse
To add additional models:
- upload a model-name.glb file to the Editor
- download the webp format poster
- rename poster.webp to model-name.webp
- place both in the
models/
subdirectory - access at ?model=model-name.