Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lolilukia opened this issue Sep 20, 2024 · 0 comments
Open

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

lolilukia opened this issue Sep 20, 2024 · 0 comments

Comments

@lolilukia
Copy link

lolilukia commented Sep 20, 2024

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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant