将等矩形(圆柱投影;天球)贴图映射到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标志传递。

窗口

安装Blender,并将blender.exe添加到PATH。最后,

pip install sphere2cube

Linux

$ apt-get install blender
$ pip install sphere2cube

Mac OS X

与windows类似,安装Blender,并将blender可执行文件添加到$PATH。然后,

$ pip install sphere2cube

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
swing Java按钮/网格布局   java列出Google日历中的所有事件   java无效:单击API publisher test按钮后连接到后端时出错   带有内部赋值的java While循环导致checkstyle错误   java为什么trimToSize/ensureCapacity方法提供“公共”级访问?   文件输出流的java问题   ListIterator和并发修改异常的java问题   java如何使用两个URL映射   无法识别使用“./../”构造的字符串java相对路径,为什么?   首次写入remotelyclosedsocket不会触发异常,对吗?JAVA   java OneDrive REST API为文件上载提供了400个无效谓词   Java泛型、集合接口和对象类的问题   OpenSSL Java安全提供程序   jmeter java运行jmx禁用操作