Newer
Older
ARsample / index.html
@HIROSE Yuuji HIROSE Yuuji on 15 May 2022 1 KB Remove unused div
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0,
maximum-scale=1.0, minimum-scale=1.0, user-scalable=no,
target-densityDpi=device-dpi" />

<title>A-Frame で超簡単 AR</title>
<style type="text/css">
<!--
.button {position: fixed; bottom: 1em; left: 1em; border: 1px solid
black;}
.notfound {display: none;}
-->
</style>
</head>
<body style="margin: 0px; overflow:hidden;">
 <!-- A-Frame ライブラリの読み込み -->
 <script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
 <!-- AR.js ライブラリの読み込み -->
 <script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js"></script>
 
 <!-- A-Frame の VR空間に AR.js を紐づける(デバッグUIを非表示) -->
 <a-scene embedded arjs="debugUIEnabled:false;">
 
  <!-- マーカーを登録(プリセットされている「hiro」マーカー) -->
  <a-marker preset="custom" type="pattern" url='pattern-koeki.patt'>
   <!-- マーカーの場所に箱を置く(見やすいようにワイヤーフレーム表示) -->
  <!--
  <a-box position="0 0.10 0" wireframe="true"
  	animation="property:rotation; dur:100000; from:0 0 0; to:0 360 0;
		loop: -1; easing:linear;"></a-box>
  -->
  <a-asset-item id="mashiro" src="mashiro-light.gltf"></a-asset-item>
  <a-entity position="0 0.5 0"
  	rotation="-90 0 0" gltf-model="#mashiro"></a-entity>
  
  </a-marker>
  
  <!-- AR用のカメラを置く -->
  <a-entity camera></a-entity>
  
 </a-scene>

</body>
</html>