davidvgilmore commited on
Commit
1e27f46
·
verified ·
1 Parent(s): b58f246

Upload assets/modelviewer-textured-template.html with huggingface_hub

Browse files
assets/modelviewer-textured-template.html ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <!-- Import the component -->
6
+ <!--<script src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.1.1/model-viewer.min.js" type="module"></script> -->
7
+ <script src="https://cdn.jsdelivr.net/npm/@google/[email protected]/dist/model-viewer.min.js" type="module"></script>
8
+
9
+ <style>
10
+ body {
11
+ margin: 0;
12
+ font-family: Arial, sans-serif;
13
+ }
14
+
15
+ .centered-container {
16
+ display: flex;
17
+ justify-content: center;
18
+ align-items: center;
19
+ border-radius: 8px;
20
+ border-color: #e5e7eb;
21
+ border-style: solid;
22
+ border-width: 1px;
23
+ }
24
+ </style>
25
+ </head>
26
+
27
+ <body>
28
+ <div class="centered-container">
29
+ <model-viewer>
30
+ </div>
31
+
32
+ <script>
33
+ document.addEventListener('DOMContentLoaded', () => {
34
+ const modelViewers = document.querySelectorAll('model-viewer');
35
+
36
+ modelViewers.forEach(modelViewer => {
37
+ modelViewer.addEventListener('load', (event) => {
38
+ const [material] = modelViewer.model.materials;
39
+ material.pbrMetallicRoughness.setMetallicFactor(0.1);
40
+ material.pbrMetallicRoughness.setRoughnessFactor(0.5);
41
+ });
42
+ });
43
+ });
44
+ </script>
45
+ </body>
46
+
47
+ </html>