简体   繁体   English

如何在Aframe中将文字附加到相机?

[英]How to attach text to camera in Aframe?

I want to render a text overlay on the camera that moves with the camera in my aframe scene. 我想在相机上渲染文本叠加层,使其与我的脱机场景中的相机一起移动。

My camera entity looks like this: 我的相机实体看起来像这样:

<a-entity position="33 0 -33" rotation="0 180 0" 
  look-controls id="camera" camera="userHeight: 1.6" listener>
</a-entity>

and my text entity looks like this: 我的文字实体看起来像这样:

<a-entity text="value: HELLO; color: red; width: 2;" position="0 0 0">
</a-entity>

But when I put the text entity inside the camera entity, the text is not visible: 但是,当我将文本实体放入相机实体中时,该文本不可见:

<a-entity position="33 0 -33" rotation="0 180 0" look-controls 
  id="camera" camera="userHeight: 1.6" listener>
  <a-entity text="value: HELLO; color: red; width: 2;" position="0 0 0" >
  </a-entity>
</a-entity>

How do I have to place the text element to make it a visible overlay to the camera view? 我如何放置文本元素以使其在相机视图中可见可见?

将其稍微远离相机放置。

position="0 0 -1"

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

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