# How to ascertain if a vertex is within the camera's field of view (Front View)?

**URL:** <https://forum.babylonjs.com/t/how-to-ascertain-if-a-vertex-is-within-the-cameras-field-of-view-front-view/44889>\
**Category:** Questions\
**Created:** [October 13, 2023, 2:25pm UTC](https://forum.babylonjs.com/t/how-to-ascertain-if-a-vertex-is-within-the-cameras-field-of-view-front-view/44889 "2023-10-13T14:25:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SNM](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/snm/32/34046_2.png) [@SNM](https://forum.babylonjs.com/u/SNM)\
**Post date:** [October 13, 2023, 2:25pm UTC](https://forum.babylonjs.com/t/how-to-ascertain-if-a-vertex-is-within-the-cameras-field-of-view-front-view/44889/1 "2023-10-13T14:25:53Z")

</div>

I’ve been trying to determine whether a vertex lies within the camera’s field of view for past couple of days.  
Specifically, I want to identify vertices positioned on the visible front side while excluding the backside (backside view) and lateral views (Side Views).

Here’s what I’ve attempted:

> **[Babylon.js Playground](https://playground.babylonjs.com/#DHMKDS)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

Used `scene.pickWithRay()` function to check if the ray intersects with any other objects in the scene, **but it didn’t yield the expected results**.  
The idea was… If the ray hits something, it means that the vertex is not in the camera’s front view, and if it doesn’t hit anything, the vertex is in the camera’s front view.  
**However, the method mentioned above proved to be ineffective** , as it falsely identified all vertices as hits.

Any help on this issue would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Raggar](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raggar/32/20672_2.png) [@Raggar](https://forum.babylonjs.com/u/Raggar)\
**Post date:** [October 13, 2023, 2:39pm UTC](https://forum.babylonjs.com/t/how-to-ascertain-if-a-vertex-is-within-the-cameras-field-of-view-front-view/44889/2 "2023-10-13T14:39:45Z")

</div>

I’m not entirely sure that I understand your goal here.

Are you trying to determine whether or not a vertex is within the frustum of the camera? You can then use isInFrustum(planes) on the vector.

Are you instead trying to determine whether or not another object is in front of the object the vertices belong to? Could you use occlusion culling?

Or are you simply trying to determine whether or not the face belonging to a vertex is facing the camera? You could do some Dot products between the normal of the vertex and the camera direction

---

<div class="post-metadata">

**Author:** ![SNM](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/snm/32/34046_2.png) [@SNM](https://forum.babylonjs.com/u/SNM)\
**Post date:** [October 13, 2023, 4:04pm UTC](https://forum.babylonjs.com/t/how-to-ascertain-if-a-vertex-is-within-the-cameras-field-of-view-front-view/44889/3 "2023-10-13T16:04:41Z")

</div>

I just can’t thank you enough!  
This is precisely what I was looking for:

> [@Raggar](#):
>
> Or are you simply trying to determine whether or not the face belonging to a vertex is facing the camera? You could do some Dot products between the normal of the vertex and the camera direction

Thanks again! Thanks a lot!
