0% found this document useful (0 votes)
26 views

A Practical Introduction To Computer Gra

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)
26 views

A Practical Introduction To Computer Gra

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
You are on page 1/ 8

A Practical Introduction to Computer Graphics

Macmillan Computer Science Series

Consulting Editor
Professor F. H. Sumner, University of Manchester

S. T. Allworth, Introduction to Real-time Software Design


lan O. Angell, A Practicallntroduction to Computer Graphics
G. M. Birtwistle, Discrete Event Modelling on Simula
T. B. Boffey. Graph Theory in Operations Research

Richard Bornat, Understanding and Writing Compilers


J. K. Buckle, The lCL 2900 Series
J. K. Buckle, Software Configuration Management
Robert Cole, Computer Communications
Derek Coleman, A Structured Programming Approach to Data*
Andrew J. T. Colin, Fundamentals of Computer Science
Andrew J. T. Colin, Programming and Problem-solving in Algol 68*
S. M. Deen, Fundamentals of Data Base Systems *
J. B. Gosling, Design of Arithmetic Units for Digital Computers

David Hopkin and Barbara Moss, Automata*


Roger Hutty, Fortran for Students
Roger Hutty, Z80 Assembly Language Programming for Students
H. Kopetz, Software Reliability

Graham Lee, From Hardware to Software: and introduction to computers


A. M. Lister, Fundamentals of Operating Systems, second edition *
G. P. McKeown and V. J. Rayward-Smith, Mathematics for Computing
Brian Meek, Fortran, PLII and the Algols
Derrick Morris and Roland N. Ibbett, The MU5 Computer System
John Race, Case Studies in Systems Analysis
Peter J. L. Wallis! Portable Programming
I. R. Wilson and A. M. Addyman, A Practicallntroduction to Pascal

* The titles marked with an asterisk were prepared during the Consulting: Editorship of
Professor J. S. Rohl, University ofWestern Australia.
A Practical Introduction
to Computer Graphics

lan O. AngeH
Department 01 Statistics and Computer Science,
Royal Holloway College,
University 01 London

M
MACMILLAN
© lan O. Angell 1981

All rights reserved. No reproduction, copy or transmission


of this publication may be made without written permission.
No paragraph of this publication may be reproduced, copied
or transmitted save with written permission or in accordance
with the provisions of the Copyright Act 1956 (as amended).
Any person who does any unauthorised act in relation to
this publication may be liable to criminal prosecution and
civil claims for damages.

First published 1981,


Reprinted 1982 (twice), 1983 (three times), 1984, 1985

Published by
Higher and Further Education Division
MACMILLAN PUBLISHERS LTD
Houndmills, Basingstoke, Hampshire RG21 2XS
and London
Companies and representatives
throughout the world

ISBN 978-0-333-31083-0 ISBN 978-1-349-16592-6 (eBook)


DOI 10.1007/978-1-349-16592-6
Contents

Preface vii

1. An Informal Introduction to Two-dimensional Graphics

2. An Introduction to Two-dimensional Geometry 11

3. Transformations of Two-dimensional Space; Matrix Representation 23

4. Clipping and Covering 32

5. The Coordinate Geometry of Three-dimensional Space 42

6. Matrix Transformation of Three-dimensional Space; Orthographie


Projections 56

7. Perspective and Stereoscopie Views 74

8. Hidden Line A1gorithms 84

9. Setup Techniques 97

10. Computer Movies 111

11. Projects 127

12. Conclusion: What Next? 138

Index 143
Preface

Until recently, all but the most trivial computer graphics was the province of
specialised research groups. Now with the introduction of reasonably priced
graphics devices, the subject will reach many more users and its full potential
can be realised. Computer-produced pictures always impress the layman, and the
'mysterious' techniques used for drawing them have gained a (false) reputation
for complexity.
This book, as its title implies, is a practical first step in understanding the
methods of computer graphics. After studying the contents and implementing
the examples and exercises, the reader will be ready to attempt most tasks in
graphics, whether these be the production of elementary data graphs, pie charts,
etc., the drawing of patterns or diagrams for books, pamphlets or as teaching
aids (all the diagrams in this book were drawn by computer) or the development
of far more sophisticated design and technical drawing programs used in the
aeronautics, automobile and other industries. Hints on how to tackle some of
these sophisticated programs are also given.
It is assumed that the reader has an elementary knowledge of the Fortran IV
programming language, and of cartesian coordinate geometry. This knowledge
will be used to produce simple diagrams, and to produce the basic programming
tools and routines required for the more 'complicated' designs. Then, hopefully,
the reader will be inspired to seek a greater understanding of geometry and also
to read more advanced works on computer graphics and to use the commercially
available packages.
This book was designed to be completely self-contained, therefore no
references are given. The contents reflect what I consider to be the logical
development of the basic concepts in computer graphics, produced independently
of the preconceived ideas of other authors, although standard terminology is used
where appropriate.
The only way to understand any branch of computer science complete:y is to
study and write a large number of programs ; this is why the format of this book
is that of 'understanding through worked examples'. The chapters are cent red
around numerous examples and the ideas that lead from them. Many students
readily understand the theory behind graphics, but they have great difficulty in
implementing the ideas. Hence great emphasis is placed on the program listings;
over seventy program segments are given - some quite substantial. Total under-
standing will only be achieved by running these programs and experimenting
viii Pre/ace

with them. The prograrns can be thought of as an embryonic graphics package,


but most importantly they are the means of describing the algorithrns required
in the solution of the given problems. They are readily translatable into other
computer graphics languages such as Pascalor Basic. The routines described were
devised for use with both Tektronix Interactive Graphics Consoles and microftlm,
but again they can be made to run on any graphics system, be they paper plotters,
other 'scopes, etc., with a minimum of thought.
The figures drawn are deliberately kept simple in order that the description of
the detail in scenes should not obscure the new ideas being introduced.
Complexity is left to the reader! No claims are made regarding the efficiency of
the program segments; instead, a balance is maintained between efficiency of
code and clarity of the description of the algorithrn. As far as possible the
prograrns were written in modular form. There are many cases where, by
reorganising the programs, combining routines and perhaps obscuring the code,
redundancy of data variables and statements may be eliminated. This can be
considered a general exercise that runs throughout the book.
The main purpose of this book, which is essentially a third-year degree course
given to undergraduates at Royal Holloway College, University of London, is to
set out the groundwork of computer graphics, but to leave as much as possible
to the imagination of the user - an exciting prospect. As one who found it
'difficult to draw a straight line with a ruler', I hope that my excitement in the
discovery of computer graphics and its potential will become apparent in the
following pages. I have been most gratified by the high standard and ingenuity of
design produced by my students. In fact I have used diagrams produced by four
of them: Hilary Green (figure 4.1), J emma Coombe (figure 11.1), Helen Davies
(figure 11.8) and Paul McLean-Thome (figure 11.10). They have found that
computer graphics is/un; I hope the reader will make the same discovery and
spend many enjoyable and productive hours in front of a graphics console.
For those wishing to study computer graphics in more detail after reading
this book, I recommend that they read W. M. Newman and R. F. Sproull,
Principles o/Interactive Computer Graphics (McGraw-Hill, 1973). It gives a good
survey of the more complicated and theoretical aspects of the subject as weIl as
containing an excellent bibliography.

IAN O. ANGELL
Acknowledgements

I wish to thank Professor H. J. Godwin for his help and encouragement and
John Anderson for his valuable assistance with my computer graphics course.
The photographic reproduction of all the diagrams and program listings in this
book would not have been possible without the untiring work of J. G. Davies, to
whom I am very grateful. Finally I would like to express my gratitude to my wife
Florence for her cheerful support during the writing of this book.

You might also like