我的代码是:
// HEIGHT = height of the canvas area
function OnMouseMove(event) {
xx = event.clientX ;
yy = event.clientY ;
removeCuboid(); //each time I remove the cuboid
addCuboid(xx ,HEIGHT - yy,breadth);
/* addCuboid creates a three.js cuboid:
new THREE.Mesh(new THREE.CubeGeometry(len,height,breadth) *.
}
这仅在某种程度上起作用。即使我将鼠标拖到画布区域的最角落,长方体的高度和长度也不会增加。