This example demonstrates how to create several kind of MRPT's OpenGL rendering primitives and show them in a 3D window:
The latest source can be reached at: http://mrpt.googlecode.com/svn/trunk/samples/opengl_objects_demo/test.cpp
Or in your local copy, under "samples/opengl_objects_demo".