Adding the ability to have 360 degree viewing range?
- 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?
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?
You could try removing the following line in camera.cpp:
However...
The result will probably not be what you expect. The FOV is primarily used to create the projection matrix using the following formula:
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.
Code: Select all
fov_degrees = MYMIN(fov_degrees, 170.0);
The result will probably not be what you expect. The FOV is primarily used to create the projection matrix using the following formula:
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.
Who is online
Users browsing this forum: No registered users and 7 guests