Computer Graphics I

Winter semester 2012/2013:


Exam: 7.II.2013, 10:15, room: 104

Exam (2nd date): 18.II.2013, 11:00, room: 104

On the second date there will be also 4 questions out of which two will require some knowledge about transformations in homogenous coordinate system and two questions requiring general knowledge about algorithms and methods from the lecture. So more or less the same as on first exam.


Basic literature in English:
  1. J.D. Foley, A. van Dam, S.K. Feiner, J.F. Hughes, Computer Graphics - Principles and Practice,  2nd edition, Addison-Wesley, Reading, Massachusetts 1992. (takze  tych samych autorow  ``Interactive Computer Graphics'',  ``Introduction to Computer Graphics'').
  2. P. Shirley, Fundamentals of Computer Graphics, A.K.Peters, Natick Massachusetts 2002.
  3. A. Glassner, Principles of Digital Image Synthesis, Morgan Kaufmann Publ., San Francisco 1995.
Other (available in library):
  1. A. Watt, 3D Computer Graphics, 2nd edition, Addison-Wesley, 1993.
  2. D.F. Rogers, Procedural Elements for Computer Graphics,   McGraw Hill 1985 (przeklad rosyjski, Mir 1989).
  3. D. Hearn, P. Baker, Computer Grphics, Prentice-Hall, Englewood Cliffs, 1986.
  4. R. Salmon, M. Slater, Computer Graphics: system and concepts, Addison-Wesley, 1987
  5. A.S. Glassner, Graphics Gems, Academic Press, Boston 1990.
  6. J. Arvo, Graphics Gems II, Academic Press, Boston 1991.
  7. D. Kirk, Graphics Gems III, Academic Press, Boston 1992.
  8. P.S. Heckbert, Graphics Gems IV, Academic Press, Boston 1994.




  • XnView  - viewer and converter of graphic files and GFL-SDK library for reading and writing multiple graphic formats.
  • GIMP  - Raster graphic editor
  • Blender  - 3D modelling program for creating, editing, rendering of 3D scenes and animations.
  • Wings3D  - simple 3D modeller


  •   (documentation)
  • Older version OpenGL books google: OpenGL redbook bluebook

OpenGL Toolkits (window opening, keyboard and mouse handling,...) :

Interface Libraries:

Local files:


Lab: Task 1 (25.X.2012)

Compile example programs which use OpenGL and GLUT libraries from
GL directory: To do it open command terminal and use the following ways:
  1. Command line GCC compiler: "gcc -lglut cube.c -o cube.glut"
    (you can also look at script ccglut)
  2. Using make: "make cube.glut"
    using Makefile
  3. Code::Blocks IDE environment: start new GLUT project.
Try to use SDL and GLFW libraries instead of GLUT: Links to simple libraries with windows/menus/events_handling interface to use with OpenGL:

Try to understand coordinates of objects. How the program reacts on window scaling and why? Can you change this ?

Lab: Task 2 (22-29.XI.2012) (late deadline: 6.XII.2012)

Using simple example with animation: tcube.c (idle function moves the ball) implement simple arkanoid game (ping-pong against the wall, see: wikipedia) for one player. Play field is ractangular and the player can move rectangular racket along bottom of the window using some keys. We keep position of the ball (can be drawn as a rectangle but smaller than in an example) and check if its y coord is not to small : than we have to check where is the racket. The ball has constant speed and bounces from the walls in the natural mirror way.

Excersises (moved to 6.XII.2012)

Excercises during lecture: solve 3 problems from list. Declare during lecture which problems you have solved.

Lab: Take 3: "A Train"

Implement in OpenGL+GLUT a program which displays 3 dimensional scene with proper colors:
  1. The scene should consists of rectangular plane in green color on which there are railway tracks (can be drawn as glBegin(GL_LINES); ... glEnd();). There is a number of trees along the track (drawn e.g. as a sphere (glutSolidSphere() on top of scaled cube glutSolidCube() ).
  2. The train consists of 3 boxes drawn as wireframe (glutWireCube()) with some wheels (spheres). you can also add a person (drawn approximately using e.g. 2-4 boxes) walking inside one carriage forwards and backwards with constant speed with respect to the train.
  3. After pressing the space key ' ' the train should start moving with constant acceleration (can be described by 3 vectors: position, speed and constant acceleration). The railway track and train movement can be along x axis.
  4. Display scene using two views changable by keypress if you can. One view should be static observer and the other one with position at the beginning of the train and view direction forward as a driver view. Make only one function to display the scene and use it twice with different views/viewports in display function.

Andrzej Ɓukaszewski (anl(at)