如何在A-Frame中设置实体两侧的两个不同图像

时间:2017-01-08 01:12:45

标签: aframe webvr

我希望有一个180度旋转的图像,并在两侧显示图像。

你可以设置正面和背面,所以我想知道是否有办法在两侧设置图像。

  <a-entity material="src:template.png; side: front" mixin="slide" class="intersectable" position="2 1 -3">
    <a-animation begin="click" attribute="rotation" dur="2000" from="0 0 0" to="0 180 0" fill="forwards"></a-animation>
  </a-entity>

1 个答案:

答案 0 :(得分:3)

您可以创建两个平面并将它们背靠背放置。类似的东西:

object[0]

或者做一些像平面纹理组件的双面材质。这是来自How can I put two different textures on the front and back of a plane?的原始three.js代码:

<a-entity>
    <a-entity geometry material="side: back"></a-entity>
    a-entity geometry material="side: front"></a-entity>
    <a-animation></a-animation>
  </a-entity>