# Robust way to determine if a 3D Model space point is within the view frustum

**URL:** https://forum.techsoft3d.com/t/robust-way-to-determine-if-a-3d-model-space-point-is-within-the-view-frustum/4117
**Category:** HOOPS Visualize Web
**Created:** [October 16, 2024, 10:18am UTC](https://forum.techsoft3d.com/t/robust-way-to-determine-if-a-3d-model-space-point-is-within-the-view-frustum/4117 "2024-10-16T10:18:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![simscapemultibody](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@simscapemultibody](https://forum.techsoft3d.com/u/simscapemultibody)
#### Post date: [October 16, 2024, 10:18am UTC](https://forum.techsoft3d.com/t/robust-way-to-determine-if-a-3d-model-space-point-is-within-the-view-frustum/4117/1 "2024-10-16T10:18:54Z")

</div>

What is a robust way to determine if a point is within the view frustum of the current camera. The point may be obscured by other objects in front of it. I just want to know if it is within the visible volume.

I tried using projectPoint and used the projected 2D point to determine the above. However, this method does not clip or exclude points that are closer than the near limit.

---

<div class="post-metadata">

### Author: ![tino](https://avatars.discourse-cdn.com/v4/letter/t/9dc877/32.png) [@tino](https://forum.techsoft3d.com/u/tino)
#### Post date: [October 16, 2024, 12:33pm UTC](https://forum.techsoft3d.com/t/robust-way-to-determine-if-a-3d-model-space-point-is-within-the-view-frustum/4117/2 "2024-10-16T12:33:48Z")

</div>

Hello,

Not sure if this is exactly what you need for your particular workflow but there are two functions in the [View](https://docs.techsoft3d.com/communicator/latest/api_ref/viewing/classes/View.html#view) class that can be used to test for visibility:

- [testPointVisibility](https://docs.techsoft3d.com/communicator/latest/api_ref/viewing/classes/View.html#View.testPointVisibility)
- [setPointVisibilityTest](https://docs.techsoft3d.com/communicator/latest/api_ref/viewing/classes/View.html#View.setPointVisibilityTest)

Thanks,  
Tino

---

<div class="post-metadata">

### Author: ![simscapemultibody](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@simscapemultibody](https://forum.techsoft3d.com/u/simscapemultibody)
#### Post date: [October 16, 2024, 12:37pm UTC](https://forum.techsoft3d.com/t/robust-way-to-determine-if-a-3d-model-space-point-is-within-the-view-frustum/4117/3 "2024-10-16T12:37:30Z")

</div>

Hi Tino,

I am aware of these functions. But these will return false if the point is obscured by other entities. This I do not want. As long as the point is within the view frustum (even if hidden by objects in front of it), i want to base some action.

Thanks  
kg

---

<div class="post-metadata">

### Author: ![tino](https://avatars.discourse-cdn.com/v4/letter/t/9dc877/32.png) [@tino](https://forum.techsoft3d.com/u/tino)
#### Post date: [October 21, 2024, 1:58pm UTC](https://forum.techsoft3d.com/t/robust-way-to-determine-if-a-3d-model-space-point-is-within-the-view-frustum/4117/4 "2024-10-21T13:58:31Z")

</div>

Hello Kg,

As you had previously mentioned, you can use the method [projectPoint](https://docs.techsoft3d.com/communicator/latest/api_ref/viewing/classes/View.html#View.projectPoint) to test if the point is inside the canvas. To test if the point is being clipped by the camera near plane, I believe you just have to check if the z-value of the _projected point_ is less than zero.

Thanks,  
Tino
