Skip to content

Latest commit

 

History

History
191 lines (144 loc) · 7.98 KB

polygonal_surface_display_opengl.md

File metadata and controls

191 lines (144 loc) · 7.98 KB

POLYGONAL_SURFACE_DISPLAY_OPENGL
Display a Polygonal Surface using OpenGL {#polygonal_surface_display_opengl-display-a-polygonal-surface-using-opengl align="center"}


POLYGONAL_SURFACE_DISPLAY_OPENGL is a C++ program which gets the names of the node and element files defining a polygonal surface, reads the information from the files, and displays the surface on the screen using OpenGL.

The surface is presented in rotation about the X axis. By clicking the mouse button, the axis of rotation will be advanced from X to Y to Z and back to X.

Usage: {#usage align="center"}

polygonal_surface_display prefix

where prefix is the common filename prefix, so that:

  • prefix**_nodes.txt** contains the node coordinates;
  • prefix**_elements.txt** contains indices of nodes that form the elements;

reads the information and displays an image of the polygonal surface on the screen.

Licensing: {#licensing align="center"}

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Languages: {#languages align="center"}

POLYGONAL_SURFACE_DISPLAY_OPENGL is available in a C++ version.

Related Data and Programs: {#related-data-and-programs align="center"}

BEZIER_SURFACE_DISPLAY, a MATLAB program which reads two files defining a Bezier surface and displays it.

CAUSTIC_OPENGL, a C++ program which computes a caustic curve and displays it using OpenGL.

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.

OPENGL, C++ programs which illustrate the use of the OpenGL graphics library;

OBJ_DISPLAY, a MATLAB program which reads an OBJ file defining a 3D object and displays it within MATLAB.

POLYGONAL_SURFACE, a data directory which contains examples of polygonal surface files.

POLYGONAL_SURFACE_DISPLAY, a MATLAB program which displays a surface in 3D described as a set of polygons.

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.

STLA_DISPLAY, a MATLAB program which reads an ASCII STL file and displays it.

TET_MESH_DISPLAY, a MATLAB program which reads files defining a tet mesh and displays an image within MATLAB.

TET_MESH_DISPLAY_OPENGL, a C++ program which reads files defining a tet mesh and displays an image using Open GL.

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 files defining a triangulation and displays an image using Open GL.

TRIANGULATION_ORDER1_DISPLAY, a MATLAB program which reads files defining a piecewise constant triangulation of data, and displays a corresponding 3D surface.

XY_DISPLAY_OPENGL, 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.

Reference: {#reference align="center"}

  1. Edward Angel,
    Interactive Computer Graphics, a Top-Down Approach with OpenGL,
    Addison-Wesley, 2000,
    ISBN: 0-201-38597-X,
    LC: T385.A514.

Source Code: {#source-code align="center"}

Examples and Tests: {#examples-and-tests align="center"}

SPHERE_T3 is a sphere, tiled with an 8 by 8 array of logically triangular patches.

List of Routines: {#list-of-routines align="center"}

  • MAIN is the main program for POLYGONAL_SURFACE_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 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.
  • I4MAT_TRANSPOSE_PRINT_SOME prints some of an I4MAT, transposed.
  • MESH_BASE_ZERO ensures that the element definition is zero-based.
  • MOUSE determines the response to mouse input.
  • MYINIT initializes OpenGL state variables.
  • MYRESHAPE determines the window mapping.
  • NODE_NORMAL_SET computes node normal vectors.
  • R8_MAX returns the maximum of two R8's.
  • R83VEC_MAX returns the maximum value in an R83VEC.
  • R83VEC_MIN returns the minimum value in an R83VEC.
  • R8MAT_DATA_READ reads the data from an R8MAT file.
  • R8MAT_HEADER_READ reads the header from an R8MAT file.
  • R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT, transposed.
  • 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.
  • SPINSURFACE adjusts the angle of rotation and redisplays the picture.
  • TIMESTAMP prints the current YMDHMS date as a time stamp.

You can go up one level to the C++ source codes.


Last revised on 05 December 2010.