1. 首页
  2. three.js

three.js为什么?我的原物位置继续改变?

three.jsn嗨!!!n使用拖动,我尝试重新定位对象之间的冲突。(交换)n在“dragstart”中,“originObject”参数只初始化了一次,n但在“drag”中它一直在更改n为什么原物位置正在改变吗???nthree.dragcontrols.addEventListener( \”dragstart\”, function = = 0;console.log(\”originObject.position at drag\”, originObject.position)});three.dragcontrols.addEventListener( \”dragend\”, function () === undefined)return;console.log(\”originObject.position\”, originObject.position)console.log(\”swapObject.position\”,>nand this is my log…norigindragObject.position at drastart and origindragObject.position at dragimage553×633 11.7 KB Solved by C.Arts in post #2 Means dragObject, originObject and event.object are the same object. it\”s not assigning the values, it\”s assigning the object.>nMeans dragObject 、originObject和event.object是同一个对象。它不是分配值,而是分配对象。n非常感谢。n这对我很有帮助!n Why? my originObject.position keep chaning?n

three.js为什么?我的原物位置继续改变? 为WP2原创文章,链接:https://www.wp2.cn/three-js/three-js%e4%b8%ba%e4%bb%80%e4%b9%88%ef%bc%9f%e6%88%91%e7%9a%84%e5%8e%9f%e7%89%a9%e4%bd%8d%e7%bd%ae%e7%bb%a7%e7%bb%ad%e6%94%b9%e5%8f%98%ef%bc%9f/