G 中 3D 组件视角旋转后无法触发事件
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 230
- PR merge metrics
- No merged PRs in 30d
Description
https://antv-issue-helper.surge.sh 中无法选择 g 中版本
系统:Win 11
浏览器:Chrome 128.0.6613.138
问题补充:
拖动 canvas 旋转视角之后,点的位置显示正确,但是失去了 cursor 效果,也不能触发 click event,是否是内置坐标转换/渲染问题?
复现步骤:
```
let base_pos = [300, 50, 0];
let tmp_plane = new Mesh({
style: planeStyle
});
tmp_plane.setPosition(base_pos[0], base_pos[1], base_pos[2]);
canvas.appendChild(tmp_plane);
const sphereGeometry = new SphereGeometry(device, {
radius: 8,
widthSegments: 16,
heightSegments: 16,
});
const point = new Mesh({
style: {
geometry: geometry,
material: pointMaterial,
cursor: "pointer"
},
});
point.setPosition(
tmp_plane.getPosition()[0] + 50,
tmp_plane.getPosition()[2],
tmp_plane.getPosition()[1] + 50
);
point.addEventListener(
"click",
(e) => {
console.log('click successfully')
},
false
)
tmp_plane.appendChild(point);
const camera = canvas.getCamera();
camera.setPosition(300, 250, 500)
.setFocalPoint(300, 250, 0)
.setPerspective(5, 1000, 75, 600 / 500)
.setDistance(600)
.setRoll(90);
canvas.render();
```
Contributor guide
Research direction
Start with the supplied reproduction using the antv-issue-helper demo, Mesh, canvas, and camera APIs in the stated Chrome environment. Compare cursor and click behavior before and after dragging to rotate the view, then investigate the camera-coordinate conversion and hit-testing path. Done means the rotated 3D component retains its cursor effect and click event.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100