OFF is a data directory which contains examples of OFF files. An OFF file is good for storing a description a 2D or 3D object constructed from polygons. There is even a simple extension which can handle objects in 4D.
While there are many variations and extensions of the OFF format, the simplest files have the following structure:
Line 1
OFF
Line 2
vertex_count face_count edge_count
One line for each vertex:
x y z
for vertex 0, 1, ..., vertex_count-1
One line for each polygonal face:
n v1 v2 ... vn,
the number of vertices, and the vertex indices for each face.
The vertices are implicitly numbered by the order of their listing in the file. The first vertex will have index 0, and the last will have index vertex_count-1. Comment lines may be inserted anywhere, and are denoted by the character # appearing in column 1. Blank lines are also acceptable.
Colors can be assigned to the vertices by following the XYZ coordinates of a vertex with the RGBA color coordinates (the "A" coordinate controls the transparency). In particular, this means that the form of the vertex lines would be:
One line for each colored vertex:
x y z r g b a
for vertex 0, 1, ..., vertex_count-1
Colors can be assigned to the faces by following the vertex indices by the RGBA color coordinates of the face. In particular, this means that the form of the face lines would be:
One line for each polygonal face:
n v1 v2 ... vn r g b a,
the number of vertices, the vertex indices, and the RGBA color coordinates for each face.
Normally, color is not specified for BOTH the vertices and faces. If the node colors are specified, then the faces are colored with a smooth interpolation of the colors of their vertices.
OFF
#
# cube.off
# A cube.
# There is extra RGBA color information specified for the faces.
#
8 6 12
1.632993 0.000000 1.154701
0.000000 1.632993 1.154701
-1.632993 0.000000 1.154701
0.000000 -1.632993 1.154701
1.632993 0.000000 -1.154701
0.000000 1.632993 -1.154701
-1.632993 0.000000 -1.154701
0.000000 -1.632993 -1.154701
#一个多边形面代表一行,然后分别是顶点个数,顶点索引,rgb-颜色,a-透明度
4 0 1 2 3 1.000 0.000 0.000 0.75
4 7 4 0 3 0.300 0.400 0.000 0.75
4 4 5 1 0 0.200 0.500 0.100 0.75
4 5 6 2 1 0.100 0.600 0.200 0.75
4 3 2 6 7 0.000 0.700 0.300 0.75
4 6 5 4 7 0.000 1.000 0.000 0.75
我将这个cube导入MeshLab后的结果
其他3Dmodel的读取软件包括glc_player和cloudcomp都不行要么直接崩溃要么显示不了颜色信息