英文:
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.
<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>
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论