obj format

mtllib cube.mtl
o Cube
v 1.0 1.0 -1.0
v 1.0 -1.0 -1.0
v -1.0 -1.0 -1.0
v -1.0 1.0 -1.0
v 1.0 1.0 1.0
v 1.0 -1.0 1.0
v -1.0 -1.0 1.0
v -1.0 1.0 1.0
vt 0.0 0.0
vt 1.0 0.0
vt 1.0 1.0
vt 0.0 1.0
vn 0.0 1.0 0.0
vn -1.0 0.0 0.0
vn 0.0 -1.0 0.0
vn 1.0 0.0 0.0
vn 1.0 0.0 0.0
vn 0.0 0.0 1.0
vn 0.0 0.0 -1.0
usemtl Material_diffuse.jpg
f 5/1/1 1/2/1 4/3/1
f 5/1/1 4/3/1 8/4/1
f 3/1/2 7/2/2 8/3/2
f 3/1/2 8/3/2 4/4/2
f 2/1/3 6/2/3 3/4/3
f 6/2/3 7/3/3 3/4/3
f 1/1/4 5/2/4 2/4/4
f 5/2/5 6/3/5 2/4/5

f 5/1/6 8/2/6 6/4/6

f 8/2/6 7/3/6 6/4/6
f 1/1/7 2/2/7 3/3/7
f 1/1/7 3/3/7 4/4/7
With just a quick glance at the fi le content, you can tell what most lines represent — starting with
mtllib, which represents the material library associated with the geometry file. Then you can fi nd an
object declaration, represented by the token o, followed by each set of indexed vertex positions (v).
Next comes the indexed texture coordinates (vt), also known as UVs, and the vertex normals (vn).
After the vertex data declaration, the usemtl line specifi es which material will be used for the incoming
faces. Then, for each face, three sets of vertex positions, UV, and normal index are specifi ed (the f lines).

Each of these sets basically represents a triangle. Wavefront OBJ also supports a quad (which would be
read as four sets); however, since every face representation in GLES has to be defi ned as a triangle, make
sure you triangulate the faces of your meshes before you export them to the OBJ format.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值