使用开源OpenCTM进行常用三维格式互导

1. 支持导入的三维格式有:

OpenCTM(.ctm)、Stanford triangle format(.ply)、Stereolitography(.stl)、3D Studio(.3ds)、COLLADA(.dae)、

Wavefront geometry file(.obj)、LightWave object(.lwo)、Geomview object file format(.off)

2. 支持导出的三维格式有:

OpenCTM(.ctm)、Stanford triangle format(.ply)、Stereolitography(.stl)、3D Studio(.3ds)、COLLADA(.dae)、

Wavefront geometry file(.obj)、LightWave object(.lwo)、Geomview object file format(.off)、VRML 2.0(.wrl)

3. 纹理贴图格式:JPEG、PNG

4. 使用命令行工具ctmconv.exe进行批量转换

示例:ctmconv Infinite-Level_02.3ds Infinite-Level_02.obj

详细参数如下:

Usage: ctmconv infile outfile [options]

Options:

Data manipulation (all formats)
--scale arg Scale the mesh by a scalar factor.
--upaxis arg Set up axis (X, Y, Z, -X, -Y, -Z). If != Z, the mesh will
be flipped.
--flip Flip triangle orientation.
--calc-normals If the source file does not contain any normals, calculate
them.
--no-normals Do not export normals.
--no-texcoords Do not export texture coordinates.
--no-colors Do not export vertex colors.

OpenCTM output
--method arg Select compression method (RAW, MG1, MG2)
--level arg Set the compression level (0 - 9)

OpenCTM MG2 method
--vprec arg Set vertex precision
--vprecrel arg Set vertex precision, relative method
--nprec arg Set normal precision
--tprec arg Set texture map precision
--cprec arg Set color precision

Miscellaneous
--comment arg Set the file comment (default is to use the comment
from the input file, if any).
--texfile arg Set the texture file name reference for the texture
(default is to use the texture file name reference
from the input file, if any).

Supported file formats:

OpenCTM (.ctm)
Stanford triangle format (.ply)
Stereolithography (.stl)
3D Studio (.3ds)
COLLADA 1.4/1.5 (.dae)
Wavefront geometry file (.obj)
LightWave object (.lwo)
Geomview object file format (.off)
VRML 2.0 (.wrl) - export only

更多请参考:http://openctm.sourceforge.net/

原文地址:https://www.cnblogs.com/kekec/p/2326739.html