-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathar.html
More file actions
38 lines (32 loc) · 1.45 KB
/
ar.html
File metadata and controls
38 lines (32 loc) · 1.45 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
29
30
31
32
33
34
35
36
37
38
<html>
<head>
<title>Hello</title>
<meta name="description" content="Hello, WebVR! - A-Frame">
<script src="https://aframe.io/releases/0.9.1/aframe.min.js"></script>
<script src="https://jeromeetienne.github.io/AR.js/aframe/build/aframe-ar.js"> </script>
<link rel="stylesheet" href="styles.css">
<script>
var e;
window.addEventListener('message', function (event) {
//document.getElementById("entity").collada-model="url("+event.data+")";
var e = document.querySelector('#entity');
//e.setAttribute("collada-model", 'url('+event.data+')');
e.setAttribute("obj-model", 'obj:url(' + event.data + '.obj);mtl:url(' + event.data + '.mtl)');
//document.getElementById("mtl").src=event.data+'.mtl';
//alert('Inside ar.html outside if: '+document.getElementById("entity").collada-model);
});
// document.addEventListener('click', function (material) {
// e.setAttribute("obj-model", 'obj:url(' + event.data + '.obj);mtl:url(' + material + '.mtl)');
// });
</script>
</head>
<body style="margin : 0px; overflow: hidden;">
<a-scene embedded arjs="sourceType: webcam;">
<a-marker preset="hiro">
<a-entity class="Obj_mal" id="entity" scale="0.02 0.02 0.02" rotation="-90 0 0" position="0 0 0">
</a-entity>
</a-scene>
</body>
</html>
<!-- obj-model="obj: url(https://shreyanshmmgn.github.io/TestingAR_js/IronMan.obj);
mtl: url(https://shreyanshmmgn.github.io/TestingAR_js//IronMan.mtl)" -->