code: function (x) {
          if (x.length === 2) {
              return new THREE.Vector2(x[0], x[1]);
          } else if (x.length === 3) {
              return new THREE.Vector3(x[0], x[1], x[2]);
          }
      }
docs: A function converting arrays to THREE.js vectors