ICS 3111 Computer
Graphics
Chapter 1 Introduction to Computer
Graphics
In this Lecture…
Introduction
2D/3D Graphics
History of CG
Graphics Pipeline
CG Primitives
CG Algorithms
Applications
Key Areas
Introduction
Graphics are visual representations on some surface,
such as a wall, canvas, computer screen, paper, or
stone to brand, inform, illustrate, or entertain
Graphic design consists of the deliberate selection,
creation, or arrangement of typography, as in a
brochure, flier, poster, web site, or book
Images are visual illusions typically produced by
optical devices; such as cameras, mirrors, lenses,
telescopes, microscopes, etc. and natural objects and
phenomena, such as the human eye or water surfaces.
A digital image is a representation of a two-
dimensional image in binary format as a sequence of
ones and zeros.
In digital imaging, a pixel (or picture element is a
single point in a raster image.
What is Computer Graphics?
Creation, Representation, Manipulation and Storage
of geometric objects (modeling) and their images
(rendering) mainly using a computer; as well as the
output of those images on screens or hardcopy
devices
Typically, the term computer graphics may
also refer to:
the various technologies used to create and
manipulate images
the sub-field of computer science which studies
methods for digitally synthesizing and
manipulating visual content
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.
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.
Modeling & Rendering
The total of everything drawn, whether
visible in the final image or not, is the scene.
In 2-D, we often think in terms of screen
positions. In 3-D, the user is usually
considered to be inside the scene.
Modeling: producing a precise description of
a scene, in terms of graphics primitives.
Primitives are pieces from which scenes are
constructed. They may include points, line
segments, polygons, bitmapped images,
various types of curves or surfaces, etc.
Rendering: producing an image based on
the model. Images are produced in a
2D computer graphics
2D computer graphics is the computer-
based generation of digital images—mostly
from two-dimensional models (such as 2D
geometric models, text, etc) and the
techniques specific to them.
The word may stand for the branch of
computer science that comprises such
techniques, or for the models themselves.
2D computer graphics
2D computer graphics are mainly used in
applications that were originally developed
upon traditional printing and drawing
technologies, such as typography,
cartography, technical drawing, advertising,
etc.
In those applications, the two-dimensional
image is not just a representation of a real-
world object, but an independent artifact with
added semantic value; two-dimensional
models are therefore preferred, because they
give more direct control of the image than 3D
computer graphics (whose approach is more
2D computer graphics
In many domains, such as desktop publishing,
engineering, and business, a description of a
document based on 2D computer graphics
techniques can be much smaller than the
corresponding digital image—often by a factor of
1/1000 or more.
This representation is also more flexible since it
can be rendered at different resolutions to suit
different output devices. For these reasons,
documents and illustrations are often stored or
transmitted as 2D graphic files.
2D computer graphics started in the 1950s,
based on vector graphics devices. These were
largely supplanted by raster-based devices in the
following decades. The PostScript language and
2D computer graphics
2D graphics models may combine geometric
models (also called vector graphics), digital
images (also called raster graphics), text to be
typeset (defined by content, font style and size,
color, position, and orientation), mathematical
functions and equations, and more.
These components can be modified and
manipulated by two-dimensional geometric
transformations such as translation, rotation,
scaling. In object-oriented graphics, the image is
described indirectly by an object endowed with a
self-rendering method—a procedure which
assigns colors to the image pixels by an arbitrary
algorithm.
Complex models can be built by combining
3D computer graphics
3D computer graphics (in contrast to 2D
computer graphics) are graphics that use a
three-dimensional representation of
geometric data (often Cartesian) that is
stored in the computer for the purposes of
performing calculations and rendering 2D
images.
Such images may be stored for viewing later
or displayed in real-time.
3D computer graphics
3D computer graphics rely on many of the
same algorithms as 2D computer vector
graphics in the wire-frame model and 2D
computer raster graphics in the final
rendered display.
In computer graphics software, the
distinction between 2D and 3D is occasionally
blurred; 2D applications may use 3D
techniques to achieve effects such as lighting,
and 3D may use 2D rendering techniques.
3D computer graphics
3D computer graphics are often referred to
as 3D models. Apart from the rendered
graphic, the model is contained within the
graphical data file. However, there are
differences.
A 3D model is the mathematical
representation of any three-dimensional
object. A model is not technically a graphic
until it is displayed.
Due to 3D printing, 3D models are not
confined to virtual space. A model can be
displayed visually as a two-dimensional image
through a process called 3D rendering, or
Subfields
Information visualization is the
interdisciplinary study of the visual
representation of large-scale collections of
non-numerical information, such as files and
lines of code in software systems, library and
bibliographic databases, networks of
relations on the internet, and so forth
Scientific visualization is an
interdisciplinary branch of science primarily
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,
3D Graphics Pipeline
The 3D computer graphics pipeline is simply
a process for converting coordinates from
what is most convenient for the application
programmer into what is most convenient for
the display hardware.
It is the foundation of real-time graphics.
Its main function is to generate, or render, a
two-dimensional image, given a virtual
camera, three-dimensional objects (an object
that has width, length, and depth), light
sources, lighting models, textures, and more.
1) 3D model coordinate systems
Applications specify vertex positions in a
coordinate system known as object space (model
space). When an artist creates a 3D model of an
object, the artist selects a convenient orientation,
scale, and position with which to place the
model's constituent vertices.
The object space for one object may have no
relationship to the object space of another object.
For example, a cylinder may have an object-space
coordinate system in which the origin lies at the
center of the base and the z direction points
along the axis of symmetry.
You represent each vertex position, whether in
object space or in one of the subsequent spaces,
2) 3D world coordinate system
After a graphics object is defined in its own
modeling coordinate system, the object is
transformed to where it belongs in the scene.
This is called the model transformation, and
the single coordinate system that describes
the position of every object in the scene is
called the world coordinate system.
In practice, graphics programmers use a
relatively small set of simple, built-in
transformations and build up the model
transformations through a sequence of these
simple transformations.
3D world coordinate system
The purpose of world space is to provide
some absolute reference for all the objects in
your scene.
How a world-space coordinate system is
established is arbitrary. For example, you may
decide that the origin of world space is the
center of your room.
Objects in the room are then positioned
relative to the center of the room and some
notion of scale (Is a unit of distance a foot or
a meter?) and some notion of orientation
(Does the positive y-axis point "up"? Is north
in the direction of the positive x-axis?).
3) 3D eye coordinate system
Also called Transformation space
Once the 3D world has been created, an
application programmer would like the freedom
to be able to view it from any location.
But graphics viewing models typically require a
specific orientation and/or position for the eye at
this stage.
For example, the system might require that the
eye position be at the origin, looking in –Z (or
sometimes +Z).
So the next step in the pipeline is the viewing
transformation, in which the coordinate system
4) 3D eye coordinate system (2)
Also called the clip space
At this point, we are ready to clip the object
against the 3D viewing volume.
The viewing volume is the 3D volume that is
determined by the projection to be used and
that declares what portion of the 3D universe
the viewer wants to be able to see.
This happens by defining how for the scene
should be visible to the left, right, bottom,
top, near, and far.
4) 3D eye coordinate system (2)
Any portions of the scene that are outside the
defined viewing volume are clipped and
discarded.
All portions that are inside are retained and
passed along to the projection step.
Clip coordinates are in the homogenous form
of <x, y, z, w>, but we need to compute a 2D
position (an x and y pair) along with a depth
value. (The depth value is for depth buffering,
a hardware-accelerated way to render visible
surfaces.)
5) 3D eye coordinate system (3)
Also called projection space .The 3D eye
coordinate system still must be converted into a
2D coordinate system before it can be placed on
a graphic device, so the next stage of the
pipeline performs this operation, called a
projection.
Imagine your eye placed somewhere in the
scene, looking in a particular direction. You do
not see the entire scene; you only see what lies
in front of your eye and within your field of view.
6) 3D eye coordinate system (4)
This space is called the viewing volume for
your scene, and it includes a bit more than
the eye point, direction, and field of view; it
also includes a front plane, with the concept
that you cannot see anything closer than this
plane, and a back plane, with the concept
that you cannot see anything farther than
that plane.
Perspective Division: Dividing x, y, and z by
w accomplishes this. The resulting
coordinates are called normalized device
coordinates
7) 2D screen coordinates
The final step is to take each vertex's
normalized device coordinates and convert them
into a final coordinate system that is measured
in pixels for x and y.
This step, is called the viewport transform and
the new coordinate space is referred to as
screen coordinates, or display coordinates,
that feeds the GPU's rasterizer. The rasterizer
then forms points, lines, or polygons from the
vertices, and generates fragments that
determine the final image.
The graphics pipeline in hardware
The rendering pipeline is mapped onto
current graphics acceleration hardware such
that the input to the graphics card (GPU) is in
the form of vertices.
These vertices then undergo transformation
and per-vertex lighting. At this point in
modern GPU pipelines a custom vertex
shader program can be used to manipulate
the 3D vertices prior to rasterization.
Once transformed and lit, the vertices
undergo clipping and rasterization resulting
in fragments. A second custom shader
program can then be run on each fragment
The graphics pipeline is well suited to the
rendering process because it allows the GPU
to function as a stream processor since all
vertices and fragments can be thought of as
independent.
This allows all stages of the pipeline to be
used simultaneously for different vertices or
fragments as they work their way through the
pipe.
In addition to pipelining vertices and
fragments, their independence allows
graphics processors to use parallel
processing units to process multiple vertices
or fragments in a single stage of the pipeline
Rendering Primitives
Models are composed of large number of geometric
primitives.
The rendering primitives typically supported in
hardware are
Points (single pixels)
Line Segments
Polygons (often restricted to convex polygons).
Modeling primitives include these, but also
Piecewise polynomial (spline) curves
Piecewise polynomial (spline) surfaces
Implicit surfaces (quadrics, blobbies, etc)
Other...
Software renderer may support modeling primitives
directly, or may convert into polygonal or linear
approximations for hardware rendering.
Algorithms
A number of basic algorithms are needed:
Transformation: Convert representations of
primitives from one coordinate system to another.
Clipping/Hidden Surface Removal: Remove
primitives and parts of primitives that are not visible
on the display.
Rasterization: Convert a projected screen-space
primitive to a set of pixels.
Picking: Select a 3D object by clicking an input
device over a pixel location.
Shading and Illumination: Simulate the
interaction of light with a scene.
Animation: Simulate movement by rendering a
sequence of frames.
Applications of Computer Graphics
Most work in today’s world is done in Graphical
Nature and All the Areas Like Business, Government
and Education are using Computers day by day so
that Graphics are become Common for displaying
information. There are following Areas which uses
Graphics Along with Some Reasons:
User interfaces :- User interface in today’s World
includes Graphical Features like Click or Select .
Now Graphics Systems Provides a Windows with a
Collection of icons for displaying information in
Pictorial Form and a user has a facility to choose
any Option which is Available for a user , and a user
just have to use Some Clicks For Performing his
Operation.
Office Automation :- Now Graphics are also used in
Many Organization for Preparing their Documents like
Sale Document, Purchase Document etc. Office
Automation Provides to Create documents which
includes information either in Text Format or in the
Form of images etc.
CAD or Computer Aided Design :- Interactive
Graphics are used in Design Components of
Automobiles Bodies, in Electronically Machines, and Air-
planes etc. With the Advent of Computer Graphics Some
Organization build their test Models Which Looks Same
like Real Model
Simulators :- Simulators are also Provides by
Computer Graphics . Simulators are used for Preparing
Animation Graphics and with the Advent of Interactive
Graphics we can also change the Attributes of a Graphic
Object Like Color and Shape of Graphic Object.
Art and Commerce :- Graphics may also used in
Business , Shopping via teletext and videotext terminals
which Provides Some Choices for Making any Sale or
Purchase.
Process Control :-As we interactive Graphics provides
Changing the State of Graphics Object. So that we can
say that Process Control Means that overall Control of
Display of Single Graphic will Depends upon the user
inputs and With the Help of Process Control a user can
change the way of information Retrieval and A user can
Control all the Movements of Graphic Object like all the
information may be Retrieved from graphics Object.
Cartography :- Graphics provides to produce
information by using Geographic Graphs, Break Points or
Relief Maps , and Examination Maps or Exploration
Maps and Oceanographic Charts. And Also Weather
Graphics and Line Graphs or Contour and Also provides
Population Varying Graphs.
Computer Graphics? Key areas
Hardware: Tools
Software: Tools
Modeling: Representing 3D objects
Rendering: Constructing 2D images from 3D
models
Imaging: Representing 2D images
Interaction: Working with 2D and 3D
graphics
Viewing Transformations
Animation: Simulating changes over time
Graphics Software
OpenGL
Java 3D
MATLAB
3D Max
Direct3D