# Measuring distance between 2 points in a scene that contains a point cloud, when clicking the raycast selects all points

**URL:** <https://discourse.threejs.org/t/measuring-distance-between-2-points-in-a-scene-that-contains-a-point-cloud-when-clicking-the-raycast-selects-all-points/51078>\
**Category:** Questions\
**Tags:** raycaster\
**Created:** [May 2, 2023, 10:19am UTC](https://discourse.threejs.org/t/measuring-distance-between-2-points-in-a-scene-that-contains-a-point-cloud-when-clicking-the-raycast-selects-all-points/51078 "2023-05-02T10:19:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Z.a](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/z.a/32/35888_2.png) [@Z.a](https://discourse.threejs.org/u/Z.a)\
**Post date:** [May 2, 2023, 10:19am UTC](https://discourse.threejs.org/t/measuring-distance-between-2-points-in-a-scene-that-contains-a-point-cloud-when-clicking-the-raycast-selects-all-points/51078/1 "2023-05-02T10:19:21Z")

</div>

using this method in order to test and check the intersection that i get when clicking on a point in the point cloud , when loggin intersects in shows around 44k points which is inaccurate to get the coordinates of the position clicked. I tried using threshold it doesnt work cause zooming in and zooming out affect it.

```js
const rayCaster = new THREE.Raycaster();
    let x = (e.clientX / window.innerWidth) * 2 - 1;
    let y = -(e.clientY / window.innerHeight) * 2 + 1;

    const mouse = new THREE.Vector3(x, y);

    rayCaster.setFromCamera(mouse, this.camera);

    const intersects = rayCaster.intersectObjects(this.scene.children);
    console.log(intersects);

```
