Fisheye
khonkhortisan opened this issue · 3 comments
While any way I've tried to compile Render360 so far ends up with it stuck in Render Mode: Standard so I can't check if this actually works, I've added a set of fisheye lenses: 18107:master...khonkhortisan:fisheye
If it works, it has equidistant (distance from center is angle from forward), stereographic (preserves angles, mirror ball), orthographic (textured ball), equisolid (objects remain the same size if you turn your head), and Thoby (?) fisheye modes.
I combined code from equirectangular/hammer.js/java to make it.
Mathᵉᵐᵃᵗⁱᶜs sources (using inverse functions):
https://github.com/shaunlebron/blinky/blob/master/game/lua-scripts/lenses/fisheye1.lua (equidistant)
https://github.com/shaunlebron/blinky/blob/master/game/lua-scripts/lenses/fisheye2.lua (equisolid)
https://wiki.panotools.org/Fisheye_Projection
edit: notes to self:
✔️ Now that I think about it, I should add a button to zoom in enough for full-frame fisheye. [more math] (assuming the current lenses already fit to window height)
✔️ Might want to change the order of the fisheye lenses to equidistant-stereographic-equisolid so it smoothly transitions