Hi,
I’m currently trying to port the camera controls from a C++ program to Javascript using the great Babylon.JS library.
I don’t have much experience with 3D rendering and the mathematics behind that and didn’t write the original camera view logic, so much of the code is a black box for me.
I need the distance from the camera view center (I guess that would be the target of the FreeCamera that i’m using) to the left, right, top and bottom edge of the near frustum plane as you can see in this graphic here, otherwise the existing logic doesn’t seem to work.
https://www.researchgate.net/figure/parametres-de-la-camera-OpenGL-frustum-WNDS99_fig1_278797375
Do you have any idea how i could get those values? They need to be just a normal number for left, right, top and bottom.
I’ve already managed to get the near frustum plane by scene.frustumPlanes[0]
but i don’t know how i could calculate the distances from the center.
Best wishes and thanks already for reading
Edit: So in the end, I need the size of this “camera-rectangle” in the near frustum plane. I guess then i can simply divide the height/ length of it by 2 and should get the desired values.