![]() |
|||
|
|
The BYU format is an ASCII file format for polygonal meshes.
Each file consists of three parts:
The header consists of two lines. The first line specifies the number of parts, the number of vertices, the number of polygons, and the number of edges. The second line specifies sequences of beginning and ending polygon numbers for each part. Each field is assumed to be 7 characters wide (i.e., I7 FORTRAN style format, or %7d C format). Typically the number of parts (in a file) is 1, so the second line is the pair (1, number of polygons).
The vertex list is a list of all the vertices present in the model. Each vertex is represented by 3 floats giving its x, y, and z-coordinates. Thus, the vertex list consists of of (3 * number of vertices) floats. The list is in free format. (Apparently in the 'true' BYU format, there are two vertices listed per line. We do not enforce that.)
The polygon list is a list of the polygons forming the faces of the model. Each polygon consists of a list of three or more vertices, where vertices are identified by their integer indices in the vertex list (one offset). The last vertex of a polygon is indicated by negating its index, i.e., a polygon definition is terminated by a negative number.
The extension for BYU files is ".g".
The following file example represents a cube in 3-Dimensional space. It contains 8 vertices, 12 polygons, and 36 edges. The polygons for the first (and only) part are numbered 1 through 12.
1 8 12 36 1 12 1.0 1.0 1.0 1.0 1.0 -1.0 1.0 -1.0 1.0 1.0 -1.0 -1.0 -1.0 1.0 1.0 -1.0 1.0 -1.0 -1.0 -1.0 1.0 -1.0 -1.0 -1.0 1 5 -7 1 7 -3 1 2 -6 1 6 -5 1 3 -4 1 4 -2 5 6 -8 5 8 -7 2 4 -8 2 8 -6 3 7 -8 3 8 -4
Parasol Home | Research | People | General info | Seminars | Resources Parasol Lab, 301 Harvey R. Bright Bldg, 3112 TAMU, College Station, TX 77843-3112 Contact Webmaster Phone 979.458.0722 Fax 979.458.0718
Department of Computer Science and Engineering | Dwight Look College of Engineering | Texas A&M University Privacy statement: Computer Science and Engineering Engineering TAMU |