forked from google/model-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel-formats.html
174 lines (157 loc) · 6.59 KB
/
model-formats.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<!--
/*
* Copyright 2018 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title><model-viewer> Format Support</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no,
minimum-scale=1.0, maximum-scale=1.0">
<link type="text/css" href="styles/examples.css" rel="stylesheet" />
<link rel="shortcut icon" type="image/png" href="assets/favicon.png"/>
<!-- The following libraries and polyfills are recommended to maximize browser support -->
<!-- 🚨 REQUIRED: Web Components polyfill to support Edge and Firefox < 63 -->
<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<!-- 💁 OPTIONAL: Intersection Observer polyfill for better performance in Safari and IE11 -->
<script src="../node_modules/intersection-observer/intersection-observer.js"></script>
<!-- 💁 OPTIONAL: Resize Observer polyfill improves resize behavior in non-Chrome browsers -->
<script src="../node_modules/resize-observer-polyfill/dist/ResizeObserver.js"></script>
<!-- 💁 OPTIONAL: Fullscreen polyfill is required for experimental AR features in Canary -->
<script src="../node_modules/fullscreen-polyfill/dist/fullscreen.polyfill.js"></script>
<!-- 💁 OPTIONAL: Include prismatic.js for Magic Leap support -->
<!--<script src="../node_modules/@magicleap/prismatic/prismatic.min.js"></script>-->
</head>
<body>
<div class="sample">
<div id="demo-container-1" class="demo"></div>
<div class="content">
<div class="wrapper">
<a class="lockup" href="../index.html"><div class="icon-button icon-modelviewer-black"></div><h1>examples</h1></a>
<h4 id="intro"><span class="font-medium">Model Formats. </span>Learn how model formats work on different platforms. This page tests configurations of the model source.</h4>
<div class="heading">
<h2 class="demo-title">With a glTF model</h2>
<h4></h4>
</div>
<example-snippet stamp-to="demo-container-1" highlight-as="html">
<template>
<model-viewer camera-controls background-color="#222" alt="A 3D model of a sphere" src="assets/reflective-sphere.gltf">
</model-viewer>
</template>
</example-snippet>
</div>
</div>
</div>
<div class="sample">
<div id="demo-container-2" class="demo"></div>
<div class="content">
<div class="wrapper">
<div class="heading">
<h2 class="demo-title">With a GLB model</h2>
<h4></h4>
</div>
<example-snippet stamp-to="demo-container-2" highlight-as="html">
<template>
<model-viewer camera-controls background-color="#ccc" alt="A 3D model of an astronaut" src="assets/Astronaut.glb">
</model-viewer>
</template>
</example-snippet>
</div>
</div>
</div>
<div class="sample">
<div id="demo-container-3" class="demo"></div>
<div class="content">
<div class="wrapper">
<div class="heading">
<h2 class="demo-title">With only a USDZ model</h2>
<h4>Note that this won't display a model (as that requires a glTF or GLB), but could be used with poster to show a static image and the icon to enter augmented reality mode</h4>
</div>
<example-snippet stamp-to="demo-container-3" highlight-as="html">
<template>
<model-viewer camera-controls background-color="#3cba54" alt="A 3D model of an astronaut" ios-src="assets/Astronaut.usdz">
</model-viewer>
</template>
</example-snippet>
</div>
</div>
</div>
<div class="sample">
<div id="demo-container-4" class="demo"></div>
<div class="content">
<div class="wrapper">
<div class="heading">
<h2 class="demo-title">With no model</h2>
<h4>There's nothing to show, but also no error.</h4>
</div>
<example-snippet stamp-to="demo-container-4" highlight-as="html">
<template>
<model-viewer background-color="#4885ed" alt="An invalid model" src="i-do-not-exist.glb">
</model-viewer>
</template>
</example-snippet>
</div>
</div>
</div>
<div class="sample">
<div id="demo-container-5" class="demo"></div>
<div class="content">
<div class="wrapper">
<div class="heading">
<h2 class="demo-title">Cycling between different models</h2>
<h4></h4>
</div>
<example-snippet stamp-to="demo-container-5" highlight-as="html">
<template>
<model-viewer id="toggle-model" src="assets/shishkebab.glb" alt="A 3D model of a shishkebab" background-color="#222" camera-controls auto-rotate></model-viewer>
<script>
const models = ['shishkebab.glb', 'Astronaut.glb'];
let i = 0;
setInterval(() => $('#toggle-model').setAttribute('src', `assets/${models[i++ % 2]}`), 2000);
</script>
</template>
</example-snippet>
</div>
</div>
</div>
<div class="footer">
<ul>
<li class="attribution">
<a href="https://poly.google.com/view/dLHpzNdygsg">Astronaut</a> by <a href="https://poly.google.com/user/4aEd8rQgKu2">Poly</a>,
licensed under <a href="https://creativecommons.org/licenses/by/2.0/">CC-BY</a>.
</li>
</ul>
<div style="margin-top:24px;" class="copyright">©Copyright 2018 Google Inc. Licensed under the Apache License 2.0.</div>
<div><a href="https://github.com/GoogleWebComponents/model-viewer">Github</a> ∙ <a href="https://model-viewer.glitch.me/">Glitch</a> ∙ <a href="https://github.com/GoogleWebComponents/model-viewer/issues">Bug report</a></div>
</div>
<script src="./scripts/helpers.js"></script>
<!-- Documentation-specific dependencies: -->
<script type="module"
src="./built/dependencies.js">
</script>
<script nomodule
src="./built/dependencies-legacy.js">
</script>
<!-- Loads <model-viewer> only on modern browsers: -->
<script type="module"
src="../dist/model-viewer.js">
</script>
<!-- Loads <model-viewer> only on old browsers like IE11: -->
<script nomodule
src="../dist/model-viewer-legacy.js">
</script>
</body>
</html>