aka3301 Posted July 30, 2021 Posted July 30, 2021 I have built a ObjectTerrainGlobal and GlobalWater. Could anyone provide advice or solutions to get four points (a, b, c,d) of camera view range. Thanks. -------------------------------------- Envrionment: c++ Unigine 2.8.0
rohit.gonsalves Posted July 30, 2021 Posted July 30, 2021 Dear @aka3301, I used this reference for understanding and using Pinhole model on which players are dependent. https://www.scratchapixel.com/lessons/3d-basic-rendering/3d-viewing-pinhole-camera/implementing-virtual-pinhole-camera There is also simple discussion here https://gamedev.stackexchange.com/questions/19774/determine-corners-of-a-specific-plane-in-the-frustum Using trignometry functions you can find the a,b,c,d. But I am afraid a and b must be top left and top right. What you wanted to find is little complex. Are you using Physically based camera for setting Field of view? Rohit 1
aka3301 Posted August 2, 2021 Author Posted August 2, 2021 Dear @rohit.gonsalves Thanks for your useful advice. I'll look at it. I don't quite understand what Physically based camera is? The Unigine player I used was PlayerSpectatorPlayer. I guess that is a Physically based camera.
rohit.gonsalves Posted August 3, 2021 Posted August 3, 2021 Dear @aka3301, Check this https://developer.unigine.com/en/docs/2.14.1/editor2/camera_settings/?rlang=cpp In your camera or player setting, For Field of view you have two options. 1. Vertical FOV 2. Physically based Fov Based on focal length and Film gate (Width of camera sensor) If you use this mode it is easier to use pin hole model with focal length. Otherwise you calculate Horizontal Fov first then convert to Vertical FoV. I will find my implementation and share here. Rohit 1
Recommended Posts