ConnectDotsModern is sample C++ code illustrating the use of
Modern OpenGL. It is
part of a set of programs introducing the
use of Modern OpenGL, which are
intended to accompany a possible second edition
of the book 3D Computer Graphics: A mathematical
approach with OpenGL, Cambridge University Press, 2003.
ConnectDotsModern shows how to take mouse clicks,
and track the mouse position. It draws straightline segments joining
points set with the mouse. It consists of a C++ source files,
ConnectDotsModern.cpp and a shader program
file ConnectDotsModern.glsl. It also
uses the GlShaderMgr routines to read, compile
and link shader programs.
To download this program:
Things to try out:
- Compile and run the program.
-
Left-click to add a point.
-
Type 'F' or 'L' to remove the first or last point.
-
Press the right mouse button and drag to select and move
vertices.
- Check out the new features of the ConnectDotsModern program:
- Reserving space in a VBO buffer. Using the glBufferSubData command
to change the contents of a portion of a VBO buffer.
- Accepting mouse input. Left-clicks add vertices.
- Tracking the mouse position. Right click, hold and drag to move
vertices.
- Depth testing with GL_LEQUAL. Used to draw vertex dots on top of lines.
-
Implement Catmull-Rom splines or Overhauser splines. (These are a common Math 155B
programming assignment.)
-
See the more detailed description of
the software and its functionality.
Version 2.1 of ConnectDotsModern, September 12, 2020.