PLY(Polygon File Format)多邊形文件格式(斯坦福三角格式),表示3D文件格式,用於存儲描述為多邊形集合的圖形對象
PLY文件格式有
ASCII:用於輕松啟動
二進制格式:用於緊湊存儲和快速保存和加載
PLY文件的結構
Header
Vertex List
Face List
(lists of other elements)
eg:
ply format ascii 1.0 { ascii/binary, format version number } comment this file is a cube element vertex 8 { define "vertex" element, 8 of them in file } property float x { vertex contains float "x" coordinate } property float y { y coordinate is also a vertex property } property float z { z coordinate, too } element face 6 { there are 6 "face" elements in the file } property list uchar int vertex_index { "vertex_indices" is a list of ints } end_header { delimits the end of the header } 0 0 0 { start of vertex list } 0 0 1 0 1 1 0 1 0 1 0 0 1 0 1 1 1 1 1 1 0 4 0 1 2 3 { start of face list } 4 7 6 5 4 4 0 4 5 1 4 1 5 6 2 4 2 6 7 3 4 3 7 4 0
說明:
注解 {……}
元素描述
element <元素名> <在文件里的個數> property <數據類型> <屬性名-1> property <數據類型> <屬性名-2> ……
屬性的數據類型
#Name | #Type | #Number of Bytes char | character | 1 uchar | unsigned character | 1 short | short integer | 2 ushort | unsigned short integer | 2 int | Integer | 4 uint | unsigned Integer | 4 float | single-precision float | 4 double | double precision float | 8
http://paulbourke.net/dataformats/ply/