Jump to content

How to get the coordinate of the farest and the nearest points of view range?


photo

Recommended Posts

Posted

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

 

 

Snipaste_2021-07-30_13-30-09.jpg.a4a85331543f237669681d6c74fa0357.jpg

Posted

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

  • Like 1
Posted

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.

Posted

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

 

  • Like 1
×
×
  • Create New...