Cannot get the object of the click

Hello everyone.

I had a problem when I clicked the mouse to get the sunflower ID. No matter where I click, the console prints the sunflower ID for the first click. Click on the F12 to open the console.
Online example:

Thanks advance :slight_smile:

Any help will be greatly appreciatd :).

Unfortunately, you have run into the following bug:

A workaround is to disable view frustum culling for sprites like so: sprite.frustumCulled = false;


How do I know if the Sprite is outside the frustum?

You can create an instance of THREE.Frustum and then use THREE.Frustum.intersectsSprite() to perform the intersection test. The frustum is computed per frame like so:

const projScreenMatrix = new THREE.Matrix4();
projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
frustum.setFromMatrix( projScreenMatrix );
1 Like