-
Notifications
You must be signed in to change notification settings - Fork 838
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs, tests, license, attributions
- Loading branch information
Chris Joel
committed
Mar 14, 2019
1 parent
1d2fbde
commit f5559bf
Showing
19 changed files
with
561 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
<!-- | ||
/* | ||
* 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> Lighting & Environment</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"/> | ||
<script src="../node_modules/resize-observer-polyfill/dist/ResizeObserver.js"></script> | ||
|
||
<!-- 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 class="multiple-samples"> | ||
|
||
<div id="header"> | ||
<a class="icon-button icon-return" href="../index.html"></a> | ||
<a class="icon-github icon-button" href="https://github.com/GoogleWebComponents/model-viewer/blob/master/examples/lighting-and-environment.html"></a> | ||
</div> | ||
|
||
<div class="center intro"> | ||
<h2>Animation</h2> | ||
<h4>This page showcases how you can control models with animations</h4> | ||
</div> | ||
|
||
<div class="sample"> | ||
<div class="demo" id="demo-container-1"></div> | ||
<div class="content"> | ||
<div class="wrapper"> | ||
<div class="index">1</div> | ||
<h2>Activate animations with the | ||
<span class="attribute">animated</span> attribute</h2> | ||
<example-snippet stamp-to="demo-container-1" highlight-as="html"> | ||
<template> | ||
<model-viewer | ||
controls | ||
animated | ||
src="assets/RobotExpressive.glb" | ||
background-color="#622dcf" | ||
exposure="2" | ||
environment-intensity="0" | ||
alt="An animated 3D model of a robot"></model-viewer> | ||
</template> | ||
</example-snippet> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="sample"> | ||
<div class="demo" id="demo-container-2"></div> | ||
<div class="content"> | ||
<div class="wrapper"> | ||
<div class="index">2</div> | ||
<h2>Select a specific animation with <span class="attribute">animation-name</span></h2> | ||
<example-snippet stamp-to="demo-container-2" highlight-as="html"> | ||
<template> | ||
<model-viewer | ||
controls | ||
animated | ||
animation-name="Running" | ||
src="assets/RobotExpressive.glb" | ||
background-color="#25997c" | ||
exposure="2" | ||
environment-intensity="0" | ||
alt="An animated 3D model of a robot"></model-viewer> | ||
</template> | ||
</example-snippet> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="sample"> | ||
<div class="demo" id="demo-container-3"></div> | ||
<div class="content"> | ||
<div class="wrapper"> | ||
<div class="index">3</div> | ||
<h2>Animations crossfade when you change them</h2> | ||
<example-snippet stamp-to="demo-container-3" highlight-as="html"> | ||
<template> | ||
<model-viewer | ||
id="xfade-demo" | ||
controls | ||
animated | ||
animation-name="Running" | ||
src="assets/RobotExpressive.glb" | ||
background-color="#622dcf" | ||
exposure="2" | ||
environment-intensity="0" | ||
alt="An animated 3D model of a robot"></model-viewer> | ||
<script> | ||
(() => { | ||
const modelViewer = document.querySelector('#xfade-demo'); | ||
|
||
self.setInterval(() => { | ||
modelViewer.animationName = modelViewer.animationName === 'Running' ? | ||
'Wave' : 'Running'; | ||
}, 1500.0); | ||
})(); | ||
</script> | ||
</template> | ||
</example-snippet> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="footer"> | ||
<div class="attribution"> | ||
RobotExpressive by <a href="https://www.patreon.com/quaternius">Tomás Laulhé</a>, | ||
licensed under <a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0</a> | ||
(<a href="https://github.com/mrdoob/three.js/tree/dev/examples/models/gltf/RobotExpressive">source</a>) | ||
</div> | ||
<div class="copyright">©Copyright 2018 Google Inc. Licensed under the Apache License 2.0.</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> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.