标签:拖动 ext cti argc java dev transform tran col
首先,引入js文件:
<script type="text/javascript" src="./path/to/DragControls.js"></script> <script type="text/javascript" src="./path/to/TransformControls.js"></script>
然后:
//实例化 TransformControls var transformControls = new THREE.TransformControls(camera,renderer.domElement); scene.add(transformControls); //实例化 dargControls var dragControls = new THREE.DragControls(scene.children, camera, renderer.domElement); dragControls.addEventListener(‘hoveron‘, function( event ){ transformControls.attach(event.object); transformControls.setSize(0.4); });
即可。
three.js 使用DragControls.js 拖动元素
标签:拖动 ext cti argc java dev transform tran col
原文地址:https://www.cnblogs.com/Skate0rDie/p/10281491.html