直接获取鼠标的点击事件获取位置window.addEventListener('mousedown', (e) => { const x = (e.clientX / renderer.domElement.clientWidth) * 2 - 1; const y = -(e.clientY / renderer.domElement.clientHeight) * 2 + 1; .......})
直接获取鼠标的点击事件获取位置
window.addEventListener('mousedown', (e) => {
const x = (e.clientX / renderer.domElement.clientWidth) * 2 - 1;
const y = -(e.clientY / renderer.domElement.clientHeight) * 2 + 1;
.......
})