mpetroff / pannellum

Pannellum is a lightweight, free, and open source panorama viewer for the web.
https://pannellum.org/
MIT License
4.23k stars 721 forks source link

Logic behind generate.py #1077

Open tokidoki11 opened 2 years ago

tokidoki11 commented 2 years ago

Hi, It will be very nice if the logic behind generate.py is written somewhere I saw only how to use it

Thanks

mpetroff commented 2 years ago

It projects the panorama to a cube map using nona and then tiles the cube map faces into image pyramids. This is the same method that was used by the Flash-based panorama viewers that existed when Pannellum's multi resolution support was added.

If you want more details, you should just look at the script itself (not the most satisfying answer, sorry). It's only ~350 lines and includes comments that describe the purpose of each step.