https://techracho.bpsinc.jp/gengen/2018_12_17/66732にあるような一度ページに飛んだらカメラが起動して、マーカーを読み込ませたらARができる
というようなことをやりたいです
試しに
<!doctype HTML> <html> <!-- A-Frameを読み込み --> <script src="https://aframe.io/releases/0.8.2/aframe.min.js"></script> <!-- AR.jsを読み込み --> <script src="https://cdn.rawgit.com/jeromeetienne/AR.js/1.6.2/aframe/build/aframe-ar.js"></script> <body style="margin : 0px; overflow: hidden"> <!-- AR.jsのデバックとA-FrameのVRボタンを非表示 --> <a-scene embedded arjs="debugUIEnabled: false" vr-mode-ui="enabled: false"> <!-- a-markerのtypeにpatternを設定, 作ったpattファイルをurlにを指定 --> <a-marker type="pattern" url="pattern-marker.patt"> <!-- 赤い立方体を表示 --> <a-box position="0 0.5 0" width="0.5" height="0.5" depth="0.5" color="red"></a-box> </a-marker> <a-entity camera></a-entity> <a-scene embedded arjs="debugUIEnabled: false" vr-mode-ui="enabled: false"> <a-assets> <!-- 画像をプリロード --> <img id="kinga_sinnen" src="images/kinga_sinnen.png"> </a-assets> <!-- a-markerのtypeにpatternを設定, 作ったpattファイルをurlにを指定 --> <a-marker type="pattern" url="pattern-marker.patt"> <!-- 赤い立方体を表示 --> <a-box position="0 0.5 0" width="0.5" height="0.5" depth="0.5" color="red"></a-box> <a-entity> <!-- idを指定して画像を表示、x軸回りで-90度回転 --> <a-image src="#kinga_sinnen" width="2" height="2" rotation="-90 0 0"></a-image> <!-- a-imageを内包するa-entityをy軸周りで360度回転するアニメーション --> <!-- dur(間隔):4000(ms), repeat(繰り返し):止めない限り無限, easing(イージング):線形(イージングしない)--> <a-animation attribute="rotation" to="0 360 0" dur="4000" repeat="indefinite" easing="linear"></a-animation> </a-entity> </a-marker> <a-entity camera></a-entity> </a-scene> </body> </html>
というコードをそのまま貼り付けて貼り付けたページにアクセスしてみたのですが、
Webcam Error
Name:NotSupportedError
Message:Only secure origins are allowed(see:https://goo.gl/Y0ZkNV).
と出て何もなりません
エラーを調べてみたらHTTPS経由でないとアクセスできなくなっているというところまでは分かったのですが
HTTPSを経由するようにするにはどうしたら良いのでしょうか?
ご教授願えたらと思います
該当のページは
http://getabakoclub.com/2019/02/07/test2/
です
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。