Adding the ability to have 360 degree viewing range?

User avatar
benrob0329
Member
 
Posts: 1192
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
In-game: benrob03

Adding the ability to have 360 degree viewing range?

by benrob0329 » Thu Feb 25, 2016 02:08

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

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

by kahrl » Fri Feb 26, 2016 07:08

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.
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 9 guests

cron