https://github.com/xyene/cube2sphere
Python script to map 6 cube (cubemap, skybox) faces into an equirectangular (cylindrical projection, skysphere) map.
https://github.com/xyene/cube2sphere
convert converter cubemap graphics image texture
Last synced: 2 months ago
JSON representation
Python script to map 6 cube (cubemap, skybox) faces into an equirectangular (cylindrical projection, skysphere) map.
- Host: GitHub
- URL: https://github.com/xyene/cube2sphere
- Owner: Xyene
- License: agpl-3.0
- Created: 2015-08-31T00:43:29.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-08-10T13:27:15.000Z (10 months ago)
- Last Synced: 2024-10-13T08:25:36.954Z (8 months ago)
- Topics: convert, converter, cubemap, graphics, image, texture
- Language: Python
- Homepage:
- Size: 202 KB
- Stars: 200
- Watchers: 8
- Forks: 28
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
cube2sphere [](https://pypi.python.org/pypi/cube2sphere) [](https://pypi.python.org/pypi/cube2sphere)
===========`cube2sphere` is a Python script to map 6 cube (cubemap, skybox) faces
into an equirectangular (cylindrical projection, skysphere) map. See
also [`sphere2cube`](https://github.com/Xyene/sphere2cube).Usage
=====$ cube2sphere -h
usage: cube2sphere [-h] [-v] [-r ] [-R ]
[-o ] [-f ] [-b ] [-t ] [-V]
Maps 6 cube (cubemap, skybox) faces into an equirectangular (cylindrical
projection, skysphere) map.positional arguments:
source front cube face filename
source back cube face filename
source right cube face filename
source left cube face filename
source top cube face filename
source bottom cube face filenameoptional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-r , --resolution
resolution for rendered map (defaults to 1024x512)
-R , --rotation
rotation in degrees to apply before rendering map (z
is up)
-o , --output
filename for rendered map (defaults to "out")
-f , --format
format to use when saving map, i.e. "PNG" or "TGA"
-b , --blender-path
filename of the Blender executable (defaults to
"blender")
-t , --threads
number of threads to use when rendering (1-64)
-V, --verbose enable verbose loggingSupported output formats depend on the Blender installation, but will
generally include TGA, IRIS, JPEG, MOVIE, IRIZ, RAWTGA, AVIRAW, AVIJPEG,
PNG, BMP, and FRAMESERVER.`cube2sphere` can be run in a headless environment (e.g., a server).
Examples
========If we wanted to stitch 6 cube faces named `${face}.jpg` into a 2048x1024
TGA equirectangular map, we could use the following command:$ cube2sphere front.jpg back.jpg right.jpg left.jpg top.jpg bottom.jpg -r 2048 1024 -fTGA -ostitched
This would generate `stitched.tga` in the working directory.
Installation
============`cube2sphere` can be easily installed with `pip`. It requires a Python 3 installation.
It assumes that [Blender](https://www.blender.org/) is installed and the `blender` executable is
listed in the system PATH environment variable. If it is not possible
for PATH to be edited (as in the case of an unprivileged user), the path
to the `blender` executable may instead be passed through the `-b` flag.Windows
-------Install Blender, and add `blender.exe` to `PATH`. Finally,
pip install cube2sphere
Linux
-----$ apt-get install blender
$ pip install cube2sphereMac OS X
--------Similar to Windows, install Blender, and add the `blender` executable
to `$PATH`. Then,$ pip install cube2sphere