Object Files (.obj)

文件格式


以#号开始的为注释行。

 

An OBJ file contains several types of definitions:

 

 


Face definitions

 

面片的定义使用顶点坐标、贴图坐标和法向量坐标的索引。

Faces are defined using lists of vertex, texture and normal indices. Polygons such as quadrilaterals can be defined by using more than three vertex/texture/normal indices.

OBJ files also support free form curved surface objects such as NURB surfaces.

There are several ways to define a face, but each face line definition starts with "f" character.


Vertex

A valid vertex index starts from 1 and match first vertex element of vertex list previously defined. Each face can contain more than three elements.

表示这个面片由顶点列表中的第v1个顶点、第v2个顶点、第v3个顶点和第v4个顶点连接而成。

索引值从1开始。(也可以取负值,表示从最后一个顶点开始数上去。)

 

Vertex/texture-coordinate

Each texture coordinate index must follow with no space the first slash. Texture coordinates index are optional. A valid texture coordinate index starts from 1 and match first texture coordinate element of texture coordinate list previously defined. Each face can contain more than three elements.

Vertex/texture-coordinate/normal

Each normal index must follow with no space the second slash. Normals index are optional. A valid normal index starts from 1 and match first normal element of normal list previously defined. Each face can contain more than three elements.

Vertex/normal

As texture coordinates are optional, one can define geometry without them, but one must put the normal index after second slash.

 


 

References:

http://en.wikipedia.org/wiki/Wavefront_.obj_file

http://people.sc.fsu.edu/~jburkardt/txt/obj_format.txt

http://www.cppblog.com/lovedday/archive/2008/06/13/53153.html

http://mailao.ycool.com/post.1905836.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值