Android:需要在周围环境的AR中放置3D对象,而无需进行表面检测

时间:2018-11-23 12:06:39

标签: java android augmented-reality arcore

我觉得ArCore的文档和教程还不够,我需要知道如何在空中无需表面检测即可放置锚点。 AR核心上可用的大多数源代码似乎都涉及在表面检测后放置对象。 我需要知道如何获取Session对象,并在应用程序打开后立即将锚放置在空中。我目前在ARCore上使用Sceneform

我是唯一感到ARCore可用文档不够的人吗?

1 个答案:

答案 0 :(得分:0)

看看这个Github问题:Can i place a anchor of the object in air instead of plane in ar-core android?

这个来自Github发行版的示例在1m远的相机前面放置了一个锚点:

mAnchors.add(session.createAnchor(
frame.getCamera().getDisplayOrientedPose()
    .compose(Pose.makeTranslation(0, 0, -1f))
    .extractTranslation()))

create Anchor documentation中,您只需要一个姿势即可创建锚点。