a-frame vr how to drag and drop assets / elements insight a picture?

醉酒当歌 提交于 2019-12-05 21:38:41

This isn't built into Aframe, but you can use a 3rd party component to get the desired results.

aframe-click-drag-component allows for clicking and dragging entities around on the screen:

Entities with the click-drag component can be click and dragged around the 3D scene. Even works while the camera is moving or rotating!

<head>
  <script src="https://aframe.io/releases/0.3.0/aframe.min.js"></script>
  <script src="https://unpkg.com/aframe-click-drag-component"></script>
  <script>
    registerAframeClickDragComponent(window.AFRAME);
  </script>
</head>

<body>
  <a-scene>
    <a-sphere click-drag position="0 1.25 -5" radius="1.25" color="#EF2D5E"></a-sphere>
    <a-camera look-controls-enabled="false"></a-camera>
  </a-scene>
</body>

Check out the demo.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!