-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwip.html
74 lines (67 loc) · 3.62 KB
/
wip.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
<!DOCTYPE html>
<html>
<head>
<script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>
<!-- <script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js"
}
}
</script>
<script type="module">
// import * as THREE from 'three';
// import { DecalGeometry } as DecalGeometry from THREE;
import { DecalGeometry } from 'https://unpkg.com/[email protected]/examples/js/geometries/DecalGeometry.js';
console.log('decalgeo',DecalGeometry)
</script> -->
<script src="https://unpkg.com/[email protected]/examples/js/geometries/DecalGeometry.js"></script>
<script src="polygon-offset.js"></script>
</head>
<body>
<a-scene>
<a-assets>
<img id="poster-image" src="https://cdn.glitch.global/a5690e54-af54-41cd-85d9-b745739e4a11/00055.png?v=1664334108075">
</a-assets>
<a-sky color="#6EBAA7"></a-sky>
<!-- parents have polygon offset: -->
<a-box polygon-offset position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9">
<a-plane position="0 0 .5" rotation="0 0 0" src="#poster-image"></a-plane>
<a-plane position="-.5 0 0" rotation="0 -90 0" src="#poster-image"></a-plane>
<a-text color="green" align="center" position="0 .75 0" value="with polygon-offset"></a-text>
</a-box>
<a-plane polygon-offset side="double" position="-1.5 2 -3.5" rotation="0 45 0" width="1" height="2" color="yellow">
<a-plane material="src:#poster-image;" ></a-plane>
</a-plane>
<!-- parents without polygon offset: -->
<a-box position="1 .5 -3" rotation="0 45 0" color="#4CC3D9">
<a-plane position="0 0 .5" rotation="0 0 0" src="#poster-image"></a-plane>
<a-plane position="-.5 0 0" rotation="0 -90 0" src="#poster-image"></a-plane>
<a-text rotation="0 -90 0" color="red" align="center" position="0 .75 0" value="without polygon-offset"></a-text>
</a-box>
<a-plane side="double" position="1.5 2 -3.5" rotation="0 -45 0" width="1" height="2" color="yellow">
<a-plane material="src:#poster-image;" ></a-plane>
</a-plane>
<!-- top and center, experimenting with decal-geometry -->
<a-plane opacity=".9" id="decal-plane" side="double" position="-.6 3 -4.5" rotation="45 0 0" width="1" height="2" color="yellow">
<a-text rotation="0 0 0" color="red" align="center" position="0 .75 0" value="decal-geometry (wip)"></a-text>
<a-entity decal-geometry></a-entity>
<!-- <a-plane decal-geometry material="src:#poster-image;"></a-plane> -->
<!-- <a-plane material="src:#poster-image;" ></a-plane> -->
<!-- -->
</a-plane>
<a-plane opacity=".1" id="decal-plane-clear" side="double" position=".6 3 -4.5" rotation="45 0 0" width="1" height="2" color="yellow">
<a-text rotation="0 0 0" color="red" align="center" position="0 .55 0" value="decal-geometry (wip)"></a-text>
<a-entity position=".1 .1 .1" decal-geometry></a-entity>
<!-- <a-plane decal-geometry material="src:#poster-image;"></a-plane> -->
<!-- <a-plane material="src:#poster-image;" ></a-plane> -->
<!-- -->
</a-plane>
<a-sphere opacity=".5" position="0 1.25 -5" radius="1.25" color="blue" >
<a-entity position=".1 .1 .1" decal-geometry></a-entity>
</a-sphere>
<a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
</a-scene>
</body>
</html>