This is a fisheye projection mesh generator. It generates mesh files (.obj) and you can use theses files to create a virtual fisheye camera in a Unity virtual environment.
This script is only for 180 degree camera. You can update the code change the FOV.
Install dependent packages first.
$ pip install -r requirements.txt
Then run the script.
$ python run.py --model_type equidistance --res 64
This generator supports four fisheye projection model types.
- equidistance
- orthogonal
- stereographic
- equisolid
The higher number generates more fine mesh. Default value is 64. What it actually means is a number of grids that splits a side of a virtual cube.
The script will create two folders for square objects (square_objs
) and fisheye objects (fish_objs
). What you will use is the fisheye objects. It also creates fisheye.png
, which visualizes the created fisheye meshes.
If you want to understand more about this code, please check this document.
If you want to create a fisheye camera using the mesh outputs, please check out this repository.
Here are some great articles about fisheye camera for Unity.