        return new THREE.Mesh(geometry, material);
      }
    }

    let pointer = undefined;

    function onSelectStart(event) {
      pointer = event.target;
    }
    function onSelectEnd(event) {
      pointer = undefined;
    }

    function draw() {
      if (pointer === undefined) {
        return;
      }

      const raycaster = new THREE.Raycaster();
      tempMatrix.identity().extractRotation(pointer.matrixWorld);

      raycaster.ray.origin.setFromMatrixPosition(pointer.matrixWorld);
      ray