环境
物理环境
为众多不同的空间设计相同的体验
让用户清楚地了解您的应用需要多少空间。您能将它用在自己的大腿、餐桌或足球场上吗?向他们展示理想的使用条件。您可以在 Play 商店中添加预览图片,或在应用本身中添加说明。
考虑应用可能会使用的所有地方仍然很有帮助,从小公寓到大片田野,不一而足。准备好应对大大小小的空间、家具或交通等现实障碍,以及身体挑战。
公共空间也提供一系列自己的 AR 挑战。跟踪和遮挡变得困难,具体取决于周围物体和人员的数量。此外,手机移动和 AR 沉浸感可能会分散注意力或危险。
虚拟环境
增强环境结合了通过设备相机拍摄的真实图像与虚拟内容(例如数字对象或信息)。
当您的手机在现实世界中移动时,ARCore 会跟踪手机相对于周围环境的位置。此过程称为并发测距与映射 (COM)。
ARCore 会查看摄像头图像并检测视觉上的显著特征(称为特征点)。然后,它会利用这些点来确定自己在位置上的变化。这些视觉信息会与设备的惯性测量数据结合,从而估测随时间推移相机相对于周围环境的姿态(位置和方向)。
通过将呈现 3D 内容的虚拟摄像头的位置与设备摄像头的方向对齐,ARCore 可以从正确的视角渲染虚拟内容。这种虚拟图像叠加在实时拍摄的图像上,使虚拟内容看起来如实呈现。
持续发现
ARCore 一直在不断提高它对现实世界环境的理解。
它会构建您的空间模型,随着手机四处移动,相机捕捉空间的新部分以及关于该空间的新细节,从而为所填信息添加内容。ARCore 会识别并聚类看起来位于常见水平和倾斜表面上的特征点,并将这些表面作为平面提供给您的应用。

环境限制
目前,以下限制可能会妨碍对 Surface 的准确理解:
- 没有纹理的平坦表面,例如白色桌子
- 光线昏暗的环境
- 极其明亮的环境
- 透明或反光表面,如玻璃
- 动态或动态表面,如草叶或水中的涟漪
在用户遇到环境限制时,请说明问题所在,并引导用户正确采取行动。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-01。
[null,null,["最后更新时间 (UTC):2023-12-01。"],[[["AR app experiences should be designed to adapt to various physical spaces, from small rooms to large, open areas, and consider real-world obstacles and challenges."],["AR technology uses the device's camera to combine real-world images with virtual content, tracking the phone's position and rendering virtual objects in the correct perspective."],["ARCore continuously learns and maps the environment, recognizing surfaces and updating its understanding as the device moves; however, certain environmental conditions can limit its accuracy."],["When environmental limitations affect the AR experience, provide users with clear feedback and guidance."],["Developers need to consider the ideal conditions for using their AR apps and provide users with clear instructions or preview graphics to set expectations."]]],["Developers should design AR apps adaptable to various physical spaces, from small rooms to large areas, accounting for obstacles and potential public space challenges like tracking issues and user safety. ARCore tracks a device's position using feature points, creating a model of the space, and identifying surfaces (planes). It renders virtual content from the correct perspective, combining the real and virtual world. However, limitations such as featureless, dim, reflective, or dynamic surfaces can affect tracking accuracy and the model's quality.\n"]]