Académique Documents
Professionnel Documents
Culture Documents
3.
TRANSFORMATIONS
2D Transformations
3D Transformations
4.
VIEWING
2D Viewing
3D Viewing
Projection
- Orthogonal
- Perspective
5.
6.
CLIPPING
Line Clipping Algorithms
Polygon Clipping Algorithms
TEXT BOOKS
-
Angel, E. 2002.
OpenGL: A primer.
London: Addison-Wesley.
Hill, F. S. 2000.
Computer Graphics using OpenGL (Second Edition ed.).
London: Prentice Hall.
INTRODUCTION
WHAT IS COMPUTER GRAPHICS?
Computer Graphics is not about the study of the following packages:
Computer Graphics are graphics created by computers and, more generally, the
representation and manipulation of pictorial data by a computer.
The study of Computer Graphics is a sub-field of Computer Science which studies
methods for digitally synthesizing and manipulating visual content. Although the term
often refers to 3D computer graphics, it also covers 2D graphics and image processing.
Graphics is a flourishing field within computer science. Driven by the tremendous
increase in speed and quality of hardware and software, it has rapidly gained popularity
among a wide variety of users. With applications as far-reaching as special effects,
synthetic content, interactive TV, graphical user interfaces, information visualization,
interactive art, industrial design, education, computer games ranging from Doom 3 to
The Sims, virtual reality, and the Internet, computer graphics plays an increasingly
important role in our lives, both practically and culturally. This course is aimed to be a
comprehensive introduction to basic concepts and algorithms in this field, and topics
covered will include the fundamentals of scan conversion of geometric primitives, 2D
and 3D transformations, 3D viewing and projection, color, hidden surface removal,
simple illumination models, modeling, animation, and user interfaces.
OUTPUT
INPUT
IMAGE
DESCRIPTION
IMAGE
DESCRIPTION
Image
Processing
Computer
Graphics
Pattern
Recognition
Data
Processing
The Fig. above gives the simplest explanation of Computer Graphics, that is, it is
the complete processes of taking the Description of an object or scene (as input),
and producing (as output) an Image of that object or scene using a computer
system. Image Processing, on the other hand takes in an Image and alters it in some
way (by applying special procedures) to produce another Image.
4
User interfaces;
Cartography;
Medicine;
Multimedia systems;
Computer games;
Image processing.
Business/Office automation:
o Desktop publishing.
o E-mail.
o Hypermedia.
Graphs :
o Business.
o Maths.
o Modeling.
Image Processing:
o Satellite.
o Medical.
o Weather.
o Police.
CAD/CAM :
o Industry.
o Landscape.
o Buildings.
o Materials.
Art and Design :
o Graphic Design.
o Presentation.
o Television.
o Advertising.
CAI :
o Laserdisk.
o "The Aussie BBQ".
o Flying.
o Driving.
o Shipping.
Animation :
o Games.
o Virtual Reality.
o Cartoons.
o Nuclear/Chemical Reactions.
o Physiology "VoxelMan".
Process Control :
o Real-time systems.
o Air Traffic Control.
o Refineries.
o Powerplants.
o Computer Networks.
Cartography :
o Geology.
o Oceanography
o GIS etc.
Hardware History:
Used until mid 80s, picture stored behind phosphor as a charge distribution on a grid.
No image in memory.
No flicker.
Long persistence.
Hi res., no staircasing.
Can only add to image, or erase it!
Refresh:
Raster Scan:
Plasma Panel:
Input Devices:
Keyboard.
Joystick.
Light pen (position located during refresh).
Mouse (mid 60s Doug Engelbart) :
o Originally ball driven.
o Infrared, cordless.
Graphics tablet/digitizer.
Trackball.
Glove.
Headset with transducers.
Graphics Software:
Software is needed to utilise the above hardware. This takes the form of a software library which
application programmers use to render their graphics. A number of graphics software standards
have been developed to facilitate portability
Standards:
Core :
o
o
o
o
GKS:
1974 W. German standard (Graphics Kernel System).
Excellent, but no 3D until 1988.
Allows groups of primitives arranged as segments, but no nested segments.
PHIGS :
o 1988, (Programmers Hierarchical Interactive Graphics System).
o Complex and sophisticated.
o Supports nested structures.
o Supports structure databases.
o PHIGS Plus includes shading, lighting features.
o Very large package.
PEX :
o Phigs Extension to X.
Hoops :
o C++ library produced by Autodesk
OpenGL :
o Open Graphics Library.
o Is a software interface to graphics hardware.
o Is hardware, window and operating system independent. That's why it's Open!
o Created by SGI.
o Overseen by the ARB (Architecture Review Board), comprised of seven major
hardware/software manufacturers.
o Also has an advisory forum where any user can make comments about the
architecture of the system.
o No inherent structure, simply takes a 3D point and renders it to the screen.
OpenInventor :
o (Object - Oriented version of OpenGL)
Java-3D :
o Object-Oriented graphics library, still under development. Available RSN ;).
o
o
o
10
Conceptual Framework:
Graphics System:
Application Model:
11
2D and 3D CONCEPTS
2D Concepts:
For 2D viewing we employ the use of two axes, viz. x and y. This means that any point in 2D
space is specified by a two value system; (x, y).
3D Concepts:
Two dimensional viewing is limited in what it can represent. Reality is inherently three
dimensional. Therefore a method of rendering 3D objects must be used.
For 3D viewing we employ an additional axis, viz. z. This means that any point in 3D space is
specified by a three value system: (x, y, z).
There are two coordinate systems in use, right-hand and left-hand.
We can establish these by curling our fingers from +ve x direction to +ve y direction. The thumb
on the respective hand then points in the direction of the z-axis.
12
SGL Background:
SGL (Simple open Graphics Library (openGL)).
In previous years we have used the SPHIGS library, detailed in the text book, for implementing
3D graphics theory. Unfortunately the subject syllabus goes beyond what the package can offer.
So a new package was written to incorporate the capabilities needed by the course.
It is a simplification of the OpenGL 1.0 standard used in Industry.
Open GL is an industry specification for a software/hardware API to allow the rendering of 3D
objects. It does not cover such areas as Windowing and Input/Output. This makes it portable
across different operating systems and windowing systems (more later)
It is an "Immediate Mode" graphics library as distinct from a "Retained Mode" graphics library.
It comes on Linux and Irix 5.3 platforms. We will be using the X11 system. (In the future I might
write a windows/mac version of the software...maybe :-) )
13
It can do:
It's free!!!!!!
It's as slow as a wet week!!!!! This is deliberate. The system is not intended for industry, just
education. Therefore the source-code has been written with clarity (?!!) in mind, not speed. This
facilitates the use of hyper-links from lecture pages to the source-code, as an aid in
understanding the theory.
It's probably bug-ridden!!!!!!!! Bear with me this semester as this is only the second time the
library has been used. We can expect some amount of trouble in using this system. If there is a
problem then email me, using the pro-forma I have provided at this web page.
Starting SGL:
In order to use the library the following must be carried out :
SGL types :
typedef
typedef
typedef
typedef
typedef
typedef
typedef
typedef
signed char
short
long
float
double
unsigned char
unsigned short
unsigned long
SGLbyte ;
SGLshort;
SGLint, SGLsizei;
SGLfloat, SGLclampf;
SGLfloat, SGLclampd;
SGLubyte, SGLboolean;
SGLushort;
SGLuint, SGLbitfield;
14
Otherwise it may cause problems with the SGI X Server on the Indy's.
15