A框架盒/摄像机位置

时间:2016-11-14 11:04:40

标签: aframe

我可以做任何事情,但我的盒子一开始就在镜头下。怎么了?我想创建一条街道,我想在左边放一个盒子,在右边放一个盒子作为房子。

<html>
  <head>
    <meta charset="utf-8">
    <title>something</title>
    <meta name="description" content="something">
    <meta name="apple-mobile-web-app-capable" content="yes">
      </head>
  <body>
          <a-assets>
            <img id="texture_0" src="textures/floor.jpg">
            <img id="texture_1" src="textures/house1.jpg">
            <img id="sky" src="background/sky.jpg">
          </a-assets>
          <!--  LEFT HOUSE -->
          <a-box color="#FFF" width="2" height="2" depth="2" position="0 0 0" rotation="0 0 45" scale="2 0.5 3" src="#texture_1">

          <!--  FLOOR -->
          <a-box material="src: #texture_0; repeat: 50 30" width="200" depth="200" density="40" transparent="true" opacity="0.75" position="0 -6 0">

          <!--  SKY -->
          <a-sky src="#sky"></a-sky>


          <!--  RIGHT HOUSE -->
          <!-- <a-box material="src: #texture_2; repeat: 50 30" width="200" depth="200" density="40" transparent="true" opacity="0.75" position="0 -50 0"></a-ocean> -->

          <a-camera position="100 1.8 100"> 
           <a-cursor color="#2E3A87"></a-cursor> 
          </a-camera>
        </a-scene>
  </body>
</html>

1 个答案:

答案 0 :(得分:1)

您正在更改其位置的Y值,这会使它们上下移动。您可能需要更改Z或X变量。

例如,在&#34; Right House,&#34;代替:position="0 -50 0"您可能需要position="0 0 -50"position="-50 0 0"

您的右房结束标记也是</a-ocean>而不是</a-box>

您需要使用<a-box>

关闭左房子和楼层的<a-box>标签