antvis / G

💥 A flexible rendering engine for visualization.
https://g.antv.antgroup.com/
1.06k stars 198 forks source link

G 中 3D 组件视角旋转后无法触发事件 #1777

Open lolilukia opened 2 hours ago

lolilukia commented 2 hours ago

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();