// 监听鼠标点击事件document.addEventListener('click', function (event) {// 创建一个射线投射器var raycaster = new THREE.Raycaster();// 鼠标位置var mouse = new THREE.Vector2();//event.preventDefault();// 将鼠标位置转换为有意义的数据mouse.x = (event.clientX / renderer.domElement.clientWidth) * 2 - 1;mouse.y = - (event.clientY / renderer.domElement.clientHeight) * 2 + 1;// 使用鼠标位置更新射线投射器raycaster.setFromCamera(mouse, camera);// 计算物体和射线的交点var intersects = raycaster.intersectObjects(scene.children, true);// 如果存在交点debuggerif (intersects.length > 0) {// 获取第一个交点的3D坐标var point = intersects[0].point;console.log('3D Coordinates of the clicked point:', point.x, point.y, point.z);}}, false);