gabor aron
gabor aron

Reputation: 410

A-frame box/camera position

I can do anything but my box is always under the camera at the begining. What is wrong? I want to create a street, and I want to put one box on the left and one on the right to be houses.

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

Upvotes: 1

Views: 532

Answers (1)

Nat
Nat

Reputation: 357

You're changing the Y values of their positions which will move them up and down. You probably need to change the Z or X variables instead.

For example, on the "Right House," instead of: position="0 -50 0" you probably want position="0 0 -50" or position="-50 0 0"

Also your Right House closing tag is </a-ocean> instead of </a-box>

And you need to close the <a-box> tags on the Left House and Floor with <a-box>

Upvotes: 1

Related Questions