Chapter 1 Computer Graphics
Chapter 1 Computer Graphics
Introduction
Computer graphics provides methods to generate images using a computer. The word “image”
should be understood in a more abstract sense here. An image can represent a realistic scene from the
real world, but graphics like histograms (statics diagram) or pie charts as well as the graphical user
interface of a software tool are also considered as images. The development of computer graphics
has made computers easier to interact with, and better for understanding and interpreting many types
of data. Developments in computer graphics have had a profound impact on many types of media
and have revolutionized animation, movies and the video game industry.
The term computer graphics has been used in a broad sense to describe "almost everything on
computers that is not text or sound". Typically, the term computer graphics refers to several different
things:
The aim of computer graphics is to produce realistic and/or useful images on a computer. For some
applications the emphasis will be on realism (e.g. special effects in films), whereas for others it will
simply be on usefulness (e.g. data visualisation)
Today, computers and computer-generated images touch many aspects of daily life. Computer
imagery is found on television, in newspapers, for example in weather reports, or for example in all
kinds of medical investigation and surgical procedures. A well-constructed graph can present
complex statistics in a form that is easier to understand and interpret. In the media "such graphs are
used to illustrate papers, reports, thesis", and other presentation material.
Many powerful tools have been developed to visualize data. Computer generated imagery can be
categorized into several different types: 2D, 3D, 4D, 7D, and animated graphics. As technology has
improved, 3D computer graphics have become more common, but 2D computer graphics are still
widely used. Computer graphics has emerged as a sub-field of computer science which studies
methods for digitally synthesizing and manipulating visual content. Over the past decade, other
specialized fields have been developed like information visualization, and scientific visualization
more concerned with "the visualization of three dimensional phenomena (architectural,
meteorological, medical, biological, etc.), where the emphasis is on realistic renderings of volumes,
surfaces, illumination sources, and so forth, perhaps with a dynamic (time) component".
1|Page
Whatever the application, the final image will be generated from some model of the scene we want to
take a picture of. For example, in Figure.1 we have a representation of a 3-D tetrahedron (the object
model), together with some model of how the scene is lit (the light sources), and we want to produce
an image on the image plane based on the position of the viewer. The object model will typically
represent the geometry of the object together with some information about what type of material it is
made of (i.e. what it looks like). Normally we consider the viewer to be a virtual camera, which
defines how the picture is taken. This process of starting with a model (often a 3-D model) of the
world and taking a picture of it with a virtual camera is known in computer graphics as rendering.
The rendering process can include many stages, such as hidden surface elimination, surface
rendering and clipping, which we will deal with throughout this course.
In the early 1960's IBM, Sperry-Rand, Burroughs and a few other computer companies existed. The
computers of the day had a few kilobytes of memory, no operating systems to speak of and no
graphical display monitors. The peripherals were Hollerith punch cards, line printers, and roll-paper
plotters. The only programming languages supported were assembler, FORTRAN, and Algol.
Function graphs and “Snoopy'' calendars were about the only graphics done.
In 1963 Ivan Sutherland presented his paper Sketchpad at the Summer Joint Computer Conference.
Sketchpad allowed interactive design on a vector graphics display monitor with a light pen input
device. Most people mark this event as the origins of computer graphics.
2|Page
introduced parametric surfaces and develop early computer aided geometric design concepts. The
earlier work of Pierre Bézier on parametric curves and surfaces also became public. Author Appel at
IBM developed hidden surface and shadow algorithms that were pre-cursors to ray tracing. The fast
Fourier transform was discovered by Cooley and Tukey. This algorithm allows us to better
understand signals and is fundamental for developing antialiasing techniques. It is also a precursor to
wavelets.
3|Page
MS-DOS was starting to rise.
4|Page
scanner, color laser printer, digital video camera, DVD, and MPEG encoder/decoder are the
peripherals one wants. The environment for program development is most likely Windows and
Linux, with Direct 3D and OpenGL, but Java 3D might become more important. Programs would
typically be written in C++ or Java.
What will happen in the near future -- difficult to say, but high definition TV (HDTV) is poised to
take off (after years of hype). Ubiquitous, untethered, wireless computing should become
widespread, and audio and gestural input devices should replace some of the functionality of the
keyboard and mouse.
You should expect 3-D modeling and video editing for the masses, computer vision for robotic
devices and capture facial expressions, and realistic rendering of difficult things like a human face,
hair, and water.
1.2. 3D Graphics Techniques and Terminology
Rendering
The process by which mathematical and image data is transformed into a 3D dimensional image is
called rendering. When used as a verb, it is the process that your computer goes through to create the
three dimensional image. Rendering is also used as a noun, simply to refer to the final image
produced.
Transformations and Projections
By transforming, or moving the points around, and drawing lines between them we can produce the
illusion of a 3D world on a flat 2D screen. The earliest flight simulators employed technology no
more sophisticated than this
By transforming, or moving the points around, and drawing lines between them we can produce the
illusion of a 3D world on a flat 2D screen. The earliest flight simulators employed technology no
more sophisticated than this.
The points themselves are called vertices (or vertex in the singular), and they are moved around in
space with a convenient mathematical construct called a transformation matrix. Another matrix, a
projection matrix takes care of the mathematics necessary to turn our 3D coordinates into two-
dimensional screen coordinates, where the final line drawing actually takes place.
Rasterization
The actual drawing, or filling in of the pixels between each vertex to make the lines is called
rasterization. We can further clarify our 3D intent with transformed and rasterized lines by
employing hidden surface removal.
5|Page
FIGURE 1.3: Hiding the back sides of solid geometry enhances the 3D illusion.
Although drawing with lines, or wireframe rendering as it is often called, has its uses, most of the
time we render not with lines, but with solid triangles. Triangles and polygons are also rasterized, or
filled in just like lines are.
6|Page
Texture Mapping
The next hardware advance was texture mapping. A texture is simply a picture that we map
to the surface of a triangle or polygon. Textures add a whole new level of realism to our rendering.
7|Page
become a very popular one because of its wide range of applications. The following sections
summarise the main categories of application.
Graphs and charts have long been used for visualising data. They are particularly widely used for
visualising relationships and trends in scientific, mathematical, financial and economic data.
Although, in principle, we do not need advanced graphics algorithms to display graphs and charts,
many modern visualisation packages use 3-D effects such as shadowing to make the graph/chart
more visually appealing. For example, Figure 1.8 shows a range of graphs and charts produced by
the free FusionCharts Lite package (http://www.infosoftglobal.com/FusionCharts/Lite). Commercial
packages are also available and include Microsoft Excel.
(a) (b)
(c) (d)
Computer-Aided Design (CAD) and Computer-Aided Drafting and Design (CADD) involve using a
computer application to enable designers to construct and visualise 3-D models. They are commonly
used in fields such as architecture, engineering and circuit design. For example, Figure 1.9 shows
two screenshots from CAD applications being used for architecture. One of the most common CAD
8|Page
applications is AutoCAD.
Computer-Aided Manufacturing (CAM) is a similar concept to CAD, except that the design
application is linked to the manufacturing process, i.e. the application will directly control, via a
hardware communication link, the machine that manufactures the object being designed.
(a) (b)
We already saw in Section 1.1 how graphics can be used for visualising data in the form of graphs
and charts. More complex, often multidimensional, datasets can also be visualised using graphics
techniques. In this case, it is often difficult to visualise such datasets without computer graphics.
These complex datasets are particularly common in science (scientific visualisation) and business
(business visualisation).
For example, Figure (a) shows a three-dimensional medical dataset of a patient. Here we use
computer graphics to visualise the paths of blood vessels inside the patient‟s head. Figure 1.10 (b)
shows an image generated from data acquired by the Hubble Space Telescope. This image of a
distant galaxy is allowing us to visualise a four-dimensional dataset – three dimensions are combined
as the red, green and blue components of an optical image, and the fourth (an X-ray image) is
displayed as overlaid contour plots. Figure 1.10 (c) shows another medical dataset, this time acquired
using a Magnetic Resonance Imaging (MRI) scanner. Computer graphics allow us to visualise this
three-dimensional dataset as three slices through the 3-D volume. Finally, Figure 1.10 (d) shows the
use of colour to visualise altitude in a map of the United States.
9|Page
(a) (b)
(c) (d)
Virtual Reality (VR) allows users to be immersed in a computer generated world, and to interact with
it as if they were interacting with the real world. Typically, the user will wear special hardware such
as the VR-headset shown in Figure 1.11(a). This allows the computer to completely control the
visual information received by the user, so if realistic computer-generated images such as that shown
in Figure 1.11(b) are displayed in the headset in stereo (i.e. different images for the left and right
eyes) the user will have a sense of physical immersion in the virtual world. In addition, other
specialised hardware such as VR-gloves can be used to interact with the „objects‟ in the virtual
world.
An alternative way of experiencing virtual reality is by using a CAVE (which stands for Cave
Automatic Virtual Environment). An example of this is shown in Figure 1.11(c). Here, the user
stands inside a cubicle which has images projected onto the walls and ceiling. Often there will also
be a means of „moving‟ in the virtual world such as pressure pads.
10 | P a g e
Augmented Reality (AR) combines a computer-generated virtual world with the real world. In AR,
computer-generated images are overlaid onto a user‟s view of the real world. For example, Figure
1.11(d) shows an AR system used for surgery, in which computer-generated images of hidden
features such as blood vessels and tumours are overlaid on the surgeon‟s view of the patient through
a surgical microscope.
(a) (b)
(c) (d)
Figure 1.11 - Computer Graphics used for Virtual Reality and Augmented Reality
Computer graphics can be very beneficial in education and training. For example, Figure 1.12(a)
shows a screenshot from some educational software that teaches students about human anatomy.
Graphics are used to help students visualise the appearance and location of different organs inside
the body.
Another common application of computer graphics is in training. In many jobs it is difficult for
workers to get direct experience of the environment that they are expected to work in. This may be
because the environment is inaccessible (e.g. space), dangerous (e.g. bomb disposal), expensive (e.g.
11 | P a g e
flying aircraft) or high-risk (e.g. surgery). Computer graphics, combined with specialised hardware,
can be used to simulate the working environment, so that workers can gain the skills required for
their work. For example, Figure 1.12(b) shows a picture of a truck-driving simulator used by the
German army to train their drivers in emergency situations; Figure 1.12(c) shows a helicopter
simulator; and Figure 1.12(d) shows a screenshot from a simulator for laser eye surgery.
(a) (b)
(c) (d)
Figure 1.12 - Computer Graphics used for Education and Training
Another possibility that has been opened up by the improvements in computer graphics technology is
in the area of user interfaces. Figure 1.13 shows the difference in visual appeal between an old text-
based user interface and a modern windows-based user interface. And the difference is not just in
visual appeal: modern user interfaces have made multitasking (doing several things at once) much
easier and applications such as word-processors have become much more powerful.
(a) (b)
Figure 1.13 - Text-Based and Graphical User Interfaces
12 | P a g e
1.7. Entertainment
The applications of computer graphics in entertainment fall into three categories: computer art,
special effects and animations, and games.
A number of artists have taken advantage of the possibilities offered by computer graphics in
producing works of art. For example, Figure 1.14(a) shows a frame from an animated artwork by
William Latham.
Computer-generated images (CGI) have been widely used in the entertainment industry for
producing special effects for films, and also for producing completely computer-generated films.
Figure 1.14(b) shows a frame from the film Final Fantasy: the Spirits Within, which featured 100%
computer-generated images. For applications such as this, highly realistic images can be produced
off-line, i.e. we do not need to generate the images in real-time, they need only be generated once,
frame-by-frame, and then combined into the desired animated sequence.
For computer games, images must be generated in real-time in response to user actions. Therefore
the graphics in games can be less realistic, since the emphasis is on speed of generation rather than
realism. Figure 1.14(c) and (d) show screenshots from the popular computer game Doom.
(a) (b)
(c) (d)
Figure 1.14 - Computer Graphics used in the Entertainment Industry
13 | P a g e