three.js: Sprite: Raycasting with offscreen sprites fails
Description of the problem
A user in the forum reported a bug in Sprite.raycast()
.
https://discourse.threejs.org/t/problematic-raycasting-of-offscreen-three-sprite-object/3644
The method depends on Object3D.modelViewMatrix
. But this matrix is only updated if the sprite is actually rendered. If not, modelViewMatrix
does not regard the actual object’s transformation. This means that Sprite.raycast()
detects intersections of sprites outside the view frustum.
Three.js version
- Dev
- r95
- …
Browser
- All of them
- Chrome
- Firefox
- Internet Explorer
OS
- All of them
- Windows
- macOS
- Linux
- Android
- iOS
Hardware Requirements (graphics card, VR Device, …)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 20 (3 by maintainers)
@06wj Do you want to propose a PR, since you have been working on this issue?