1
0
Fork
You've already forked inbol
0
Mirror ball projection tools
  • C 98.7%
  • Shell 1.3%
Find a file
2025年08月10日 18:16:42 +02:00
source Initial commit 2025年08月10日 17:51:58 +02:00
LICENSE Initial commit 2025年08月10日 17:51:58 +02:00
README.md Fixed mistakes in README.md 2025年08月10日 18:16:42 +02:00

This project consists of various tools which can be used to create and explore mirror ball projections. The exploring part is handled by the main program, which uses OpenGL (2.1 or greater) to view the projections in 3D. To compile it, run:

cc main.c -o inbol -lGL -lGLEW -lglfw

The space can be explored by moving the mouse, the FOV can be changed using the scroll wheel. The default viewing angle can be adjusted using the up and down arrows (this is useful if the mirror ball being viewed is a picture taken at an angle). Corrective distortion can be applied using the left and right arrows (if viewing a picture, the real world is not perfect and the mirror ball casts a shadow). To use the program, just give it a mirror ball projection as an argument:

inbol input.png

The tool to convert equirectangular projections to mirror ball projections can be compiled with:

cc convert.c -o convert

Then simply give it an equirectangular projection in the form of an image, the projection can be rotated with the -a and -b arguments (in degrees):

convert input.png -a 120 -b 60

Image sequences of rotating mirror ball projections can be created with the provided POSIX shell script:

sequence input.png

These can be further converted to another format using ffmpeg or imagemagick, for example:

magick -delay 1x30 *.png -dither floyd-steinberg -posterize 4 -layers optimize output.gif

Note: The main program doesn't support viewing videos and the math library may need to be linked on some systems (-lm). The use of -O3 is advised.

Thanks a lot to Wladislav Artsimovich for explaining some of the key concepts to me back in 2023.