<!DOCTYPE html>
<html>
  <head>
    <title>MultiSrc - 03 - Papercraft</title>
    <script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
    <script src="https://cdn.rawgit.com/elbobo/aframe-multisrc-component/b6d23310/dist/0.3/aframe-multisrc-component.js"></script>
    <script src="../js/livecode.js"></script>
  </head>
  <body>
    <a-scene background="color:lightblue" cursor="rayOrigin: mouse">
      <a-assets>
        <img
          id="head-right"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/head-right.png"
        />
        <img
          id="head-left"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/head-left.png"
        />
        <img
          id="head-top"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/head-top.png"
        />
        <img
          id="head-bottom"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/head-bottom.png"
        />
        <img
          id="head-front"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/head-front.png"
        />
        <img
          id="head-back"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/head-back.png"
        />

        <img
          id="body-right"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/body-right.png"
        />
        <img
          id="body-left"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/body-left.png"
        />
        <img
          id="body-top"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/body-bottom.png"
        />
        <img
          id="body-bottom"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/body-bottom.png"
        />
        <img
          id="body-front"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/body-front.png"
        />
        <img
          id="body-back"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/body-back.png"
        />

        <img
          id="r-arm-right"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/r-arm-right.png"
        />
        <img
          id="r-arm-left"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/r-arm-left.png"
        />
        <img
          id="r-arm-top"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/r-arm-top.png"
        />
        <img
          id="r-arm-bottom"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/r-arm-bottom.png"
        />
        <img
          id="r-arm-front"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/r-arm-front.png"
        />
        <img
          id="r-arm-back"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/r-arm-back.png"
        />

        <img
          id="l-arm-right"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/l-arm-right.png"
        />
        <img
          id="l-arm-left"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/l-arm-left.png"
        />
        <img
          id="l-arm-top"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/l-arm-top.png"
        />
        <img
          id="l-arm-bottom"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/l-arm-bottom.png"
        />
        <img
          id="l-arm-front"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/l-arm-front.png"
        />
        <img
          id="l-arm-back"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/l-arm-back.png"
        />

        <img
          id="legs-right"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/legs-right.png"
        />
        <img
          id="legs-left"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/legs-left.png"
        />
        <img
          id="legs-top"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/legs-top.png"
        />
        <img
          id="legs-bottom"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/legs-bottom.png"
        />
        <img
          id="legs-front"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/legs-front.png"
        />
        <img
          id="legs-back"
          src="https://raw.githubusercontent.com/jorgecardoso/aframe-course-resources/master/papercraft/character458/legs-back.png"
        />
      </a-assets>

      <a-entity id="toy" position="0 1.6 -2" scale="10 10 10">

        <!-- Head, Shoulders, Trunk -->
        <a-entity id="upper-body" rotation="0 0 0">

          <!-- Cabeça -->
          <a-box
            id="head"
            width="0.05"
            height="0.032"
            depth="0.05"
            position="0 0.064 0"
            rotation="0 0 0"
            multisrc="srcs:#head-right,#head-left,#head-top,#head-bottom,#head-front,#head-back"
          ></a-box>

          <!-- Right Shoulder -->
          <a-entity
            id="right-shoulder"
            position="-0.022 0.048 0"
            animation="property: rotation; from: 0 0 0; to: -50 0 0; dur: 1500; dir: alternate; loop: true"
          >
            <a-box
              id="right-arm"
              width="0.012"
              depth="0.012"
              height="0.024"
              rotation="0 -90 0"
              position="0 -0.012 0"
            ></a-box>
          </a-entity>

          <!-- Left Shoulder -->
          <a-entity id="left-shoulder" position="0.022 0.048 0">
            <a-box
              id="left-arm"
              width="0.012"
              depth="0.012"
              height="0.024"
              rotation="0 90 0"
              position="0 -0.012 0"
            ></a-box>
          </a-entity>

          <!-- Trunk -->
          <a-box
            id="trunk"
            width="0.032"
            depth="0.032"
            height="0.032"
            position="0 0.032 0"
          ></a-box>
        </a-entity>

        <!-- Pernas -->
        <a-box
          id="legs"
          width="0.024"
          depth="0.024"
          height="0.016"
          rotation="0 0 0"
          position="0 0.008 0"
        ></a-box>
      </a-entity>

      <a-camera>
        <a-cursor></a-cursor>
      </a-camera>
    </a-scene>
  </body>
</html>