javascript - 如何在 Aframe 中将文本附加到相机?

标签 javascript aframe webvr

我想在相机上渲染一个文本叠加层,并在我的 aframe 场景中随相机移动。

我的相机实体如下所示:

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

我的文本实体如下所示:

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

但是当我将文本实体放入相机实体内时,文本不可见:

<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>

如何放置文本元素以使其成为相机 View 的可见叠加层?

最佳答案

将其放置在远离相机的位置。

位置=“0 0 -1”

关于javascript - 如何在 Aframe 中将文本附加到相机?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47102780/

相关文章:

aframe - a-frame vr如何拖放 Assets /元素洞察图片?

webgl - 使用Oculus Rift显示Web应用程序输出

javascript - Fancybox 不工作(初学者)

javascript - 时间到期后重启 FlipClock

javascript - 无法在 InDesign CC 脚本中调用菜单项

javascript - setInterval 道场示例

javascript - Aframe 回调未调用

javascript - 如何为以下堆叠的弯曲图像添加空间/边距?

javascript - ReactVR 中的事件处理

javascript - A-frame 添加启用/禁用功能组件