Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Three.js 基于位置的AR.js示例不';不要移动物体_Three.js_Gps_Aframe_Ar.js_Location Based - Fatal编程技术网

Three.js 基于位置的AR.js示例不';不要移动物体

Three.js 基于位置的AR.js示例不';不要移动物体,three.js,gps,aframe,ar.js,location-based,Three.js,Gps,Aframe,Ar.js,Location Based,我正在使用AR.js创建AR场景。标记一切正常,但当我使用基于位置的AR时,对象显示在一个位置,并且在设备旋转时不会移动 <html> <head> <script src="https://aframe.io/releases/0.9.2/aframe.min.js"></script> <script src="https://cdn.rawgit.com/jeromeetienne/AR.js/2.0.6/aframe/buil

我正在使用AR.js创建AR场景。标记一切正常,但当我使用基于位置的AR时,对象显示在一个位置,并且在设备旋转时不会移动

<html>
<head>
  <script src="https://aframe.io/releases/0.9.2/aframe.min.js"></script>
  <script src="https://cdn.rawgit.com/jeromeetienne/AR.js/2.0.6/aframe/build/aframe-ar.js"></script>
</head>
<body style="margin: 0px; overflow: hidden;">
  <a-scene gps-camera-debug embedded arjs="sourceType: webcam; debugUIEnabled: false;" vr-mode-ui="enabled: false">
    <a-camera gps-camera rotation-reader>
      <a-box color="yellow" gps-entity-place="latitude: <lat>; longitude: <long>" scale="2 2 2" />
    </a-camera>
  </a-scene>
</body>
</html>

你知道我遗漏了什么吗?

这个盒子不应该是相机的子项

<a-camera gps-camera rotation-reader>
</a-camera>
<a-box color="yellow" gps-entity-place="latitude: <lat>; longitude: <long>" scale="2 2 2" />


当gps试图定位盒子时,可能会有一场比赛,同时它正在应用相机变换。一个疯狂的猜测,但仍然尝试了它,它与上面的代码在android chrome上工作

谢谢!这确实使正方形看起来更加一致。但是,现在正方形将使用鼠标光标而不是相机四处移动。我想这是一个单独的问题,但是如果你有任何想法,请分享。@BishopZ如果你在盒子旁边有一个光标,那么就把光标留在相机内,因为它应该被固定,然后替换盒子。
<a-camera gps-camera rotation-reader>
</a-camera>
<a-box color="yellow" gps-entity-place="latitude: <lat>; longitude: <long>" scale="2 2 2" />