Computer Graphics

Syllabus | Course Notes | OpenGL Notes | Assignment   Student Gallery 

Course Notes

Chapter 1: Computer Graphics and Its Application. [PPT][Word] by Ching-Shoei Chiang

Chapter 2: Computer Graphics Hardware and Software. [PPT][Word] by Ching-Shoei Chiang

Chapter 3: 2D Coordinate Geometry. [PPT][Word] by Ching-Shoei Chiang

Chapter 4: 2D Viewing Operations. [PPT][Word] by Ching-Shoei Chiang

Chapter 5: 3D Coordinate System. [PPT][Word] by Ching-Shoei Chiang

OpenGL Notes

The teaching course in SIGGRAPH in 2001 by Shreiner, Angel and Shreiner. [Contents][Notes]

OpenGL 0: How to include the slut.h in visual C++ 6.0? [PPT files by Yi-Min Kuo]

This chapter tells you how to include the slut.h into visual C++, ......

OpenGL 1: Your first simple program "simple.c". [simple.c by Angel][PPT files by Yi-Min Kuo]

In this program, you learn how to open a window, draw a square in the window using the following GL and GLUT functions:

    glClear, glBegin, glEnd, glFlush

    glutCreateWindow, glutDisplayFunc, glutMainLoop

OpenGL 2: A Demo Program to show you OpenGL features including smooth shading, antialiasing, texture mapping, color interpolation. [demo.c by Angel]

It is a demo program. All of the OpenGL (glut) features will be illustrated more detail in the future class.

OpenGL 3: Sierpinski Gasket. There are 3 programs for Sierpinski Gasket, including:

    (1) 2D Sierpinski Gasket generated using randomly selected Vertices and bisection. [gasket.c by Angel]

    (2) Recursive subdivision of triangle to form Sierpinske gasket. [gasket2.c by Angel]

    (3) 3D Sierpinski Gasket GL program. [gasket3D.c by Angel]

    (4) Recursive subdivision of tetrahedron to form 3D Sierpinski Gasket. [tetra.c by Angel]

You learn the following GL and GLUT functions:

    (1) glClearColor, glColor, glMatrixMode, glLoadIdentity, glOrtho2D

         glutInit, glutInitDisplayMode, glutInitWindowPosition

    (2) No new function.

    (3) glOrtho

          glutIdleFunc, glutMouseFunc

    (4) glNormal, glViewport, glEnable

         glutPostRedisplay, glutReshapeFunc

You also learn recursive techniques in (2),  how to use mouse with OpenGL to start and stop program execution in (3), how to avoid the distortion in the window in (4).  

There are references for Sierpinski Gasket on the web. I recommend the one by Paul Baurke for our undergraduate student.

OpenGL 4: Earth. THis is a program to demo the use of quad strips and triangle fans for modeling a sphere by longitude and latitiude. You should know how to parameterize a sphere. [earth.c by Angle][PPT by Yi-Min Kuo]

      Library functions: glrotate, glPolygonMode;


OpenGL 5: Square. The program illustrates the use of the glut library for interfacing with a Window System. [square.c by Angle][PPT by Yi-Min Kuo]

       Library function: glutMotionFunc;

OpenGL 6: Double buffer. Why we need the double buffering? How to handle the animation using OpenGL? This program with chapter 1 of the OpenGL Programming Guide gives you detail explanation. [double.c from Silicon Graphics]

OpenGL 7: Lines and lines stipple. This program demonstrates geometric primitives and their attributes, especially the line and line stipples. Please read the Chapter 2 of the OpenGL Programming Guide. [lines.c from Silicon Graphics

OpenGL 8: Polygon stippling. This program demonstrates polygon stippling. Please read the Chapter 2 of the OpenGL Programming Guide. [polys.c from Silicon Graphics

OpenGL 9: Model Transformation and Viewing Transformation. The program demonstrates modeling transformation glScalef() and viewing transformation gluLookAt(). [cube.c from Silicon Graphics]

    Library Function: glScalef, glMatrixMode, glFrustum; gluLookAt; glutWireCube. 

OpenGL 10: Model Transformation. This program demonstrates modeling transformations. [model.c from Silicon Graphics]

OpenGL 11: Single buffer and double buffer. This program will show two windows at the same time with single buffer and double buffer used. [single_double.c by Angle]

    Library Function: glPushAttrib, glPopAttrib, glRasterPos.

OpenGL 12: New Paints. This program teach us how to design a simple tools bar. Let user have interaction with OpengGL program. [newpaint.c][PPT by Yi-Min Kuo]

    Library Function: glutBitmapCharacter, glutBitmapWidth, glutCreateMenu, glutAddMenuEntry, glutAttachMenu, glutAddSubMenu.

OpenGL 13: Shadow. This program draws a polygon and its shadow. [shadow.c by Angle]

OpenGL 14: Sphere. This program show the display of sphere in three modes: wire frame, constant, and interpolative shading. [sphere.c by Angle]

OpenGL 15: Smooth-Shaded Triangle. This program is drawing a triangle with smooth model color. [smooth.c]

     Library Function: glShadeModel.

OpenGL 16: Using glColorMaterial. This is an interactive program that uses glColorMaterial() to change material parameters. Pressing each of the three mouse buttons changes the color of the diffuse reflection. [colormat.c]

    Library Function: glColorMaterial, glMaterial.

OpenGL 17: A Simple Bezier Curve. The program draws a cubic Bezier curve using four control points.[bezcurve.c]

    Library Function: glMap1, glEvalCoord.

OpenGL 18: Curves. This is a simple interactive curve drawing program. [curves.c by Angel]

    Library Function: glMapGrid, glEvalMesh.

OpenGL 19: Read Pixels. This program reads pixels values from display and prints out RGB. [readpixels.c by Angel]

    Library Function: glReadPixels, glReadBuffer, glPixelStore.

OpenGL 20: Blending. Blend colors to achieve such effects as making objects appear translucent. [alpha.c from Redbook]

    Library Function: glBlendFunc;

OpenGL 21: Three-Dimensional Blending: [alpha3D.c from Redbook]

OpenGL 22: Use the accumulation buffer to do full-scene antialiasing on a scene with orthographic parallel projection.[accanti.c]

OpenGL 23: Antipoly. This program draws filled polygons with antialiased edges. [aapoly.c]

OpenGL 24: Fog. This program draws 5 red spheres, each at a different z distance from the eye, in different types of fog. Pressing the f key chooses between 3 types of  fog: exponential, exponential squared, and linear.[fog.c]

OpenGL 25: Fogindex. This program draws 5 wireframe spheres, each at a different z distance from the eye, in linear fog.[fogindex.c]




Assignment 1: This OpenGL program assignment is due on March 31, 2003.

First Week (2/24):  You should understand how to download glut library. You should know how to write your first OpenGL Program (OpenGL 1).

Second Week (3/3):  You should understand what OpenGL can do for you (OpenGL 2). What is the application of Computer Graphics.

Third Week (3/10):  By understanding the construction of Sierpinski Gasket 2D & 3D(OpenGL 3) , you should know the basic structure of OpenGL. You should know how to draw points, lines and polygons. You also should understand the 2D coordinate system.

Fourth Week (3/17): You should know how a sphere can be constructed by OpenGL (OpenGL 4). You should know the sphere coordinates,. Part of the viewing operations.  

Fifth Week (3/24): You should read Chapter 2 of the Programming Guide. Please understand the above program OpenGL 6-7.  We finish the 2D viewing operation this week. 

Sixth Week (3/31): You should read Chap 3 of the Programming Guide. 

Seventh Week: (4/1): Please understand the3D scaling,  translation and rotation.  Execute the program OpenGL 9-11.

Eighth Week: (4/14): You should know how to set the visual information and light setting. Execute the program OpenGL 13, 14.

Nine Week:(4/21): Please understand how to change material parameters. Execute the program OpenGL 16.

Assignment 2: This OpenGL program assignment is due on May 15, 2003. 

Assignment 3: This OpenGL program assignment is due on June 12, 2003.

Bonus assignment: This OpenGL program assignment is due on June 15,2003.

Bonus assignment2: This OpenGL program assignment is due on June 15,2003.

Student Gallery

ID Output
Cone/Cone Intersection

Sierpinski tiling arrowhead


Sierpinski carpet


            相關書籍:             Computer Graphics using Open GL by F.S. Hill, Jr.




                                           OpenGL Programming Guide

                                           Silicon Graphic

            相關網站:      Search Engine: 後鍵入OpenGL或Computer Graphics 搜尋

                                   CG basic idea:


                                   CG Research Site: