我正在尝试使用 aframe-ar.js 和 aframe.js 的网络增强现实。我想让我放置的图像可拖动<a-scene>
。我使用<a-assets>
标签首先注册图像,然后<a-image>
在网络摄像头中识别标记时用于显示图像。图像已成功显示,但即使尝试了许多选项,我也无法使其可拖动。我的代码在这里:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Augmented Reality For Web</title>
<script src="three.js"></script>
<script src="aframe.min.js"></script>
<script src="aframe-ar.js"></script>
<script src="aframe-click-drag-component.min.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://unpkg.com/aframe-click-drag-component"></script>
</head>
<body>
<a-scene embedded arjs='sourceType: webcam;'>
<a-assets>
<img id="my-image" src="Samplee.jpg"><img>
</a-assets>
<a-image id="img_disp" src="#my-image" rotation="90 180 0"
visible="true">
</a-image>
<a-marker-camera preset='hiro'></a-marker-camera>
</a-scene>
</body>
</html>