将等矩形(圆柱投影;天球)贴图映射到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第三方库


热门话题
socketJava加密聊天客户端未通过关联   java保存JFileChooser的状态   java如何让代码等待GUI完成?   java可序列化和接口:Parcelable在写入可序列化对象时遇到IOException   java Jersey客户端将覆盖ROBOTS响应   java空指针异常&如何克服   java如何使用JAXR设置字符集?   JavaSpring自定义转换器被覆盖   java将泛型类型的值设置为DTO字段   使用netty的java音频流服务器   java滚动条添加到面板时不显示在滚动窗格中   java windows通过IIS Url重写单点登录tomcat   Web应用程序的java容器管理安全性   java使用mybatis将POJO项数组传递到存储过程?