Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
[2.1] 3D Imaging, Analysis and Applications-Springer-Verlag London (2012).pdf
Скачиваний:
12
Добавлен:
11.12.2021
Размер:
12.61 Mб
Скачать

156

W.A.P. Smith

4.2.4 Summary of Solid-Based Representations

The method of acquisition of 3D data determines in which of the raw representations the data is delivered. Although some operations are possible on such data (for example, point-based rendering of point clouds), most applications necessitate conversion to a higher level representation. This may require a degree of approximation, for example, integrating a depth map from surface normal data.

The choice between surface-based and solid-based representations is dictated by the nature of the data and the intended application. On the other hand, certain representations are amenable to creation and editing by hand, for example by an animator or CAD designer. The requirements here may include ease and intuition of editing operations and guarantees about the nature of the resulting surface, such as smoothness. Other factors which may influence the choice of representation include storage and processing efficiency, representational power (e.g. some representations can only describe surfaces which are manifold or continuous) and the efficiency with which the representation can be rendered for visualization.

4.3 Polygon Meshes

Polygonal meshes are of such importance and are used so ubiquitously throughout computer graphics and computer vision that we provide a more in depth discussion of the file formats and data structures available for their storage and representation. We focus particularly on triangular meshes, though the representations extend naturally to quad or arbitrary polygon meshes.

Formally, a triangular mesh of N vertices is defined as a pair: M N = (KN, S). The topology, or connectivity, of the mesh is given by the simplicial complex KN, which is a set whose elements can be vertices {i}, edges {i, j } or triangles {i, j, k},

with the indices i, j, k [1 . . . N ]. The actual shape of the mesh is given by the vector S R3N , where the ith vertex is given by vi = [S3i2 S3i1 S3i ]T . There is

some redundancy in this representation (for example, edges can be inferred from triangles) and so not all representations store all of this information.

4.3.1 Mesh Storage

There are a wide range of open and proprietary file formats for the storage of mesh data. These can be categorized into binary and ASCII text formats. The former are more space efficient while the latter are human readable and editable. In general, these file formats all comprise a list of 3D vertices followed by a list of polygons which index into the vertex list. The files may also store vertex or face attributes such as surface normals and texture coordinates.

The most commonly used text-based formats are OBJ (originally developed by Wavefront Technologies) and VRML (Virtual Reality Modeling Language), which

4 Representing, Storing and Visualizing 3D Data

157

was designed particularly with the World Wide Web in mind. The most popular binary format is 3DS which has grown to become a de facto industry standard for transferring models between 3D programs. As well as 3D data, this format can also include scene properties such as lighting. Finally, the PLY format (developed at the Stanford Graphics Lab) supports both ASCII and binary storage.

As the most frequently used format for model archiving, we briefly describe the OBJ format. This is composed of up to four parts, two of which are required. The following snippet provides an example OBJ file:

#Vertex (x,y,z) coordinates v 0.123 0.456 0.789

v ...

...

#Texture coordinates (u,v) coordinates vt 0.500 0.600

vt ...

...

#Normals in (nx,ny,nz) form

vn 0.707 0.000 0.707

vn ...

...

# Face Definitions f 1 2 3

f 3/1 4/2 5/3

f 6/4/1 3/5/3 7/6/5 f ...

...

Comments can appear anywhere within the file and are indicated by the line beginning with a hash symbol. The file must begin with a list of 3D vertex positions. Each is entered on a separate line, starting with “v”. Then there are two optional parts: 2D texture coordinates (line begins with “vt”) and 3D vertex normals (line begins with “vn”). Texture coordinates are 2D coordinates in the range [0, 1], which index into a texture map (which is typically square). Texture coordinates are scaled by the dimensions of the texture map and color values interpolated from the pixels surrounding the scaled texture coordinate position. The vertex, texture coordinate and surface normal lists should be of the same length. Texture coordinates and normals are assigned to the vertex in the corresponding position in the vertex list. The final required part comprises face definitions. Each face definition can take four possible forms, as follows:

Vertex. A valid vertex index starts from 1 and indexes into the previously defined vertex list. Faces may have more than three vertices.