-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathar-viewer.html
More file actions
28 lines (26 loc) · 1.02 KB
/
ar-viewer.html
File metadata and controls
28 lines (26 loc) · 1.02 KB
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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script>
<script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js"></script>
</head>
<body style="margin: 0; overflow: hidden;">
<a-scene embedded arjs="sourceType: webcam; debugUIEnabled: false;">
<a-marker preset="hiro">
<a-entity id="model-container"></a-entity>
</a-marker>
<a-entity camera></a-entity>
</a-scene>
<script>
const urlParams = new URLSearchParams(window.location.search);
const modelUrl = urlParams.get('model');
if (modelUrl) {
const modelEntity = document.createElement('a-entity');
modelEntity.setAttribute('gltf-model', modelUrl);
modelEntity.setAttribute('scale', '0.1 0.1 0.1');
document.getElementById('model-container').appendChild(modelEntity);
}
</script>
</body>
</html>