美文网首页
An brief introduction to PLY pol

An brief introduction to PLY pol

作者: asl_1da7 | 来源:发表于2020-08-10 11:32 被阅读0次

Two sub-formats:

  • ASCII: easily to understand
  • Binary: compact storage and rapid saving/loading

Elements:

  • vertices
  • faes
    ...

Properties:

  • color
  • normal direction
    ...

Ply file 一般包含三个部分

  • header 用来描述下面元素的个数属性等等
  • vertices
  • faces
    下面是一个例子,注意{}中的内容只是为了说明,正常的ply文件是不含这些内容的。
    comment开头的是注释
    #开头是我自己加的注释
ply
format ascii 1.0 { ascii/binary, format version number }
comment made by Greg Turk { comments keyword specified, like all lines }
comment this file is a cube
element vertex 8 { define "vertex" element, 8 of them in file } #一共有8个vertices, 每一个包含6个属性
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 } #一共包含6个faces
property list uchar int vertex_index { "vertex_indices" is a list of ints } 
end_header { delimits the end of the header }  # header结束的标志,下面开始依次列出vertices和faces
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

在看一个

ply
format ascii 1.0
comment author: Greg Turk
comment object: another cube
element vertex 8
property float x
property float y
property float z
property uchar red { start of vertex color } #这里在原网页中是错的,现在这个是改正的版本
property uchar green
property uchar blue
element face 7
property list uchar int vertex_index { number of vertices for each face }
element edge 5 { five edges in object }
property int vertex1 { index to first vertex of edge }
property int vertex2 { index to second vertex }
property uchar red { start of edge color }
property uchar green
property uchar blue end_header
0 0 0 255 0 0 { start of vertex list }
0 0 1 255 0 0
0 1 1 255 0 0
0 1 0 255 0 0
1 0 0 0 0 255
1 0 1 0 0 255
1 1 1 0 0 255
1 1 0 0 0 255
3 0 1 2 { start of face list, begin with a triangle }
3 0 2 3 { another triangle }
4 7 6 5 4 { now some quadrilaterals }
4 0 4 5 1
4 1 5 6 2
4 2 6 7 3
4 3 7 4 0
0 1 255 255 255 { start of edge list, begin with white edge }
1 2 255 255 255
2 3 255 255 255
3 0 255 255 255
2 0 0 0 0 { end with a single black line }

ply格式的文件应该是包含边的颜色信息的,但是不知道能不能在Blender中显示出来。
如果有小伙伴知道怎样显示请在评论区告诉我呀~

references

  1. wiki
  2. The PLY Polygon File Format

相关文章

网友评论

      本文标题:An brief introduction to PLY pol

      本文链接:https://www.haomeiwen.com/subject/sqgrrktx.html