即时放置对象
平台专用指南
借助 Instant Placement API,用户无需先移动设备以允许 ARCore 建立完整跟踪并检测表面几何图形,即可立即放置 AR 对象。
用户放置物体后,系统会随着用户在环境中移动而实时优化物体的姿势。当 ARCore 能够在放置 AR 对象的区域确定正确的姿势后,便会更新对象的姿势和跟踪方法。
在以下示例中,系统最初使用估计的姿势放置物体,该姿势由灰度颜色表示。确定准确的姿势后,对象会变为彩色,表示它使用的是准确的姿势。姿势的突然变化也会影响物体的外观“尺寸”或感知尺度。

在图 1 中,即时展示位置已停用,并且 Surface 几何图形未定义。放置在桌球桌右侧地板上的物体(四个蓝色小圆点)看起来像是被推倒了,其姿势未定义。
在图 2 中,通过齿轮图标下的菜单启用了即时展示位置。
在图 3 中,启用“即时放置”后,系统会在场景中放置一个新对象。它以灰度(而非彩色)显示,表示尚未校正为准确的姿势。
在图 4 中,当检测到表面几何图形(由可跟踪网格线描述)时,新对象会变为彩色,并且其姿势准确无误。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-02-28。
[null,null,["最后更新时间 (UTC):2025-02-28。"],[[["This page provides developer guides for instant placement in AR experiences using various platforms like Android, Unity, and Unreal Engine."],["Instant Placement allows users to place AR objects immediately without waiting for full tracking, enhancing the user experience."],["Initially placed objects have an estimated pose, which is later refined for accuracy as ARCore gathers more environmental data."],["Visual cues, such as grayscale, indicate when an object's pose is estimated and transitions to color when the pose becomes accurate."],["The provided figures illustrate the difference between instant placement enabled and disabled, showcasing the pose refinement process."]]],[]]