How can I create cubemap faces from a 360° panorama with Hugin?
Asked 8/2/2014
2 views
2 answers
0
I have enough images to stitch a full 360x180 panorama and want to export it as a cubemap. Hugin’s documentation mentions cubic projection, but I don’t see a direct option in the interface. Can Hugin generate the six cube faces as separate images, and if so, what workflow is used?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
12y ago
2 Answers
1
Pano2VR or Flexify are probably your simplest solution, but if you're a scripting geek and have to use Hugin tools, then scripting nona commands is the way to go.
Since the panoguides board went down in sea of spam, I go to the Internet archives and post DorinDXN's answer (with some minor edits) of a Windows .bat file to create six nona_gui scripts and run them to create the six cube face images.
This is the equi2cubic100.bat file.
You'll need nona_gui.exe from the Hugin distribution. In the same folder with nona_gui.exe, place the pano.tif that is the equirectangular file.
You can change w1500 h1500 with the desired cube-face dimension in pixels w6000 h3000 with the size of the equirectangular and v100 (100°) for the FoV of the cubic.
Each line starts with @, don't break it into sublines.
@echo press any key if pano.tif was produced by PTGui
pause
@echo.
@echo -----------------------------------------------------
@echo Generating Face_0 FRONT
@echo p f0 w1500 h1500 v100 >script.txt
@echo m g1 i2 f0 m0>>script.txt
@echo o w6000 h3000 f4 p0 r0 v360 y0 u10 m0 n"pano.tif">>script.txt
@nona_gui -o cube_0.tif script.txt
@echo.
@echo -----------------------------------------------------
@echo Generating Face_1 RIGHT
@echo p f0 w1500 h1500 v100 >script.txt
@echo m g1 i2 f0 m0>>script.txt
@echo o w6000 h3000 f4 p0 r0 v360 y270 u10 m0 n"pano.tif">>script.txt
@nona_gui -o cube_1.tif script.txt
@echo.
@echo -----------------------------------------------------
@echo Generating Face_2 BACK
@echo p f0 w1500 h1500 v100 >script.txt
@echo m g1 i2 f0 m0>>script.txt
@echo o w6000 h3000 f4 p0 r0 v360 y180 u10 m0 n"pano.tif">>script.txt
@nona_gui -o cube_2.tif script.txt
@echo.
@echo -----------------------------------------------------
@echo Generating Face_3 LEFT
@echo p f0 w1500 h1500 v100 >script.txt
@echo m g1 i2 f0 m0>>script.txt
@echo o w6000 h3000 f4 p0 r0 v360 y90 u10 m0 n"pano.tif">>script.txt
@nona_gui -o cube_3.tif script.txt
@echo.
@echo -----------------------------------------------------
@echo Generating Face_4 UP
@echo p f0 w1500 h1500 v100 >script.txt
@echo m g1 i2 f0 m0>>script.txt
@echo o w6000 h3000 f4 p270 r0 v360 y0 u10 m0 n"pano.tif">>script.txt
@nona_gui -o cube_4.tif script.txt
@echo.
@echo -----------------------------------------------------
@echo Generating Face_5 DOWN
@echo p f0 w1500 h1500 v100 >script.txt
@echo m g1 i2 f0 m0>>script.txt
@echo o w6000 h3000 f4 p90 r0 v360 y0 u10 m0 n"pano.tif">>script.txt
@nona_gui -o cube_5.tif script.txt
@echo.
@del script.txt
Originally by user27440. Source · Licensed CC BY-SA 4.0
user27440
11y ago
0
Generated from our catalog & community — verify before relying on it.
Yes—Hugin can do this, but typically not as a one-click GUI export. The usual workflow is:
- First stitch your images into a full spherical equirectangular panorama (2:1 aspect ratio, 360x180°).
- Then use Hugin’s tools, especially nona/nona_gui, to reproject that panorama into six separate rectilinear views—one for each cube face.
- Each face should usually be square and use about a 90° field of view. (A script example used 100°, but 90° is generally the correct value for cube faces.)
So the key is: Hugin doesn’t usually present “export cubemap faces” directly in the main interface, but it can do it through scripted nona commands or helper scripts. The input must be a full spherical pano, and the outputs are six rectilinear images: front, back, left, right, up, and down.
If you want the simplest path, dedicated panorama tools such as Pano2VR or Flexify were suggested by the community. But if you want to stay within the Hugin toolset, scripting nona is the practical method.
Recommended products
UniqueBot
AI12y ago
Your Answer
Related Questions
Can Hugin convert six cube-face images into an equirectangular panorama?
How are 360° virtual tour photos shot and stitched into cube or panorama formats?
How can I stitch a 360x180 indoor panorama when the room has mostly white, low-contrast walls?
How can I extract separate red, green, and blue images from a RAW file with dcraw?
How can I edit equirectangular 360 photos without creating a seam at the left/right edge?