简体   繁体   English

如何将图像附加到氩气中的参考系,以便它随相机移动到用户将手机移动到的任何位置

[英]How do I attach an image to the reference frame in argon so that it moves with the camera wherever the user moves the phone to

How do I attach an image to the reference frame in argon so that it moves with the camera based wherever the user points the phone?如何将图像附加到氩气中的参考系,以便它根据用户将手机指向的任何位置与相机一起移动? Basically, I want it to be like a HUD, and in my case, it will just be a still image that I've designed in photoshop that I want to work like a map key.基本上,我希望它像 HUD 一样,在我的情况下,它只是我在 photoshop 中设计的静止图像,我想像地图键一样工作。

I've tried the following based on some A-Frame documentation, but it doesn't seem to be working.我已经根据一些 A-Frame 文档尝试了以下操作,但它似乎不起作用。 It doesn't seem to alter the application at all.它似乎根本没有改变应用程序。 I put this within my ar-scene.我把它放在我的 ar-scene 中。

<ar-camera>
      <a-entity>

        <a-image src="#imgKey" width="4" height="2" scale="1 1 1" position="0 0 0">
        </a-image>

      </a-entity>
</ar-camera>

Any ideas?有任何想法吗?

Here is the code that worked.这是有效的代码。 Simply put this within the ar-scene.简单地把它放在 ar-scene 中。 It was a positioning issue:这是一个定位问题:

 <a-entity position="0 0 5">

      <ar-camera>

          <a-image src="#imgKey" width="4" height="2" scale="1 1 1" position="0 0 -5"></a-image>

      </ar-camera>

  </a-entity>

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

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