射线检测的代码不对,容器 element 的高度位置随意调整,在射线检测时: // 通过鼠标位置,计算出 raycaster 所需点的位置 const getBoundingClientRect = container.getBoundingClientRect(); mouse.x = ((event.clientX - getBoundingClientRect.left) / getBoundingClientRect.width) * 2 - 1; mouse.y = -((event.clientY - getBoundingClientRect.top) / getBoundingClientRect.height) * 2 + 1; //通过鼠标点击的位置(二维坐标)和当前相机的矩阵计算出射线位置 raycaster.setFromCamera(mouse, camera);