Update the gridhelper size to the whole camera view with OrbitControls

I would like to display a grid in my view that changes with my orbit controls to always fill the “current camera view”. I can update the grids position with the change event on the orbitcontrols, but I don’t know how to get some kind of measure of how much is visible in the current camera view so I can update the grid size accordingly. Now my grid gets really small if I zoom out, or very big when i zoom in. I know it’s a bit complicated with rotating, but if I could get at least the max x or max z visible distance, I could use the camera’s/canvas’ aspect ratio to calculate the other distance.

This might help you, it doesn’t rely on lines geometry and provides an infinite grid which fades off by distance.

1 Like

Hey @Fyrestar, it does help somewhat, but there’s an essential component it doesn’t do and that is change the scale with zooming. So my original question for that still remains: how do I figure out the zoom level and relate that to what the user can see with the camera. Is there a way to find out what the dimensions are of the area delineated by near, far and fov of the furstrum in the xz plane? And this in relation with ObitControls and zooming in/out.