A standalone equirectangular panorama viewer built with Three.js and HTML5. Works with Apache2 and requires no build process or dependencies.
- Drag & Drop: Simply drag and drop a JPG or PNG panorama image onto the page
- Load Button: Click the "Load Image" button to browse and select an image
- Panorama Selector: Dropdown menu that automatically lists all panoramas from the
/panosfolder - Interactive Controls:
- Drag to rotate the view
- Scroll to zoom in/out
- Touch Support: Works on touch devices
- Copy
index.htmlandpanos.jsonto your Apache2 web server directory (e.g.,/var/www/html/or your virtual host directory) - Create a
/panosfolder in the same directory and place your panorama images (JPG/PNG) there - Run
generate_panos_json.shto generate thepanos.jsonfile listing all panoramas:Or manually edit./generate_panos_json.sh
panos.jsonto add your panorama files - Ensure the files have appropriate permissions
- Access via your web browser through the web server
Note:
- Run
generate_panos_json.shwhenever you add or remove panorama images to update the dropdown list - The panorama dropdown requires a web server (HTTP/HTTPS) to load
panos.json. Opening the HTML file directly viafile://protocol will not load the dropdown list due to browser security restrictions. However, drag & drop and the "Load Image" button will still work locally.
- Open the page in your web browser (via web server for full functionality)
- Load a panorama using one of these methods:
- Select from dropdown: Choose a panorama from the dropdown menu (requires web server - loads from
panos.json) - Drag & Drop: Drag and drop a JPG or PNG panorama image onto the page (works locally and on server)
- Load Image button: Click the "Load Image" button and select an image file (works locally and on server)
- Select from dropdown: Choose a panorama from the dropdown menu (requires web server - loads from
- The panorama will be displayed in 360° view
- Use your mouse/touch to drag and rotate the view
- Use the mouse wheel to zoom in and out
For local testing without a full web server setup, you can use a simple local web server:
# Python 3
python -m http.server 8000
# PHP
php -S localhost:8000
# Node.js (if you have http-server installed)
npx http-server -p 8000Then open http://localhost:8000 in your browser.
- Modern web browser with WebGL support
- Apache2 web server (or any web server)
- Equirectangular panorama images (JPG or PNG format)
- Bash shell (for the JSON generator script, or manually edit
panos.json)
- Uses Three.js (loaded from CDN)
- Pure JavaScript/HTML - no server-side processing required
- Static JSON file (
panos.json) lists available panoramas (loaded via fetch API) - Bash script (
generate_panos_json.sh) generates the JSON file from/panosfolder - No build process required
- No server-side dependencies (no PHP, Node.js, etc. needed)
- Requires a web server (HTTP/HTTPS) for the dropdown selector to work (due to browser CORS restrictions with
file://protocol)
your-web-directory/
├── index.html # Main viewer page
├── panos.json # JSON file listing available panoramas
├── generate_panos_json.sh # Script to generate panos.json
└── panos/ # Folder containing panorama images
├── panorama1.jpg
├── panorama2.png
└── ...
Whenever you add or remove panorama images from the /panos folder, run:
./generate_panos_json.shThis will regenerate panos.json with the current list of images. Alternatively, you can manually edit panos.json using this format:
[
{
"name": "panorama1.jpg",
"path": "panos/panorama1.jpg"
},
{
"name": "panorama2.png",
"path": "panos/panorama2.png"
}
]