AR.js文档中位置相关示例的问题

huangapple go评论98阅读模式
英文:

Issues with AR.js Location-Based Example from Documentation

问题

我正在尝试使用AR.js库实现基于位置的增强现实功能。我一直在参考官方的AR.js文档(https://ar-js-org.github.io/AR.js-Docs/),特别是位置相关的部分。

我已经将提供的代码复制到我的HTML文件中,并通过替换"add-your-latitude"和"add-your-longitude"占位符为我的实际纬度和经度数值进行了必要的更改。然而,AR对象没有出现在指定的GPS坐标位置。我还尝试添加多个靠近我的位置的标记,但仍然没有成功。

我已经检查了浏览器控制台以查找任何错误消息,但没有相关的错误或警告。我还确保我的浏览器已经授予了网页位置权限(我在iOS上进行了测试 - 使用safari和Chrome都尝试了)。

是否有人已经成功实现了AR.js基于位置的功能吗?我可能遗漏了特定的步骤或考虑因素吗?是否有关于使用AR.js实现基于位置的AR的工作示例或其他资源可用?

我会感激任何指导或见解,以帮助解决这个问题。提前感谢您的帮助。

英文:

I am trying to implement the location-based augmented reality functionality using AR.js library. I have been referring to the official AR.js documentation (https://ar-js-org.github.io/AR.js-Docs/) and specifically the location-based section.

I have copied the provided code into my HTML file and made the necessary changes by replacing the add-your-latitude and add-your-longitude placeholders with my actual latitude and longitude values. However, the AR object is not appearing at the specified GPS coordinates. I have also tried adding multiple markers with close positions to my location, but still no success.

I have checked the browser console for any error messages, but there are no relevant errors or warnings. I have also ensured that my browser has location permission granted to the web page (I tested on iOS - safari and Chrome both).

Is there anyone who has successfully implemented the AR.js location-based functionality? Could there be any specific steps or considerations that I might be missing? Is there a working example or additional resources available for implementing location-based AR using AR.js?

I would appreciate any guidance or insights to help resolve this issue. Thank you in advance for your assistance.

答案1

得分: 0

示例代码有效!您可以尝试为您的资产添加位置,包括多个资产及其位置。位置是相对于海平面的高度。
您可以尝试以下代码。

<a-box material="color: blue" gps-entity-place="latitude: <纬度>; longitude: <经度>" position="0 165 0" scale="3.5 3.5 3.5" rotation="0 180 0"></a-box>

在上面的示例中,位置标签将对象在该GPS位置上的高度设为165米。

英文:

Sample code works! You can try to add a position to your assets, including multiple assets and their position. The position is elevation from sea level.
You can try the following code.

&lt;a-box material=&quot;color: blue&quot; gps-entity-place=&quot;latitude: &lt;&gt;; longitude: &lt;&gt;&quot; position=&quot;0 165 0&quot; scale=&quot;3.5 3.5 3.5&quot; rotation=&quot;0 180 0&quot;&gt; &lt;/a-box&gt;

In the above example position tag gives 165m as elevation to the object on that GPS location.

答案2

得分: 0

请检查 https://github.com/AR-js-org/AR.js/issues/558 并查看是否有帮助

我遇到了一些问题,问题是Chrome没有访问“精确位置”的权限

希望StackBot现在喜欢这个答案,因为我找到了我的问题

英文:

please check https://github.com/AR-js-org/AR.js/issues/558 and see if it helps

I had some problems with this and the issue was that Chrome did not had access to "precise location"

hope stackBot likes this answer now that i found my problem

huangapple
  • 本文由 发表于 2023年6月5日 18:56:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/76405749.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定