![]() [ Description | 3D formats | How to use | Requirements | Improvements | Screenshots | Download ] The latest version is mview-0.2.2 |
![]() |
Description |
The Mesh Viewer is an easy to use lightweight application to display triangular meshes from a variety of file formats (see 3D formats). It uses the OpenGL API to render the models. The program was born under the need for quickly displaying reconstructed triangulated meshes. The Mesh Viewer based on an idea and an early elementary implementation from Craig Robertson. The current version was developed by Helmut Cantzler. Triangular meshes can be displayed texture mapped (optional with bilinear filtering), solid or as a skeleton (full or just the front lines). The surface normals of the triangles can be displayed optionally. Features (from a different data file) like edges and points can be displayed into the mesh. Loaded models can be rotated, translated and scaled (all done with the mouse). The model is lighted by multiple light sources. Viewpoints can be saved. Screenshots of the model can be taken (as BMP, JPEG, PNG and so on). The program is able to calculate the texture map for the 3D model (experimental!).
3D formats |
This section describes shortly the file formats the mesh viewer is able to read. It can read:
The PMesh format begins optional with a header. The first header line consists of "#pmesh". The header ends with the first line not starting with a "#". The data starts with nv lines of the format "v float float float" for the vertices. Follows nf lines of the format "p 3 int int int" for the triangles. Each line contains the three indices of the vertices. The index of the vertices starts at one.
The GTS format is describe shortly. The first line contains three unsigned integers separated by spaces. The first integer is the number of vertices, nv, the second is the number of edges, ne and the third is the number of faces, nf. Follows nv lines containing the x, y and z coordinates of the vertices. Follows ne lines containing the two indices (starting from one) of the vertices of each edge. Follows nf lines containing the three ordered indices (also starting from one) of the edges of each face.
The Geomview formal starts with a header consisting of the format line "OFF" and a second line with three integer numbers. The first integer is the number of vertices, nv, the second is the number of polygons, np, and the third number is typically "0". Following are the nv lines of vertices (each consists of three floats). The other part of the file are np lines of polygons. The first number of each line stands for the size of the polygon. Mesh Viewer just reads polygons consisting of 2 or 3 vertices. Following are a number of indices of the vertices depending on the size of the polygon. The index of the vertices starts at zero.
VRML is only supported partly. The Mesh Viewer extracts only vertices and triangles from VRML files and ignores all other shapes. Shapes in VRML 2.0 are rotated, scaled and translated if necessary. The file name for JPEG texture and texture coordinates are read from VRML 2.0 files if existent.
The Feature file is used to store vertices and edges. A feature file can be loaded beside the mesh to display vertices or edges into the mesh. The first header line consists of "#list". The header ends with the first line not starting with a "#". The lines consists of either vertices or edges. A vertex line consists of the format "fv float float float". A edge line starts with "fe" followed by the x, y and z coordinates for the start and the end vertex.
The List file is only a text file listing n mesh files, which a loaded subsequently as different shapes into one mesh. Lists are useful for displaying a segmentation of a mesh. The first header line consists of "#list". The header ends with the first line not starting with a "#". The following n lines consists of the names for the mesh files (one per line).
Example triangular meshes can be found here:
How to use |
First, get the source code. Don't forget to check if you have all required libraries! You might need to change the first lines of the Makefile (specifying your c++ compiler and the qt, include and library paths). You can choose between a qt version (default) and a glut based version of the Mesh Viewer. The qt version is more convenient and provides more features.
To start the mesh viewer just execute "mview /path/model_file" or just "mview" on your shell. You can rotate the loaded model by using the left mouse button, the middle button is used to translate and the right button zooms into model. All feature are accessible through the menu. Short cuts to some functions are displayed in the menu.
The glut version provides a menu with the right mouse button. The middle button is used for translation and zoom. Rotation is done with the left button.
Requirements |
Mesh viewer should run under all Unix version. It was tested under Solaris and Linux. It requires:
Possible improvements and bugs |
Taking screen shots of the model doesn't work with some configuration very well. There are probably problems between early QT versions (< 2.3.2) and the X Server.
Screenshots (done with version 01-07-2001) |
Marc Pollefey's castle![]() |
Mummy from NRC Canada![]() |
Destimated Stanford bunny![]() |
Download |
Mesh Viewer is distributed under the terms of the LGPL. The changelog can be found here.
Source code: |
mview-src-0.2.2.tar.gz
(620KB) |
Comments, suggestions or bugs can be sent to Helmut Cantzler < cantzler at gmx dot net >