在A框架中拖放对象

时间:2018-10-19 08:49:00

标签: javascript jquery virtual aframe

我想在A形框架中拖放对象。我用

<script src="https://unpkg.com/aframe-click-drag-component"></script>

我还看到此问题已在this post中得到了解答。但是,对于我而言,它不起作用。

下面是<a-scene>标签之间的示例代码:

    <a-entity click-drag position="-2 -1 -1">
        <a-obj-model  checked="off" visible="false" id="deer1" src="#deer11" mtl="#deer11-material" scale="0.1 0.1 0.1" rotation=" 0 -40 0">
            <a-animation attribute="scale" begin="mouseenter" to="0.2 0.2 0.2"></a-animation>
            <a-animation attribute="scale" begin="mouseleave" to="0.1 0.1 0.1"></a-animation>
            <a-animation attribute="rotation" begin="click" to=" 0 360 0" dur="1000" direction="alternate-reverse"></a-animation>
        </a-obj-model>
    </a-entity>

在我声明的<head>标签之间:

<script src="https://aframe.io/releases/0.4.0/aframe.min.js"></script>
<script>
    // TypeScript 2.2 requires 'exports' global variable.
    var exports = {};
</script>
<script src="/js/drap_drop.js"></script> 
<script>
    window.aframeDraggableComponent(window.AFRAME)
</script> 
<script src="/js/aframe-mouse-cursor-component.min.js" type="text/javascript"></script>

然后,在控制台中,出现一些错误,如下图所示:

error image in console

有人有解决此问题的想法吗?预先感谢。

0 个答案:

没有答案