将等矩形(圆柱投影;天球)贴图映射到6个立方体(立方体映射;天箱)面的实用程序
sphere2cube的Python项目详细描述
sphere2立方体
sphere2cube是映射等矩形的脚本 (圆柱形投影,天球)映射到6个立方体(立方体映射,天箱) 面孔。
用法
$ sphere2cube -h usage: sphere2cube [-h] [-v] [-r <size>] [-R <rx> <ry> <rz>] [-o <path>] [-f <name>] [-b <path>] [-t <count>] [-V] [<source>] Maps an equirectangular (cylindrical projection, skysphere) map into 6 cube (cubemap, skybox) faces. positional arguments: <source> source equirectangular image filename optional arguments: -h, --help show this help message and exit -v, --version show program's version number and exit -r <size>, --resolution <size> resolution for each generated cube face (defaults to 1024) -R <rx> <ry> <rz>, --rotation <rx> <ry> <rz> rotation in degrees to apply before rendering cube faces (z is up) -o <path>, --output <path> filename for rendered faces: default is "face_%n_%r", where %n is replaced by the face number, and %r by the resolution -f <name>, --format <name> format to use when saving faces, i.e. "PNG" or "TGA" -b <path>, --blender-path <path> filename of the Blender executable (defaults to "blender") -t <count>, --threads <count> number of threads to use when rendering (1-64) -V, --verbose enable verbose logging
支持的输出格式取决于搅拌器的安装,但是 通常包括tga、iris、jpeg、movie、iriz、rawtga、aviraw、avijpeg、png, bmp和frameserver。
sphere2cube可以在无头环境中运行(例如 服务器)。
示例
例如,从 source.jpg,我们可以使用以下命令:
$ sphere2cube source.jpg -r2048 -fTGA
这将在 工作目录。
安装
sphere2cube可以用pip轻松安装。
它假设blender已安装,并且blender可执行文件列在系统路径环境变量中。如果无法编辑路径(与未授权用户的情况一样),则指向blender可执行文件的路径可以通过-b标志传递。
Linux
$ apt-get install blender $ pip install sphere2cube