Examples given in this page are from textbook, reference materials, and the instructor. These examples are only used for the teaching of this course.
Development Environment
C/C++ OpenGL programming is supported by major OS platforms like Windows, Linux, and Mac OS. That means, OpenGL programs are portable cross these platforms. However, in this course, we only support OpenGL program development environment on Windows OS, MinGW (64bit) C/C++ compiler, OpenGL, and freeglut libraries, VS Code IDEs. You can download the course software from cp411_software_mingw64.zip, and follow the instructions in the README.md file to set up the development environment. If you use Mac machine, it is recommended to install Windows vitual machine and then the above software.
OpenGL/Glut examples by Mark J. Kilgard
- bitfont.c, print characters and right click menu
- blender.c
- bounce.c
- Selection
- logo.c
- cube.c
- dials2.c
- dinoball.c
- evaltest.c
- fontdemo.c
- glutdino.c
- glutplane.c
- highlight.c
- lightlab.c
- mjksift.c
- mjkimage.c,provides an image data
- mjkwarp.c
- mjkimage.c, provides an image data
- movelight.c
- oclip.c
- ohidden.c
- olight.c
- oversphere.c
- reflectdino.c
- sb2db.c
- scene.c
- simple.c
- sphere.c
- splatlogo.c
- stars.c
- stenciltst.c
- stroke.c
- subwin.c
Class examples
- Code examples from textbook Hearn and Baker.
- The general Bresenham line drawing function (bresenham.cpp).
- Eclipse project archive cube.zip.
- glut_test.cpp
Set up windows
Draw a line example from Ch.2
An example of using mouse
Open example of right click submenu.
Draw with key and mouse.
Example of right click menu.
Example of picking/selecting operation. - Example for bitmap read and save
- Eclipse project archive: dinosaur polyline (from Hill & Kelly's book)
- More polyline drawing examples (from Hill & Kelly's book).
- Example with mesh objects and more camera roll, pitch and yaw functions, Eclipse project archive.
- Mesh object examples: simple barn object, bucket
- code for simple ruled surfaces
Mesh object
Texture mapping examples
GLSL
WebGL
PyOpenGL
Ray tracing
Scene description
OpenCL -- use GPU to accelerate general purpose computing.
- If you have AMD vedio card, you can download this AMD OpenCL include and library files. Follow the instructions in README.md to install and test.
- If you have NVIDIA vedio card, you can add the NVIDIS OpenCL include and library files. Follow the instructions in README.md to install and test.