How to obtain how much a certain mesh is displayed in the camera in a babylon scene?

How to obtain how much a certain mesh is displayed in the camera in a babylon scene?

The scene evaluates active meshes on each frame, so you could check if the mesh is in the active meshes array. Otherwise, you could check if a mesh is in the camera’s frustum. Something like this:

Animation Examples | Babylon.js Playground (babylonjs.com)

I can check if the grid is in the active grid array
But I want to know how much mesh is displayed in the camera

Is this right?

scene.getActiveMeshes().length will give you the data you need. Call it on each frame you want to check.

Hello :slight_smile:

In this topic I had given this Playground which computes ratio of the mesh seen in the camera (projecting vertices and computing 2D bounding box). Is it what you are looking for ?

++
Tricotou

1 Like