简体   繁体   English

在Arcore(sceneform)中不使用平面检测在指定点上渲染3d对象

[英]Rendering 3d object on specified point without using plane detection in Arcore(sceneform)

我正在开发一个增强现实应用程序,我必须在 ar 屏幕的指定点上放置一个 3d 对象(例如 - 手头放置一个对象)。 可以在不使用 Ar 场景形式的平面检测器的情况下做到这一点,因为我不想把它放在那个地方,而是在屏幕上的指定点。如果有人有答案,请给我一个来源

You can place an object at a point on the screen rather than on a plane - there are several approaches.您可以将对象放置在屏幕上的某个点而不是平面上 - 有几种方法。 One is to set an anchor relative to the camera position.一种是设置相对于相机位置的锚点。

See this answer: https://stackoverflow.com/a/53175458/334402 and full code is available here if you want to play with it: https://github.com/mickod/LineView请参阅此答案: https : //stackoverflow.com/a/53175458/334402如果您想使用它,可以在此处获得完整代码: https : //github.com/mickod/LineView

Note, that this will put it at that point in the 'world' absolutely - ie not relative to a person's hand.请注意,这将绝对地将其置于“世界”中的那个点 - 即与人的手无关。 So if the person moves their hand the renderable will remain in the place you put it, not move with their hand.因此,如果此人移动他们的手,可渲染对象将保留在您放置它的位置,而不是随他们的手移动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM