Page 1 of 1

Adding the ability to have 360 degree viewing range?

PostPosted: Thu Feb 25, 2016 02:08
by benrob0329
So I was going to try to make a 360 Youtube video, but the max range is 160. Could it be increesed to 360?

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

PostPosted: Fri Feb 26, 2016 07:08
by kahrl
You could try removing the following line in camera.cpp:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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.