Skip to content

Latest commit

 

History

History
119 lines (84 loc) · 4.66 KB

rotating_cube_display_opengl.md

File metadata and controls

119 lines (84 loc) · 4.66 KB

ROTATING_CUBE_DISPLAY_OPENGL
Animation with OpenGL {#rotating_cube_display_opengl-animation-with-opengl align="center"}


ROTATING_CUBE_DISPLAY_OPENGL is a C++ program which displays a cube with colored corners that slowly rotates. By clicking the left, middle, or right mouse buttons, the user can change the axis of rotation.

Usage: {#usage align="center"}

rotating_cube_display_opengl

displays the rotating cube. Successive mouse clicks alternate the axis of rotation from the X, to the Y, to the Z axis and back again.

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"}

ROTATING_CUBE_DISPLAY_OPENGL is available in a C++ version.

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

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;

POLYGONAL_SURFACE_DISPLAY_OPENGL, a C++ program which displays a surface in 3D described as a set of polygons, 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.

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

TRIANGULATION_DISPLAY_OPENGL, a C++ program which reads files defining a triangulation and displays an image using Open GL.

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"}

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

  • MAIN is the main program for ROTATING_CUBE_DISPLAY_OPENGL.
  • COLORCUBE defines the 6 faces of the color cube object.
  • DISPLAY generates the graphics output.
  • MOUSE determines the response to mouse input.
  • MYRESHAPE determines the window mapping.
  • POLYGON defines the colors, vertices and normals for a quadrilateral.
  • SPINCUBE adjusts the angle of rotation and redisplays the picture.

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


Last revised on 15 December 2008.