XYZ_DISPLAY_OPENGL
Display 3D Points Using OpenGL
XYZ_DISPLAY_OPENGL
is a C++ program which
reads the name of a data file
containing a list of 3D point coordinates, reads the data,
and displays the points using OPENGL.
The program displays the data, and slowly rotates it.
Usage:
xyz_display_opengl data.txt
where
-
data.txt is a file containing a list of the XYZ coordinates
of the points to plot.
The program will open a window and display a plot of the points.
The image will slowly rotate. Successive mouse clicks alternate the
axis of rotation from the X, to the Y, to the Z axis and back again.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
XYZ_DISPLAY_OPENGL is available in
a C++ version.
Related Data and Programs:
FERN_OPENGL,
a C++ program which
uses OpenGL to display the Barnsley fractal fern.
SCREENSHOT_OPENGL,
a C++ program which
shows how a program using the OpenGL graphics library can save a
screenshot of the graphics being displayed.
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.
XY_DISPLAY_OPENGL,
a C++ program which
reads an XY file of 2D point coordinates, and displays
an image of those points using OpenGL.
XYZ,
a data directory which
contains some examples of 3D pointsets.
XYZ_DISPLAY,
a MATLAB program which
reads XYZ information defining points in 3D, and displays
an image in the MATLAB graphics window.
XYZF_DISPLAY_OPENGL,
a C++ program which
reads XYZF information defining points and faces in 3D, and displays
an image using OpenGL.
XYZL_DISPLAY_OPENGL,
a C++ program which
reads XYZL information defining points and lines in 3D, and displays
an image using OpenGL.
Reference:
-
Edward Angel,
Interactive Computer Graphics,
a Top-Down Approach with OpenGL,
Addison-Wesley, 2000,
ISBN: 0-201-38597-X,
LC: T385.A514.
-
Renate Kempf, Chris Frazier, editors,
OpenGL Reference Manual,
Fourth Edition,
Addison-Wesley, 2004,
ISBN: 032117383X,
LC: T385.O642
-
Mason Woo, Jackie Neider, Tom Davis,
OpenGL Programming Guide,
Addison-Wesley, 1997,
ISBN: 0-201-46138-2,
LC: T385.N435
-
Richard Wright, Michael Sweet,
OpenGL Superbible,
Third Edition,
Sams, 2004,
ISBN: 0672326019,
LC: T385.W73
-
http://www.opengl.org/
The official OpenGL site.
Source Code:
Examples and Tests:
List of Routines:
-
MAIN is the main program for XYZ_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.
-
MOUSE determines the response to mouse input.
-
MYINIT initializes OpenGL state variables dealing with viewing and attributes.
-
MYRESHAPE determines the window mapping.
-
R8_MAX returns the maximum of two R8's.
-
R8_MIN returns the minimum of two R8's.
-
R83VEC_MAX returns the maximum value in an R83VEC.
-
R83VEC_MIN returns the minimum value in an R83VEC.
-
S_LEN_TRIM returns the length of a string to the last nonblank.
-
S_TO_R8 reads an R8 from a string.
-
S_TO_R8VEC reads an R8VEC from a string.
-
SPIN_IMAGE adjusts the angle of rotation and redisplays the picture.
-
TIMESTAMP prints the current YMDHMS date as a time stamp.
-
TIMESTRING returns the current YMDHMS date as a string.
-
XYZ_DATA_PRINT prints the data for an XYZ file.
-
XYZ_DATA_READ reads the data in an XYZ file.
-
XYZ_HEADER_PRINT prints the header of an XYZ file.
-
XYZ_HEADER_READ reads the header of an XYZ file.
You can go up one level to
the C++ source codes.
Last revised on 24 August 2010.