Three.js: Raycaster no longer works with Sprites using CanvasRenderer

Created on 6 Sep 2018  路  6Comments  路  Source: mrdoob/three.js

three.js version more than 0.93, Raycaster Method no use to Sprite.

Bug

Most helpful comment

My fault, I will make a PR to fix it.

All 6 comments

Please add some more details to your report. It would be great if you can demonstrate the issue in a live example, too.

Thank for your feedback very much. I had test the three api versions (0.94, 0.95,0.96), Raycaster is not work on Sprite.
In this example , the web address is 'https://threejs.org/examples/?q=int#canvas_interactive_particles', the bug can show. Thank for you help very much. Wait for your feed back!

Raycaster no longer works with Sprites using CanvasRenderer and WebGLRenderer.

I don't think that's true. This example uses WebGLRenderer and works:
https://threejs.org/examples/webgl_raycast_sprite.html

Um, I guess this bug was introduced via #14292

At least on problem is that SpriteCanvasMaterial does not have a rotation property. So cos and sin become NaN values in the following code section:

https://github.com/mrdoob/three.js/blob/d1ba0bcc88a3f81e191eb3b6d5ed9f1c1ea7fb57/src/objects/Sprite.js#L107-L114

/cc @06wj

My fault, I will make a PR to fix it.

Was this page helpful?
0 / 5 - 0 ratings