<< Chapter < Page Chapter >> Page >
This module is part of the collection, A First Course in Electrical and Computer Engineering . The LaTeX source files for this collection were created using an optical character recognition technology, and because of this process there may be more errors than usual. Please contact us if you discover any errors.

Acknowledgements

Fundamentals of Interactive Computer Graphics by J. D. Foley and A. Van Dam, ©1982 Addison-Wesley Publishing Company,Inc., Reading, Massachusetts, was used extensively as a reference book during development of this chapter. Star locations were obtained from the share-ware program “Deep Space” by David Chandler, who obtained them from the “Skymap” database of the National Space Science Data Center.

Notes to teachers and students:

In this chapter we introduce matrix data structures that may be used to represent two- and three-dimensional images. The demonstration program shows students how to create a function file for creating images from these data structures. We then show how to use matrix transformations for translating, scaling, and rotating images. Projections areused to project three-dimensional images onto two-dimensional planes placed at arbitrary locations. It is precisely such projections that we use to get perspective drawings on a two-dimensional surface of three-dimensional objects. The numerical experiment encourages students to manipulate a star field and view it from several points in space.

Once again we consider certain problems essential to the chapter development. For this chapter be sure not to miss the following exercises: Exercise 2 in "Two-Dimensional Image Transformations" , Exercise 1 in "Homogeneous Coordinates" , Exercise 2 in "Homogeneous Coordinates" , Exercise 5 in "Three-Dimensional Homogeneous Coordinates" , and Exercise 2 in "Projections" .

Introduction

Pictures play a vital role in human communication, in robotic manufacturing, and in digital imaging. In a typical application of digital imaging, a CCD camera records a digital picture frame that is read into the memory of a digital computer. The digital computer then manipulates this frame (or array) of data in order to crop, enlarge or reduce, enhance or smooth, translateor rotate the original picture. These procedures are called digital picture processing or computer graphics . When a sequence of picture frames is processed and displayed at video frame rates (30 frames per second), then we have an animated picture.

In this chapter we use the linear algebra we developed in The chapter on Linear Algebra to develop a rudimentary set of tools for doing computer graphics on line drawings. We begin with an example: the rotation of a single point in the ( x , y ) plane.

Point P has coordinates ( 3 , 1 ) in the ( x , y ) plane as shown in Figure 1 . Find the coordinates of the point P ' , which is rotated π 6 radians from P .

Figure one is a two-dimensional cartesian graph with two line segments, P, and P' drawn out into the first quadrant. The horizontal axis is labeled x and the vertical axis is labeled y. Line segment P reaches point (3, 1). The angle from the x-axis to line segment P is labeled θ. Line segment P' reaches point (x', y'), which is a higher y-value than P and a lower x-value than P. The angle between P and P' is measured as π/6. Both lines are labeled as length r. Figure one is a two-dimensional cartesian graph with two line segments, P, and P' drawn out into the first quadrant. The horizontal axis is labeled x and the vertical axis is labeled y. Line segment P reaches point (3, 1). The angle from the x-axis to line segment P is labeled θ. Line segment P' reaches point (x', y'), which is a higher y-value than P and a lower x-value than P. The angle between P and P' is measured as π/6. Both lines are labeled as length r.
Rotating a Single Point in the ( x , y ) Plane

To solve this problem, we can begin by converting the point P from rectangular coordinates to polar coordinates. We have

r = x 2 + y 2 = 10 θ = tan - 1 ( y x ) 0 . 3217 r a d i a n .

The rotated point P ' has the same radius r , and its angle is θ + π 6 . We now convert back to rectangular coordinates to find x ' and y ' for point P ' :

x ' = r c o s ( θ + π 6 ) 10 cos ( 0 . 8453 ) 2 . 10 y ' = r s i n ( θ + π 6 ) 10 sin ( 0 . 8453 ) 2 . 37 .

So the rotated point P ' has coordinates (2.10, 2.37).

Now imagine trying to rotate the graphical image of some complex object like an airplane. You could try to rotate all 10,000 (or so) points in thesame way as the single point was just rotated. However, a much easier way to rotate all the points together is provided by linear algebra. In fact, with asingle linear algebraic operation we can rotate and scale an entire object and project it from three dimensions to two for display on a flat screen or sheetof paper.

In this chapter we study vector graphics , a linear algebraic method of storing and manipulating computer images. Vector graphics is especiallysuited to moving, rotating, and scaling (enlarging and reducing) images and objects within images. Cropping is often necessary too, although it is a littlemore difficult with vector graphics. Vector graphics also allows us to store objects in three dimensions and then view the objects from various locationsin space by using projections.

In vector graphics, pictures are drawn from straight lines.A curve can be approximated as closely as desired by a series of short, straight lines.Clearly some pictures are better suited to representation by straight lines than are others. For example, we can achieve a fairly good representation ofa building or an airplane in vector graphics, while a photograph of a forest would be extremely difficult to convert to straight lines. Many computer-aided design (CAD) programs use vector graphics to manipulate mechanical drawings. It is possible to extend these techniques to deal with some types of curves, but we will consider only straight lines for the sake of simplicity.

When the time comes to actually display a vector graphics image, it may be necessary to alter the representation to match the display device. Personal computer display screens are divided into thousands of tiny rectanglescalled picture elements , or pixels . Each pixel is either off (black) or on (perhaps with variable intensity and/or color). With a CRT display, the electron beam scans the rows of pixels in a raster pattern. To draw a line on a pixeldisplay device, we must first convert the line into a list of pixels to be illuminated. Dot matrix and laser printers are also pixel display devices, while pen plotters and a few specialized CRT devices can display vector graphicsdirectly. We will let MATLAB do the conversion to pixels and automatically handle cropping when necessary.

We begin our study of vector graphics by representing each point in an image by a vector. These vectors are arranged side-by-side into a matrix G containing all the points in the image. Other matrices will be used asoperators to perform the desired transformations on the image points. For example, we will find a matrix R , which functions as a rotation: the matrix product R G represents a rotated version of the original image G .

Questions & Answers

Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
Adin
why?
Adin
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
research.net
kanaga
sciencedirect big data base
Ernesto
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
Bharti
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
Daniel
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
Maciej
characteristics of micro business
Abigail
for teaching engĺish at school how nano technology help us
Anassong
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
NANO
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
s.
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
Tarell
what is the actual application of fullerenes nowadays?
Damian
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
Tarell
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
Virgil
is Bucky paper clear?
CYNTHIA
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
NANO
so some one know about replacing silicon atom with phosphorous in semiconductors device?
s. Reply
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Harper
Do you know which machine is used to that process?
s.
how to fabricate graphene ink ?
SUYASH Reply
for screen printed electrodes ?
SUYASH
What is lattice structure?
s. Reply
of graphene you mean?
Ebrahim
or in general
Ebrahim
in general
s.
Graphene has a hexagonal structure
tahir
On having this app for quite a bit time, Haven't realised there's a chat room in it.
Cied
what is biological synthesis of nanoparticles
Sanket Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!





Source:  OpenStax, A first course in electrical and computer engineering. OpenStax CNX. Sep 14, 2009 Download for free at http://cnx.org/content/col10685/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'A first course in electrical and computer engineering' conversation and receive update notifications?

Ask