mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
101.97k stars 35.33k forks source link

In version # 162, when CSS3DRenderer mounts a click event in the DOM and rotates it to a certain angle, the event cannot respond #27920

Closed stevengogo closed 6 months ago

stevengogo commented 6 months ago

Description

This issue is not a problem in the old version. I compared the code of CSS3DRenderer.js and found that there is an additional deep perspective detection. Does this parameter cause any issues

Reproduction steps

1. 2. 3.

Code

// #162
    const scaleByViewOffset = camera.view && camera.view.enabled ? camera.view.height / camera.view.fullHeight : 1;
        const cameraCSSMatrix = camera.isOrthographicCamera ?
            `scale( ${ scaleByViewOffset } )` + 'scale(' + fov + ')' + 'translate(' + epsilon( tx ) + 'px,' + epsilon( ty ) + 'px)' + getCameraCSSMatrix( camera.matrixWorldInverse ) :
            `scale( ${ scaleByViewOffset } )` + 'translateZ(' + fov + 'px)' + getCameraCSSMatrix( camera.matrixWorldInverse );
        const perspective = camera.isPerspectiveCamera ? 'perspective(' + fov + 'px) ' : '';

        const style = perspective + cameraCSSMatrix +
            'translate(' + _widthHalf + 'px,' + _heightHalf + 'px)';

Live example

Screenshots

No response

Version

162

Device

Desktop

Browser

Chrome

OS

Windows

Mugen87 commented 6 months ago

This issue is not a problem in the old version.

On what version are you referring to?

You also have to describe in more detail what actually goes wrong. That is not clear from the title. I think it's best if you demonstrate the problem with a live example.

These information are required to investigate the issue. Until you have provided more information, the issue is closed.

yomotsu commented 6 months ago

This issue might be related to https://github.com/mrdoob/three.js/issues/26583, which has already been resolved tho.