OpenGL
This page contains fundamental OpenGL tutorials and notes. All example programs are written by C++ with Code::Blocks IDE for Windows, as well as the makefiles for Linux and macOS. Each example project uses GLUT/freeglut or GLFW framework, and it includes the required header and library files in it.
To compile the source codes for Linux and macOS, use the following "make" command in the console;
make -f Makefile.linux // Linux
make -f Makefile.mac // macOS
OpenGL Pipeline has a series of processing stages in order. Two graphical information, vertex-based data and pixel-based data, are processed through the pipeline, combined together then written into the frame buffer.
OpenGL uses several 4 x 4 matrices for transformations; GL_MODELVIEW, GL_PROJECTION, GL_TEXTURE and GL_COLOR. Both geometric and image data are transformed by these matrices before OpenGL raterization process.
OpenGL doesn't explicitly define neither camera object nor a specific matrix for camera transformation. Instead, OpenGL transforms the entire scene inversely to the eye space, where a fixed camera is at the origin (0,0,0) and always looking along -Z axis.
Matrix4 class is a general purpose, stand-alone 4x4 matrix class. It can easily be integrated with OpenGL applications. It provides matrix transform routines that are equivalent to glTranslatef(), glRotatef() and glScalef().
Quaternion can be used to rotating a vector around an arbitrary axis in 3D space. This page explains the complete algebra how the rotation quaternion is converted into 4x4 matrix form for OpenGL.
Using vertex arrays reduces the number of function calls and redundant usage of shared vertices. Therefore, you may increase the performance of rendering.
Display list is one of fastest methods to render static data because OpenGL commands and the vertex data are cached in the display list and minimize data transmissions from client to server side.
Vertex buffer object (VBO) allows vertex array data to be stored in high-performance graphics memory on the server side and promotes efficient data transfer.
Vertex Array Object (VAO) allows to encapsulate vertex array states within a VAO. It eliminates OpenGL function calls to configure the states before drawing vertex arrays.
Pixel Buffer object (PBO) stores pixel data in OpenGL controlled memory and allows asynchronous DMA pixel transfer to/from GPU. The typical usages of PBO is streaming texture updates and asynchronous readback.
Framebuffer object (FBO) is a non-displayable rendering destination to provide an efficient way of render-to-texture and offscreen rendering.
Tessellation is subdividing concave polygons or self-intersecting polygons into convex polygons. The winding rules and winding numbers determine which parts of polygon are filled or not filled.
MVC (Model-View-Controller) framework is a common design framework for GUI applications. The major benefits of this MVC framework are the complete separation of OpenGL calls from Windows and the universal message router.
This page describes how to generate various spherical geometries (vertices, normals and texture coordinates) and how to draw them with OpenGL.
This page describes how to generate various cylinder and prism geometries (vertices, normals and texture coordinates) and how to draw them with OpenGL.
This page describes how to generate various cone and pyramid geometries (vertices, normals and texture coordinates) and how to draw them with OpenGL. It also explains the visual artifact at the apex point and how to fix it.
This page describes how to construct a torus and torus knot geometries (vertices, normals and texture coordinates) and how to draw a torus with OpenGL.
It contains pre-compiled 32-bit/64-bit freeglut libraries; DLLs, static library files (.a) for MinGW. It is used to develop cross-platform OpenGL applications.