Sprite: Raycasting with offscreen sprites fails
See original GitHub issueDescription 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, …)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:20 (3 by maintainers)
Top Results From Across the Web
Problematic Raycasting of Offscreen THREE.Sprite object
Upon further research it seems like the raycaster responsible for emitting mouse events falsely detects intersections with offscreen THREE.Sprite objects.
Read more >Implementing a Ray Caster Part 2: Sprite Rendering
We use sprites to render objects in worlds. Things like trees, pots, tables, and so on cannot be done well without sprites.
Read more >Issue Raycasting Against Sprites - aframevr/aframe - GitHub
Raycasting against sprites fails with: THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.
Read more >Making sprites smoothly exit the screen - A RokCoder Scratch ...
Scratch does not allow a sprite to move entirely off the edge of a screen in a smooth manner. This video shows a...
Read more >A Look At The Nintendo's Off-Screen Sprite Rendering Glitches
With nowhere to place sprites off the screen, it presented a challenge to move them into view when scrolling. To get around this,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@06wj Do you want to propose a PR, since you have been working on this issue?
Closing. Should be fixed in #16423.