如何在一帧中的对象上找到光线投射器交点的坐标?
How to find the coordinates of a raycaster intersection point on an object in a-frame?
我有一个实体,其几何设置为平面基元。我如何知道我使用 raycaster/cursor 组件点击(在实体上)的点的坐标?
最好知道在交点处定义几何体顶点的系统中的坐标。
检查路口数据的点击事件详情。
el.addEventListener('click', function (evt) {
console.log(evt.detail.intersection);
});
此对象将包含 (https://threejs.org/docs/#api/en/core/Raycaster):
[ { distance, point, face, faceIndex, indices, object }, ... ]
因此您可以使用 point
查看您点击的位置。
我有一个实体,其几何设置为平面基元。我如何知道我使用 raycaster/cursor 组件点击(在实体上)的点的坐标?
最好知道在交点处定义几何体顶点的系统中的坐标。
检查路口数据的点击事件详情。
el.addEventListener('click', function (evt) {
console.log(evt.detail.intersection);
});
此对象将包含 (https://threejs.org/docs/#api/en/core/Raycaster):
[ { distance, point, face, faceIndex, indices, object }, ... ]
因此您可以使用 point
查看您点击的位置。