MESH_DISPLAY_OPENGL
Display a Polygonal Mesh Using OpenGL {#mesh_display_opengl-display-a-polygonal-mesh-using-opengl align="center"}
MESH_DISPLAY_OPENGL is a C++ program which reads the name of two data files defining a polygonal mesh, reads the data, and displays the mesh using OPENGL.
The files defining the mesh consist of one file containing the coordinates of the points, and a second file that lists the indices of the nodes making up each element. All the elements in the mesh must have the same order, that is, the number of vertices.
mesh_display_opengl prefix
where prefix is the common filename prefix:
- prefix**_nodes.txt**, the node coordinates;
- prefix**_elements.txt**, the element definitions.
reads the node data from nodes.txt, the element data from elements.txt and displays a plot of the mesh.
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
CAUSTIC_OPENGL, a C++ program which computes a caustic curve and displays it using OpenGL.
FEM_BASIS_T3_DISPLAY, a MATLAB program which displays a basis function associated with a linear triangle ("T3") mesh.
FEM_BASIS_T6_DISPLAY, a MATLAB program which reads a quadratic triangle mesh and displays any associated basis function.
FERN_OPENGL, a C++ program which uses OpenGL to display the Barnsley fractal fern.
FLOOD_OPENGL, a C program which allows a user to select a region and flood it with color, using OpenGL, by Art Wetzel.
LIFE_OPENGL, a C program which simulates a version of John Conway's "Game of Life", displaying the results using OpenGL.
LIGHTS_OUT_OPENGL, a C++ program which sets up a "Lights Out" game and allows the user to solve it, using the OpenGL graphics window.
LISSAJOUS_OPENGL, a C++ program which computes a Lissajous figure and displays it using OpenGL.
MESH_DISPLAY, a MATLAB program which reads data defining a polygonal mesh and displays it, with optional numbering.
OPENGL, C++ programs which illustrate the use of the OpenGL graphics library;
POLYGONAL_SURFACE_DISPLAY_OPENGL, a C++ program which displays a surface in 3D described as a set of polygons, using OpenGL.
ROTATING_CUBE_DISPLAY_OPENGL, a C++ program which displays a rotating color cube in 3D, using OpenGL;
SPHERE_XYZ_DISPLAY_OPENGL, a C++ program which reads XYZ information defining points in 3D, and displays a unit sphere and the points, using OpenGL.
TABLE_DELAUNAY, a C++ program which computes the Delaunay triangulation of a set of points.
TABLE_IO, a C++ library which supplies the routines used to read the TABLE file.
TABLE_VORONOI, a C++ program which computes information about the Voronoi diagram of the points.
TRI_SURFACE_DISPLAY_OPENGL, a C++ program which displays the 3D graphics information in a TRI_SURFACE file using OpenGL.
TRIANGULATION_DISPLAY_OPENGL, a C++ program which reads data defining a triangulation and creates an image using OpenGL.
TRIANGULATION_MASK, a C++ program which takes an existing triangulation and deletes triangles and their corresponding nodes as requested by the user.
TRIANGULATION_ORDER3, a directory which contains a description and examples of order 3 triangulations.
TRIANGULATION_ORDER6, a directory which contains a description and examples of order 6 triangulations.
TRIANGULATION_PLOT, a C++ program which reads data defining a triangulation and creates a PostScript image of the nodes and triangles.
XY_DISPLAY_OPENGL, is a C++ program which reads an XY file of 2D point coordinates, and displays an image of those points using OpenGL.
XYL_DISPLAY_OPENGL, a C++ program which reads XYL information defining points and lines in 2D, and displays an image using OpenGL.
XYZ_DISPLAY_OPENGL, a C++ program which reads an XYZ file of 3D point coordinates, and displays an image of those points using OpenGL.
- Edward Angel,
Interactive Computer Graphics,
A Top-Down Approach with OpenGL,
Addison-Wesley, 2000,
LC: T385.A514. - Renate Kempf, Chris Frazier, editors,
OpenGL Reference Manual,
Addison-Wesley, 1997,
LC: T385.O642. - Mason Woo, Jackie Neider, Tom Davis,
OpenGL Programming Guide,
Addison-Wesley, 1997,
LC: T385.N435. - Richard Wright, Michael Sweet,
OpenGL Superbible,
Waite Group Press, 1996,
LC: T385.W73.
- mesh_display_opengl.cpp, the source code.
ELL is an L-shaped region covered by triangles.
- ell_nodes.txt, the node coordinates.
- ell_elements.txt, the nodes that form each element.
- ell.png, a PNG image of the mesh.
RECT is a rectangular region covered by quadrilaterals.
- rect_nodes.txt, the node coordinates.
- rect_elements.txt, the nodes that form each element.
- rect.png, a PNG image of the mesh.
Q4 is a rectangular region covered by quadrilaterals, with a hole.
- q4_nodes.txt, the node coordinates.
- q4_elements.txt, the nodes that form each element.
- q4.png, a PNG image of the mesh.
HEX is a mesh of hexagons.
- hex_nodes.txt, the node coordinates.
- hex_elements.txt, the nodes that form each element.
- hex.png, a PNG image of the mesh.
- MAIN is the main program for MESH_DISPLAY_OPENGL.
- CH_EQI is true if two characters are equal, disregarding case.
- CH_TO_DIGIT returns the integer value of a base 10 digit.
- DISPLAY generates the graphics output.
- FILE_COLUMN_COUNT counts the number of columns in the first line of a file.
- FILE_ROW_COUNT counts the number of row records in a file.
- I4_MAX returns the maximum of two I4's.
- I4_MIN returns the smaller of two I4's.
- I4MAT_DATA_READ reads data from an I4MAT file.
- I4MAT_HEADER_READ reads the header from an I4MAT file.
- MESH_BASE_ZERO ensures that the element definition is zero-based.
- MYINIT initializes OpenGL state variables dealing with viewing and attributes.
- R8_MAX returns the maximum of two R8's.
- R82VEC_MAX returns the maximum value in a R82VEC.
- R82VEC_MIN returns the minimum value in a R82VEC.
- R8MAT_DATA_READ reads the data from an R8MAT file.
- R8MAT_HEADER_READ reads the header from an R8MAT file.
- S_LEN_TRIM returns the length of a string to the last nonblank.
- S_TO_I4 reads an I4 from a string.
- S_TO_I4VEC reads an I4VEC from a string.
- S_TO_R8 reads an R8 from a string.
- S_TO_R8VEC reads an R8VEC from a string.
- S_WORD_COUNT counts the number of "words" in a string.
- TIMESTAMP prints the current YMDHMS date as a time stamp.
You can go up one level to the C++ source codes.
Last revised on 29 September 2009.