每一行是一份数据,若要把一行信息拆成份数据,则每一份的数据后面需要添加‘\’,'\'后面不能添加空格或者Tab格,数据格式如下:
【类型名称】(空格)【值】
#开头的行为注释
顶点数据:
v 几何体顶点(Geometric vertices)
vt 贴图坐标点(Texture vertices)
vn 顶点法线(Vertex normals)
vp 参数空格顶点 (Parameter space vertices)
自由形态曲线(Free-form curve)/表面属性(surface attributes):
deg 度(Degree)
bmat 基础矩阵(Basis matrix)
step 步尺寸(Step size)
cstype 曲线或表面类型 (Curve or surface type)
元素(Elements):
p 点(Point)
l 线(Line)
f 面(Face)
curv 曲线(Curve)
curv2 2D曲线(2D curve)
surf 表面(Surface)
自由形态曲线(Free-form curve)/表面主体陈述(surface body statements):
parm 参数值(Parameter values )
trim 外部修剪循环(Outer trimming loop)
hole 内部整修循环(Inner trimming loop)
scrv 特殊曲线(Special curve)
sp 特殊的点(Special point)
end 结束陈述(End statement)
自由形态表面之间的连接(Connectivity between free-form surfaces):
con 连接 (Connect)
成组(Grouping):
g 组名称(Group name)
s 光滑组(Smoothing group)
mg 合并组(Merging group)
o 对象名称(Object name)
显示(Display)/渲染属性(render attributes):
bevel 导角插值(Bevel interpolation)
c_interp 颜色插值(Color interpolation)
d_interp 溶解插值(Dissolve interpolation)
lod 细节层次(Level of detail)
usemtl 材质名称(Material name)
mtllib 材质库(Material library)
shadow_obj 投射阴影(Shadow casting)
trace_obj 光线跟踪(Ray tracing)
ctech 曲线近似技术(Curve approximation technique)
stech 表面近似技术 (Surface approximation technique)
例子:
#点数据:3个坐标点,数值之间添加空格,Vector3类型值
v 2.1 3.2 4.3
#贴图坐标点:0-1之间取值的Vector2类型值
vt 0.000 1.000
#f中的数据是v中的点的索引值,由第一个v的顶点、第二个v的顶点、第三个v的顶点组成的一个面,(1为起点,并不是0)
f 1 2 3
#多个数据索引,顶点/uv点/法线
f 1/1/1 2/2/2 3/3/3