forked from Prudenceyyx/prototype_aframe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgif.html
30 lines (28 loc) · 1.46 KB
/
gif.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
<head>
<title>A-Frame using Gif Componeng and Shader</title>
<script src="https://aframe.io/releases/0.8.2/aframe.min.js"></script>
<script src="https://rawgit.com/mayognaise/aframe-gif-shader/master/dist/aframe-gif-shader.min.js"></script>
<script src="https://rawgit.com/mayognaise/aframe-gif-component/master/dist/aframe-gif-component.min.js"></script>
<link rel="stylesheet" type="text/css" href="common.css">
</head>
<body>
<a-scene>
<a-assets></a-assets>
<a-entity position="0 0 -6">
<a-entity geometry="primitive:circle;segments:4;" position="0 3 0" material="shader:gif;src:url(pusheen.gif);color:orange;" gif=""></a-entity>
<a-entity geometry="primitive:circle;" position="-1.5 1.5 0" material="shader:gif;src:url(pusheen.gif);" gif=""></a-entity>
<a-entity geometry="primitive:circle;segments:6;" position="0 0 0" material="shader:gif;src:url(nyancat.gif);color:green;" gif=""></a-entity>
<a-entity id="nyancat" geometry="primitive:box" position="1.2 1.5 1.5" material="shader:gif;src:url(nyancat.gif);transparent:true;opacity:.4;" gif=""></a-entity>
<a-sky color="pink"></a-sky>
</a-scene>
<div class="buttons">
<a href="javascript:togglePlayback('nyancat')">toggle playback<br/>(nyancat in box)</a>
</div>
<div class="spacer"></div>
<div class="spacer2"></div>
<script>
function togglePlayback(id) {
document.getElementById(id).components.gif.togglePlayback()
}
</script>
</body>