0% found this document useful (0 votes)
67 views26 pages

Introduction to Interactive Computer Graphics

The document provides a history of the development of computer graphics from 1941 to 2013. It describes several important early milestones, such as the development of punched cards as an input method in 1941, the creation of the first graphic images using an oscilloscope in 1950, and the invention of the computer mouse in 1963. It then discusses the creation of important graphics technologies and standards throughout the decades, such as the development of CAD software in the 1970s and 1980s, the introduction of 3D graphics and digital movie effects in the 1990s, and the rising capabilities and declining costs of computer processing power for graphics over time.

Uploaded by

abdi geremew
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views26 pages

Introduction to Interactive Computer Graphics

The document provides a history of the development of computer graphics from 1941 to 2013. It describes several important early milestones, such as the development of punched cards as an input method in 1941, the creation of the first graphic images using an oscilloscope in 1950, and the invention of the computer mouse in 1963. It then discusses the creation of important graphics technologies and standards throughout the decades, such as the development of CAD software in the 1970s and 1980s, the introduction of 3D graphics and digital movie effects in the 1990s, and the rising capabilities and declining costs of computer processing power for graphics over time.

Uploaded by

abdi geremew
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Software Engineering Department, Wolkite University

CHAPTER ONE: Introduction to Interactive Computer Graphics

1.1. Introduction

Computer graphics refers to the creation, storage and manipulation of pictures and drawings using
a digital computer. With developments in computing technology interactive computer graphics has
become an effective tool for the presentation of information in such diverse fields as science,
engineering, medicine, business, industry, government, art, entertainment, advertising, education,
and training. There is virtually no field in which graphical displays cannot be used to some
advantage and that is the basic reason why application of computer graphics is so widespread.

It is a fact that one picture is worth a thousand words. Therefore, interfaces empowered with
graphics enhances the communication between the computer and its users. Representation of a
huge set of numbers in the form of a graph or a picture helps in a better understanding and
interpretation of the characteristics or pattern of the data contained in the set of numbers. Graphic
displays also improve understanding of complex systems, and visualization of two-dimensional
(2D), three-dimensional (3D) objects.

1.2. A brief history of computer graphics


1.2.1. 1941

Although the punched card was first used in 1801 to control textile looms, they were first used as
an input medium for “computing machines” in 1941. Special typewriter-like devices were used to
punch holes through sheets of think paper. These sheets could then be read (usually by optically
based machines) by computers. They were the first input device to load programs into computers.
Salustri used punched cards in 1980 in his first-year Introduction to Computing course at the
University of Toronto.

1.2.2. 1950

Ben Laposky created the first graphic images, an Oscilloscope, generated by an electronic (analog)
machine. The image was produced by manipulating electronic beams and recording them onto
high-speed film.

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 1


Software Engineering Department, Wolkite University

1.2.3. 1951

The Whirlwind computer at the Massachusetts Institute of Technology was the first computer with
a video display of real time data.

1.2.4. 1955

Light pen is introduced.

1.2.5. 1960

Although known since the 1940's, the first serious work on finite element methods of analysis is
now published. FEA allows us to test products virtually and produce results that are as accurate as
physical tests -at far less cost and time. The results of such an analysis was, back then, hundreds
of pages of numbers that humans had to interpret. These days, thanks to computer graphics, we
can literally see what would happen to our products in real-time.

1.2.6. 1961

Fil Salustriwas born. The first video game, Space-War, ran using an oscilloscope as a display.
Oscilloscopes are vector displays. Ivan Sutherland writes the first computer drawing program –
Sketch-Pad -which included things like pop-up menus. To generate one GFLOPS of processing
power with 1961 technology, you would need to spend over$8 trillion (in 2013-adjusted US
dollars).

1.2.7. 1963

Doug Engel Bart invents the computer mouse.

1.2.8. 1965

Jack Bresenham invents the “ideal” line-drawing algorithm. NASTRAN FEA software released.

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 2


Software Engineering Department, Wolkite University

1.2.9. 1970

Size of CAD market estimated at$25 million. ANSYS founded.

1.2.10. 1972

Nolan Kay Bushnell creates Pong, video arcade game. Raster displays begin to appear.
Introduction of the CT scanner.

1.2.11. 1975

K. Vesprille's PhD dissertation “Computer-Aided Design Applications of the B-Spline


Approximation Form” develops the mathematical representation of arbitrary curves suitable for
computation.

1.2.12. 1977

The Apple II is the first graphics personal computer. Star Wars is released; its only computer
effects were vector-based, and then filmed. CADAM, the first commercial 2D CAD package, is
released. McDonnell Douglas buys United Computing, forming Unigraphics.

1.2.13. 1978

First real standard for constructive solid geometry developed by H. Voelcker et al. Charles Lang
at Cambridge University develops the first real boundary representation modelling engine.

1.2.14. 1979

Size of CAD market estimated at$1billion.

1.2.15. 1981

CATIA, one of the first 3D CAD packages, is developed, using constructive solid geometry.

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 3


Software Engineering Department, Wolkite University

1.2.16. 1982

The Commodore 64 personal computer used raster graphics so that regular televisions could be
display devices. TRON is the first movie to make extensive use of computer graphics. AutoCAD
1.0 is released -it uses wireframe representation only. SDRC I-deas CAD package released.
Voelcker introduces the notion of a voxel. The Apple Lisa was a fantastic computer that failed.
The Lisa was first introduced at a cost of 9,995 US (9,995 US (20,893 in 2007 dollars). It was one
of the first commercial personal computers to have a GUI and a mouse. It used a Motorola 68000
CPU at a 5MHz clock rate and had 512 KB or 1 MB RAM. This made it a quantum leap in
technology. But it was so innovative that it was wrong2). It simulated hardware in software, so it's
very powerful CPU seemed slow to users. Also, there was no real software for it -it was in some
ways too powerful. And it was certainly too expensive.

1.2.17. 1984

To generate one GFLOPS of processing power, you would need to spend over$30 million in 2013-
adjusted US dollars. (Compare that to the 1961 data.)The original Macintosh was in many ways a
“stripped down “Lisa. It had 20% of the base memory of the Lisa, but it ran faster because it used
conventional hardware configurations. In the design of the Macintosh, Apple recognized that
computational power was only one of many aspects of computer use by humans and that if they
wanted a good design, they would have to satisfy human nature. The Macintosh set a new standard
for computer design, and for design in general. This went to the point of establishing Apple as the
“anti-IBM” (these days, the anti-PC) with a television advertisement originally aired during Super-
bowl XVIII.

1.2.18. 1985

Pixar releases Luxo, Jr.Voxel technology is embedded in most medical imaging software.

1.2.19. 1987

VGA graphics standard introduced. Pro/Engineer launched as first pure UNIX CAD software.
Everyone laughed. 18 months later, all major CAD vendors were developing CAD for UNIX.

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 4


Software Engineering Department, Wolkite University

1.2.20. 1988

CATIA selected as CAD package for Boeing 777 leading to a $1billionrevenue for Dassault.

1.2.21. 1989

SVGA graphics standard introduced. The Parasolid solid model engine standard released by
Unigraphics; it is licensed to nearly every other vendor. Tim Berners-Lee creates the very first
website ever (this is even the actual original URL). The version linked here is from 1993, as it
seems older backups have gone missing.

1.2.22. 1991

EDS buys Unigraphics.

1.2.23. 1992

All major CAD packages run on UNIX. SMEs lead the change from mainframes to high-end UNIX
workstations. IBM loses$5billionbecause no one wants mainframes any more.

1.2.24. 1993

UIUC releases Mosaic, the first web browser for general usage. Mosaic's “codename” was Mozilla.
Jurassic Park was the first big-budget CGI effects movie. First public call made from a cell phone.

1.2.25. 1994

Dragged kicking and screaming into the20th Century, Autodesk finally releases a 3D version of
AutoCAD. Key developers of the Mosaic browser found Netscape. First flight of Boeing 777,
tested entirely via ANSYS.

1.2.26. 1995

Toy Story, the first fully CGI movie, is released. Solid-works is released.MS Internet Explorer 1.0
is released.

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 5


Software Engineering Department, Wolkite University

1.2.27. 1997

To generate one GFLOPS of processing power, you would need to spend over $40,000 2013
adjusted US dollars.

1.2.28. 1998

The Mozilla Foundation is created out of the remains of the Netscape.

1.2.29. 2000

To generate one GFLOPS of processing power, you would need to spend about $1,000 2013-
adjusted US dollars. Sketch up, the first web-based CAD system, is released.

1.2.30. 2001

Final Fantasy movie is released. Rendering tears and water are now possible; the movement of
hair still unrenderable. EDS buys SDRC; Unigraphics and I-deas CAD packages merged to form
NX.

1.2.31. 2003

Doom graphics engine for games. ANSYS acquires CFX -computational fluids now begins to
become popular.Mozilla.org is registered as a non-profit organization.

1.2.32. 2006

Google acquires Sketchup.

1.2.33. 2008

Mozilla.org opens an office in Toronto.

1.2.34. 2009

The state of the art of computer graphics, as of 2009, is summarized in this short video.

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 6


Software Engineering Department, Wolkite University

1.2.35. 2010

Computations fluids and fluid structure interactions now possible on laptop PCs.

1.2.36. 2011

One GFLOPS of processing power costs about $1.80.

1.2.37. 2012

Here's a summary of the state of the art in computer graphics, as of 2012, courtesy SIGGRAPH.

1.2.38. 2013

One GFLOPS of processing power costs about$0.16. That's about100 trillion times cheaper than
in 1961 (when Fil Salustri was born).It is now possible to create, on virtually any home computer,
the kind of computer graphics that would have been unimaginable even just 10 years ago.

1.2.39. 2014

It's getting so easy to do interesting things with cheap computers -like a typical laptop -that
developers are now starting to take advantage of mistakes in rendering as the foundation of new
games, like this one by Pillow Castle, called The Museum of Simulation Technology. Also, we
have gotten much better at digitizing real things and turning them into other things.

1.2.40. 2015

We're now getting into a period where “big data” is being used to construct animations that show
us things we could not otherwise see/appreciate, like time-lapse changes in large structures. You
can see more of 2015's best graphics research here. Another new trend is the use of animation in
UI design on mobile computing.

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 7


Software Engineering Department, Wolkite University

1.2.41. 2016

With enough preparation, we can now animate by mapping from a source to a target in real time.
(With sometimes hilarious results.)The last 10-15 years of CAD have mostly been about product
lifecycle management which is much more than just CAD. CAD developments themselves have

been relatively minor.

1.2.42. 2018

It is now possible to do fascinating and “realistic” graphics on phones. For instance: We can also
now generate entirely CGI-based human faces in real time.

1.3. Graphics techniques and terminologies

Graphics terminologies are the terms used during the rendering. There also processes or techniques
that are used during rendering. So let us see them in detail!

1.3.1. 3D graphics terminologies

The process by which mathematical and image data is transformed into a 3D or 2D dimensional
image is called rendering. When used as a verb, it is the process that your computer goes through
to create the two or three dimensional image. Rendering is also used as a noun, simply to refer to
the final image produced. Rendering is the process involved in the generation of a two-dimensional
or three-dimensional image from a model by means of application programs. Rendering is mostly
used in architectural designs, video games, and animated movies, simulators, TV special effects
and design visualization. The techniques and features used vary according to the project.
Rendering helps increase efficiency and reduce cost in design. There are two categories of
rendering: pre-rendering and real-time rendering. The striking difference between the two lies
in the speed at which the computation and finalization of images takes place.

Real-Time Rendering: The prominent rendering technique using in interactive graphics and
gaming where images must be created at a rapid pace. Because user interaction is high in such

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 8


Software Engineering Department, Wolkite University

environments, real-time image creation is required. Dedicated graphics hardware and pre-
compiling of the available information has improved the performance of real-time rendering.

Pre-Rendering: This rendering technique is used in environments where speed is not a concern
and the image calculations are performed using multi-core central processing units rather than
dedicated graphics hardware. This rendering technique is mostly used in animation and visual
effects, where photorealism needs to be at the highest standard possible.

Transformation is the process of introducing changes in the shape size and orientation of the
object using scaling rotation reflection shearing & translation etc. In general, transformation means
changing some graphics into something else by applying rules.

The process of converting the description of objects from world coordinates to viewing coordinates
is known as projection. The production of the 2D display of the 3D scene is called projection. The
plane in the area into which we transform (project) objects is called the 'Table'.

In computer graphics “rasterization” is the process through which a vectorial image (in which the
image is recorded as a set of curves and hence is size-independent) is transformed in a bitmap
image (which is size-dependent). This is usually done for output on a video screen or for printing.
The actual drawing, or filling in of the pixels between each vertex to make the lines is called
rasterization.

Texture mapping is a graphic design process in which a two-dimensional (2-D) surface, called a
texture map, is "wrapped around" a three-dimensional (3-D) object. Thus, the 3-D object acquires
a surface texture similar to that of the 2-D surface. Texture mapping is the electronic equivalent of
applying wallpaper, paint, or veneer to a real object. A texture is simply a picture that we map to
the surface of a triangle or polygon. Textures are fast and efficient on modern hardware, and a
single texture can reproduce a surface that might take thousands or even millions of triangles to
represent otherwise.

Blending allows us to mix different colors together. Blending is a term used often in art,
particularly in painting and drawing. It is the technique of gently intermingling two or more colors

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 9


Software Engineering Department, Wolkite University

or values to create a gradual transition or to soften lines. As an artist, it's important to practice
blending in any medium you choose to work with.

That is pretty much computer graphics in a nut shell. Solid 3D geometry is nothing more than
connecting the dots between vertices and then rasterizing the triangles to make objects solid.
Transformations, shading, texture, and blending: Any computer rendered scene you see in a movie,
video game, or scientific simulation is made up of nothing more than various applications of these
four things.

Scan Conversion is the process of converting basic, low level objects into their corresponding
pixel map representation.

1.3.2. Graphics techniques

Typically graphics packages allows user to specify which part of the defined picture is to be display
and where that part is to be placed on the display devices. Any convenient Cartesian coordinate
system, referred to as the world coordinate reference frame, can be used to define the picture. For
a 2D picture, a view is selected by specifying the sub-area of the total picture area. A user can
select single area for display or several areas could be selected for simultaneous display or for an
animated panning sequence across a scene. The picture parts within the selected areas are mapped
onto the specified areas of the device coordinates. When multiple view areas are selected, these
areas can be placed in separate display locations, or some areas could be inserted into other, larger
display areas. Transformation from world to device coordinates involve translation, rotation,
rotation and scaling operations, as well as procedures for deleting those parts of the picture that
are outside the limits of the selected display areas.

A world-coordinate area selected for display is called a window. In computer graphics, a window
is a graphical control element. It consists of a visual area containing some of the graphical user
interface of the program it belongs to and is framed by a window decoration. A window defines a
rectangular area in world coordinates. You can define the window to be larger than, the same size
as, or smaller than the actual range of data values, depending on whether you want to show all of
the data or only part of the data. The window defines what is to be viewed.

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 10


Software Engineering Department, Wolkite University

An area on a display device to which a window is mapped is called a viewport. A viewport is a


polygon viewing region in computer graphics. The viewport is an area expressed in rendering
device-specific coordinates, e.g. pixels for screen coordinates, in which the objects of interest are
going to be rendered. A viewport defines in normalized coordinates a rectangular area on the
display device where the image of the data appears. You can have your graph take up the entire
display device or show it in only a portion, say the upper-right part. The viewport defines where it
is to be displayed.

Window-To-Viewport Coordinate transformation

Mapping of a part of the world coordinate scene to device coordinate is simply referred to as a
viewing transformation. Sometimes the 2D viewing transformation is referred to as the window to
viewport transformation or the windowing transformation. If a coordinate position is at the center
of viewing window, for instance, it will be displayed at the center of the viewport.

Figure 1.1. Window to view port transformation

If (xwmin, ywmin) and (xwmax, ywmax) are bottom-left and top-right corners of the window and
if (xvmin, yvmin) and (xvmax, yvmax) are those for the viewports then the window to viewport
scaling transformation is given by:

Sx= (xvmax-xvmin)/ (xwmax-xwmin), Sy = (yvmax-yvmin)/ (ywmax-ywmin). Where sx and sy


are the scaling factor along x and y axes respectively.

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 11


Software Engineering Department, Wolkite University

Example: Consider a window with (2, 3) and (6, 8) are bottom-left corner and top-right corners
coordinated and (1, 2) and (4, 5) are those for a viewport. Find the value of the scaling factors that
are needed to transform the given window into viewport.

Solution: for our given example

Xwmin=2, Ywmin=3, Xwmax=6, Ywmax=8 Xvmin=1, Yvmin=2, Xvmax=4, Yvmax=5

We know that scaling factor

Sx= (Xvmax-Xvmin)/ (Xwmax-Xwmin)

Sx= (4-1)/ (6-2) =3/4 And

Sy= (Yvmax-Yvmin)/ (Ywmax-Ywmin)

Sy= (5-2)/ (8-3) =3/5

Clipping

Generally, any procedure that identifies those portion of picture that are either inside or outside of
specified region of space is referred to as a clipping algorithm or simply clipping. The region
against which an object is clipped is called a clip window.

For the viewing transformation, we want to display only those picture parts that are within the
window area. Everything outside the window is discarded. Clipping algorithms can be applied in
the coordinates, so that only the contents of the window interior are mapped to device coordinates.
Following three situations may occur:

Case 1: The object may be completely outside the window.

Case 2: The object may be seen partially i.e., some part of it may lie outside the window.

Case 3: The object may be completely seen within the window.

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 12


Software Engineering Department, Wolkite University

The process of clipping eliminates the portion of the object which does not contribute to the final
image. For the above case it can be clearly seen that case 1 and case 2 demand clipping while in
case 3 no clipping is needed.

Point Clipping

Assuming that the clip window is rectangle in standard position, we save a point P (x, y) for display
if the following inequalities are satisfied:

Xwmin <= x <= Xwmax

Ywmin <= y <= Ywmax

If any one of these four inequalities is false, the point is outside the window and it is not displayed.

Line Clipping

Figure 1.2. Line segments category

All line segments fall into one the following clipping categories:

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 13


Software Engineering Department, Wolkite University

1. Visible: Both end points of the line lie within the window.
2. Invisible: The line lies outside the window.
3. Partially visible (or clipping candidate): A line is partially visible when some part of it lies
within window.

Cohen-Sutherland Line Clipping Algorithm

This is one of the oldest and most popular line-clipping procedures. It is an efficient procedure for
determining the category of line segment. The algorithm proceeds in three steps:

Step 1: Assign a four bit code to each end point of the line. The end point lies in one of the above
nine regions of the plane shown in the above picture.

4-bit code is assigned as

Bit 4 Bit 3 Bit 2 Bit 1


Top Bottom Right Left

Starting from the left most bit, each bit of the code is set to 0 or 1 as per the following rule:

 Bit-1 is set to 1 if point 'P' lies to the left of the window.


 Bit-2 is set to 1 if point 'P' lies to the right of the window.
 Bit-3 is set to 1 if point 'P' lies to the bottom of the window.
 Bit-4 is set to 1 if point 'P' lies to the top of the window.

A point with region code 0000 is inside the window.

Step 2: The line is visible if both endpoint region codes are 0000, not visible if the logical AND
(bit by bit multiplication) of the region codes is not 0000, and the line is candidate for clipping if
the logical AND of the end point region code is 0000.

Step 3: If the line is candidate for clipping, find the intersection of the line with the four boundaries
of the window and check the visible portion of the line.

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 14


Software Engineering Department, Wolkite University

Example 1: Given a clipping window A (5, 5), B (15, 5), C (15, 20), D (5, 20). Using Cohen-
Sutherland line clipping algorithm, find the visible portion of line with end points P (7, 7) and Q
(12, 18).

Solution 1: End point region code of P is 0000. And end point region code of Q is also 0000. Since
both end points region codes are (0000), the line is completely visible. The visible portion of the
line is from P (7, 7) to Q (12, 18).

Example 2: Given a clipping window A (5, 5), B (15, 5), C (15, 20), D (5, 20). Using Cohen-
Sutherland line clipping algorithm, find the visible portion of line with end points P (3, 10) and Q
(3, 20).

Solution 2: point region code of P is 0001. And end point region code of Q is also 0001. The line
is not completely visible. Now we have to test whether the line is partially visible or not. To do
this we need to find the logical AND (bit by bit multiplications of both end points region codes.

0001

Logical AND 0001

0001

Conclusions: Since the result is not 0000, the line is totally invisible.

Example 3: Given a clipping window A (5, 5), B (20, 5), C (20, 15), D (5, 15). Using Cohen-
Sutherland line clipping algorithm, find the visible portion of line with end points P (3, 7) and Q
(15, 20).

Solution 3: point region code of P is 0001. And end point region code of Q is also 1000.

Since both end points region codes are not (0000), the line is not completely visible. Now we have
to test whether the line is partially visible or not. To do this we need to find the logical AND (bit
by bit multiplications) of both end points region codes.

0001

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 15


Software Engineering Department, Wolkite University

Logical AND 1000

0000

Since the result is 0000, the line may be partially visible. We can use the following equation to
find the equation of the given line:

y -y1 = (y2 -y1) (x -x1)

x2 -x1

After substituting the values of (x1, y1) and (x2, y2), we get

y -7 = (20 -7) (x -3)

15 -3

y -7 = 13(x -3)

12

12y -84 = 13x -39

13x -12y = -45

Above equation is the equation of the given line.

(1) Intersection of line with left edge (x =5) of the window.

13 * 5 -12y= -45

y = 110/12 = 9.16 = 9 (which is greater than yw min (5) and less than ywmax (15) and hence this
intersection point is accepted.

(2) Intersection of line with the right edge (x =20) of the window

13 * 20 -12y = -45

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 16


Software Engineering Department, Wolkite University

y = 305/12 = 25.41 = 25 (which is greater than yw max (15) and hence intersection point is rejected.

(3) Intersection of the line with the bottom edge (y =5) of the window

13x -12*5 = -45

x =15/13= 1.15=1(which is less than xw min (5) hence intersection point is rejected.

(4) Intersection of the line with the top edge (y =15)

13x -12 * 15 = -45

x = 135/13 =10.38=10 (which is greater than xw min (5) and less than xwmax (20) and hence the
intersection point is accepted.

Conclusion: Since the two intersection points are accepted the visible portion of the line is from
(5, 9) to (10, 15).

Midpoint Subdivision Line clipping algorithm

An alternative to finding intersection points by equation solving is based on bisection method of


numerical analysis. The line segment is divided at its midpoint into two smaller line segments. The
clipping categories of the new line segments are then determined. Each segment in category 3 is
divided again into smaller segments and categorized. The bisection and categorization process
continues until all segments are in category 1(visible) or category 2 (invisible). The midpoint
coordinates (xm, ym) of a line segment joining P1(x1, y1) to P2(x2, y2) are given by:

xm = x1 + x2

ym = y2 +y1

The algorithm is formalized in the following three steps:

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 17


Software Engineering Department, Wolkite University

For each end point:

Step 1: If the end point is visible, then process is complete. If not, continue.

Step 2: If the line is trivially invisible, no output is generated. The process is complete. If not,
continue.

Step 3: divide the line P1P2 at its midpoint Pm. Apply the previous tests to the two segments
P1Pm and PmP2. If PmP2 is rejected as trivially invisible, the midpoint is an overestimation of
the furthest visible point. Continue with P 1Pm. otherwise the midpoint is an underestimation of
the furthest visible point. Continue with P2Pm. If the segment becomes so short that the midpoint
corresponds to the accuracy of the machine or, as specified to the end points, evaluate the visibility
of the point and the process is complete. Note: Midpoint algorithm uses only integer value.

Example 4: Given clipping window A(0,0), B(40,0), C(40,0), D(0,40). Using midpoint
subdivision line clipping algorithm, find the visible portion, if any, of the line with endpoints P (-
10, 20) and Q (50, 10).

Solution 4: Region code of P is (0001) and region code of Q is (0010).

Since both endpoints region codes are not (0000), the line is not completely visible. Now we have
to test whether the line is partially visible or not. To do this we need to find the logical AND (bit
by bit multiplication) of both end points region codes.

0001

Logical AND 0010

0000

Since the result is 0000, the line may be partially visible.

Midpoint is:

xm= x1 + x2=-10 +50=20

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 18


Software Engineering Department, Wolkite University

2 2

ym= y2 +y1= 20+10= 15

2 2

End point region code for midpoint (xm , ym) is (0000). Neither segment PP m nor PmQ is either
totally visible or trivially invisible. Let us keep segment PPm for latter procession, and we continue
with PmQ. This subdivision process continues until we find the intersection point with window
edge i.e.(40, y). Following table shows how the subdivision continues:

Table 1.1. Midpoint line clipping

Conclusion: Visible portion of line segment PQ is from (0, 17) to (40, 11).

1.4. Application of Computer Graphics

Computers have become a powerful tool for the rapid and economical production of pictures.
There is virtually no area in which graphical displays cannot be used to some advantage, and so it
is not surprising to find the use of computer graphics so widespread. Although early applications
in engineering and science had to rely on expensive and cumbersome equipment, advances in
computer technology have made interactive computer graphics a practical tool. Today, we find

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 19


Software Engineering Department, Wolkite University

computer graphics used routinely in such diverse areas as science, engineering, medicine,
business, industry, government, art, entertainment, advertising, education, and training.

1.4.1. Computer Aided Design

A major use of computer graphics is in design processes, particularly for engineering and
architectural systems, but almost all products are now computer designed. Generally referred to as
CAD, computer-aided design methods are now routinely used in the design of buildings,
automobiles, aircraft, watercraft, space- craft, computers, textiles, and many, many other products.
For some design applications; objects are first displayed in a wireframe out- line form that shows
the overall sham and internal features of objects. Wireframe displays also allow designers to
quickly see the effects of interactive adjustments to design shapes.

Figure 1.3. 3D Architecture

1.4.2. Presentation graphics

Another major application area is presentation graphics, used to produce illustrations for reports
or to generate 35-mm slides or transparencies for use with projectors. Presentation graphics is
commonly used to summarize financial, statistical, mathematical, scientific, and economic data
for research reports, managerial reports, consumer information bulletins, and other types of
reports. Workstation devices and service bureaus exist for converting screen displays into 35-mm

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 20


Software Engineering Department, Wolkite University

slides or overhead transparencies for use in presentations. Typical examples of presentation


graphics are bar charts, line graphs, surface graphs, pie charts, and other displays showing
relationships between multiple parameters.

Figure 1.4. Pie chart information presentation

1.4.3. Computer Art

Computer graphics methods are widely used in both fine art and commercial art applications.
Artists use a variety of computer methods, including special-purpose hardware, artist's paintbrush
(such as Lumens), other paint packages (such as PixelPaint and SuperPaint), specially developed
software, symbolic mathematics packages (such as Mathematica), CAD packages, desktop
publishing software, and animation packages that provide facilities for designing object shapes
and specifying object motions.

Figure 1.5. Computer art

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 21


Software Engineering Department, Wolkite University

1.4.4. Entertainment

Computer graphics methods am now commonly used in making motion pictures, music videos,
and television shows. Sometimes the graphics scenes are dis- played by themselves, and sometimes
graphics objects are combined with the ac- tors and live scenes. Game industry focus on
interactivity, cost effective solutions and avoiding computation and other risks.

Figure 1.6. Graphics entertainment

1.4.5. Education and Training

Figure 1.7. Color-coded diagram used to explain the operation of a nuclear reactor. (Courtesy of
Las Alamos National laboratory.)

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 22


Software Engineering Department, Wolkite University

Computer-generated models of physical, financial, and economic systems are often used as
educational aids. Models of physical systems, physiological systems, population trends, or
equipment, such as the color-coded diagram in Fig. 1.7 above, can help trainees to understand the
operation of the system.

For some training applications, special systems are designed. Examples of such specialized
systems are the simulators for practice sessions or training of ship captains, aircraft pilots, heavy-
equipment operators, and air traffic control personnel. Some simulators have no video screens; for
example, a flight simulator with only a control panel for instrument flying. But most simulators
provide graphics screens for visual operation.

1.4.6. Visualization

Scientists, engineers, medical personnel, business analysts, and others often need to analyze large
amounts of information or to study the behavior of certain processes. Numerical simulations
carried out on supercomputers frequently pro- duce data files containing thousands and even
millions of data values. Similarly, satellite cameras and other sources are amassing large data files
faster than they can be interpreted. Scanning these large sets of numbers to determine trends and
relationships is a tedious and ineffective process. But if the data are converted to a visual form, the
trends and patterns are often immediately apparent. Figure 1.8 shows an example of a large data
set that has been converted to a color-coded display of relative heights above a ground plane. Once
we have plotted the density values in this way, we can see easily the overall pattern of the data.
Producing graphical representations for scientific, engineering, and medical data sets and
processes is generally referred to as scientific visualization. And the term business visualization is
used in connection with data sets related to commerce, industry, and other nonscientific areas.

There are many different kinds of data sets, and effective visualization schemes depend on the
characteristics of the data. A collection of data can contain scalar values, vectors, higher-order
tensors, or any combination of these data types. And data sets can be two-dimensional or three-
dimensional. Color coding is just one way to visualize a data set. Additional techniques include
contour plots, graphs and charts, surface renderings, and visualizations of volume interiors. In

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 23


Software Engineering Department, Wolkite University

addition, image processing techniques are combined with computer graphics to produce many of
the data visualizations.

Mathematicians, physical scientists, and others use visual techniques to analyze mathematical
functions and processes or simply to produce interesting graphical representations.

Figure 1.8. A color-coded plot with 16 million density points of relative brightness observed for
the Whirlpool Nebula reveals two distinct galaxies. (Courtesy of Lar Alamos National
Laboratory.)

1.4.7. Image Processing

Although methods used in computer graphics and Image processing overlap, the two areas are
concerned with fundamentally different operations. In computer graphics, a computer is used to
create a picture. Image processing, on the other hand, applies techniques to modify or interpret
existing pictures, such as photographs and TV scans. Two principal applications of image
processing are (1) improving picture quality and (2) machine perception of visual information, as
used in robotics.

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 24


Software Engineering Department, Wolkite University

To apply image processing methods, we first digitize a photograph or other picture into an image
file. Then digital methods can be applied to rearrange picture parts, to enhance color separations,
or to improve the quality of shading.

Medical applications also make extensive use of image processing techniques for picture
enhancements, in tomography and in simulations of operations. Tomography is a technique of X-
ray photography that allows cross-sectional views of physiological systems to be displayed. Both
computed X-rav tomography (CT) and position emission tomography (PET) use projection
methods to reconstruct cross sections from digital data. These techniques are also used to monitor
internal functions and show cross sections during surgery. Other medical imaging techniques
include ultrasonics and nuclear medicine scanners. With ultrasonics, high-frequency sound waves,
instead of X-rays, are used to generate digital data. Nuclear medicine scanners collect digital data
from radiation emitted from ingested radionuclides and plot color-coded images.

Image processing and computer graphics are typically combined in many applications. Medicine,
for example, uses these techniques to model and study physical functions, to design artificial limbs,
and to plan and practice surgery. The last application is generally referred to as computer-aided
surgery. Two-dimensional cross sections of the body are obtained using imaging techniques. Then
the slices are viewed and manipulated using graphics methods to simulate actual surgical
procedures and to try out different surgical cuts.

1.4.8. Graphics User Interfaces

It is common now for software packages to provide a graphical interface. A major component of
a graphical interface is a window manager that allows a user to display multiple-window areas.
Each window can contain a different process that can contain graphical or no graphical displays.
To make a particular window active, we simply click in that window using an interactive pointing
device.

Interfaces also display menus and icons for fast selection of processing options or parameter
values. An icon is a graphical symbol that is designed to look like the processing option it
represents. The advantages of icons are that they take up less screen space than corresponding

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 25


Software Engineering Department, Wolkite University

textual descriptions and they can be understood more quickly if well designed. Menus contain lists
of textual descriptions and icons.

Computer Graphics; Chapter One: Introduction; By Mekuria Gemechu 26

You might also like