Hi, first of all thanks to authors and the community for this wonderfull framework. It looks very promising for our project. I want to learn more and utilize fully in my project too.
Right now I am using threejs to visualize Point Clouds. I want to be able to pick individual points from the cloud. I used raycaster to get intersects of my points object.
in mouse move event:
mouse.x = ( ( event.clientX - renderer.domElement.offsetLeft ) / window.innerWidth ) * 2 - 1;
mouse.y = - ( ( event.clientY - renderer.domElement.offsetTop ) / window.innerHeight ) * 2 + 1;
in animate fnc:
raycaster.setFromCamera( mouse, this.camera );
intersects = raycaster.intersectObject( particles );
then I change attributes of the particles which is a Points object. Then render. I can get the selected point to change color. I get the mouse position by mousemove event. So ray casting has to run every time I move mouse over the document. With 100 000 points it is quite slow. Also when there are many points close by it outputs quite off from what mouse points to.
Why is the a mistake in selecting correct point by raycaster? Do I need to do some setting?
Also is there a faster way to get points which my mouse points to? Is this raycasting done on CPU? Can we utilize GPU to make it faster?
Thanks in advance