Adding the ability to have 360 degree viewing range?

Post Reply
User avatar
benrob0329
Member
Posts: 1341
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03
Location: Michigan
Contact:

Adding the ability to have 360 degree viewing range?

by benrob0329 » Post

So I was going to try to make a 360 Youtube video, but the max range is 160. Could it be increesed to 360?

kahrl
Member
Posts: 236
Joined: Fri Sep 02, 2011 07:51
Location: Rös̓̇chenhof

Re: Adding the ability to have 360 degree viewing range?

by kahrl » Post

You could try removing the following line in camera.cpp:

Code: Select all

fov_degrees = MYMIN(fov_degrees, 170.0);
However...

The result will probably not be what you expect. The FOV is primarily used to create the projection matrix using the following formula:Image
The important entries are the ones on the top left that contain cot(FOV/2). If you look up a plot of cot(x), you will see that it is positive between 0 and 90 degrees, but negative between 90 and 180 degrees. So for FOVs between 180 and 360 degrees, cot(FOV/2) actually becomes negative. In effect FOV=360-x looks a lot like FOV=x, except the entire screen is flipped.

If you want to create a 360° panorama, probably your best bet is to render using a normal FOV in multiple camera directions and use a program to stitch those images together. For video, it might be possible to adapt one of the stereographic 3d modes to continually render the world in multiple directions, then apply the stitching program to each frame of the resulting video.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests