将6个立方体(立方体、天空盒)面映射为等矩形(圆柱投影、天空球)贴图的实用程序

cube2sphere的Python项目详细描述


立方球面

cube2sphere是映射6多维数据集(cube map,skybox)的python脚本 面成等矩形(圆柱投影,天球)地图。

用法

$ cube2sphere -h
usage: cube2sphere [-h] [-v] [-r <width> <height>] [-R <rx> <ry> <rz>]
               [-o <path>] [-f <name>] [-b <path>] [-t <count>] [-V]
               <front> <back> <right> <left> <top> <bottom>

Maps 6 cube (cubemap, skybox) faces into an equirectangular (cylindrical
projection, skysphere) map.

positional arguments:
  <front>               source front cube face filename
  <back>                source back cube face filename
  <right>               source right cube face filename
  <left>                source left cube face filename
  <top>                 source top cube face filename
  <bottom>              source bottom cube face filename

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -r <width> <height>, --resolution <width> <height>
                        resolution for rendered map (defaults to 1024x512)
  -R <rx> <ry> <rz>, --rotation <rx> <ry> <rz>
                        rotation in degrees to apply before rendering map (z
                        is up)
  -o <path>, --output <path>
                        filename for rendered map (defaults to "out")
  -f <name>, --format <name>
                        format to use when saving map, 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。

cube2sphere可以在无头环境中运行(例如 服务器)。

示例

如果要将6个名为${face}.jpg的立方体面缝合到2048x102tga等矩形映射中,可以使用以下命令:

$ cube2sphere front.jpg back.jpg right.jpg left.jpg top.jpg bottom.jpg -r 2048 1024 -fTGA -ostitched

这将在工作目录中生成stitched.tga

安装

cube2sphere可以用pip轻松安装。

它假定blender已安装,并且blender可执行文件列在系统路径环境变量中。如果无法编辑路径(与未授权用户的情况一样),则指向blender可执行文件的路径可以通过-b标志传递。

窗口

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

pip install cube2sphere

Linux

$ apt-get install blender
$ pip install cube2sphere

Mac OS X

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

$ pip install cube2sphere

欢迎加入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项数组传递到存储过程?