Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
CG-6284
DTEIT 19/8/99
CG-6284
DTEIT 19/8/
CG-6284
COMPUTER GRAPHICS
CODE : 6284
THIRD YEAR ( SESSION 1999 - 2000 )
Number of Slides
: 1000
DTEIT 19/8/
CG-6284
DTEIT 19/8/
CG-6284
CG-6284
DTEIT 19/8/
CG-6284
CG-6284
Teaching Scheme
Total Number of Lectures 3 per Week
Practical 3 per Week
3+3=6
CG-6284
DTEIT 19/8/
CG-6284
10
GRAPHIC SYSTEMS
Display devices
Physical input and output devices
Display
processors
graphics
software
coordinate representation,
Graphics functions and standards.
DTEIT 19/8/
CG-6284
11
OUTPUT PRIMITIVES
Point plotting
Line drawing algorithms-DDA algorithms
Bresenhams line algorithms
Circle generating algorithms
Ellipses
Attributes and construction techniques
DTEIT 19/8/
CG-6284
12
TWO-DIMENSIONAL
TRANSFORMATIONS
Basic
transformationstranslation,scaling,rotation,matrix
representations
and
homogeneous
coordinates
Composite transformations- scaling relative to
a fixed pivot,rotation about a pivot
point,general transformation equation,other
transformation
Reflection.
DTEIT 19/8/
CG-6284
13
WINDOWING AND
CLIPPING TECHNIQUES
Windowing concepts
Clipping algorithms
Area clipping
Line clipping
DTEIT 19/8/
CG-6284
14
WINDOWING AND
CLIPPING TECHNIQUES
Polygon clippings
Text clippings
Blanking
Window-to-view point transformations,
Cohen sutherland clipping algorithm.
DTEIT 19/8/
CG-6284
15
ANIMATION TECHNIQUES
Animation perspectives
Computer animation hardware
Computer animation software and
applications
PC animations,concept of simulations.
DTEIT 19/8/
CG-6284
16
PROJECTION
Perspective and parallel transformation
Vanishing points
Perspective
DTEIT 19/8/
anomalies
CG-6284
17
LABORATORY WORK
Line drawing
DDA
Bresenhams circle generation
Two-dimensional transformation
Computer animation
DTEIT 19/8/
CG-6284
18
LABORATORY WORK
Windowing and clipping
Projection of a cube or any other three
dimensional figure using parallel and
perspective transformation.
DTEIT 19/8/
CG-6284
19
Evaluation Scheme
Study Scheme
HRS/Week Internal Assessment
Th Pr
3
Tot
6
Th
15
Pr
10
Tot
25
External Assessment
Marks
Ext.Int
125
CG-6284
20
Style of Examination
Theory Paper
Total Marks (75 Th) Duration (3 Hrs)
Passing Marks 30
Multiple Choice, True False, Fill in the
blanks, Short Answer Type and Descriptive
Answer Questions.
You have to attempt 5 out of 8.
DTEIT 19/8/
CG-6284
21
Style of Examination
Practical
Total Marks 25
Passing Marks 10
Duration 3 Hrs
DTEIT 19/8/
CG-6284
22
List of Practical
(1). Write a program to draw a line using simple
method .
(2). Write a program to draw a line using DDA
algorithm in C.
(3). Write a program to draw a line using
BRESENHAMs algorithm in C.
(4). Draw the triangle using DDA line draw
algorithm.
DTEIT 19/8/
CG-6284
23
List of Practical
(5).Draw the rectangle using DDA line draw
algorithm.
(6).Write a program to draw a circle using
midpoint circle generation algorithm.
(7).Write a program to draw a ellipse using
midpoint circle generation algorithm.
(8).Write a program to translate a point.
DTEIT 19/8/
CG-6284
24
List of Practical
(9). Write a program to translate scale and rotate
a line.
(10). Write a program to translate scale and
rotate a triangle.
(11). Write a program for motion of a man with
animation effects in C language.
(12). Write a program for windowing and
clipping of line, polygon.
DTEIT 19/8/
CG-6284
25
DTEIT 19/8/
CG-6284
26
DTEIT 19/8/
CG-6284
27
DTEIT 19/8/
CG-6284
28
INTRODUCTION
RAPID AND
ECONOMICAL PRODUCTION
of pictures.
There is virtually no area in which graphical
displays cannot be used to some advantage.
DTEIT 19/8/
CG-6284
29
INTRODUCTION
EXPENSIVE AND
CUMBERSOME EQUIPMENT
DTEIT 19/8/
CG-6284
30
INTRODUCTION
Computer graphics today is largely
interactive:
the user controls
#
CONTENTS
# STRUCTURE &
# APPEARANCE OF OBJECTS
DTEIT 19/8/
CG-6284
31
INTRODUCTION
PIXELS OR
PELS OR
PICTURE ELEMENTS
DTEIT 19/8/
CG-6284
32
INTRODUCTION
KEYBOARD
MOUSE OR
TOUCH-SENSITIVE PANEL
on the screen.
CREATE
DTEIT 19/8/
CG-6284
33
INTRODUCTION
POSITION AND
RESIZE
That acted as :
#
called windows.
DTEIT 19/8/
CG-6284
34
INTRODUCTION
POINTING &
CLICKING
DTEIT 19/8/
CG-6284
35
INTRODUCTION
2-D,
3-D AND
HIGHER DIMENSIONAL OBJECTS.
DTEIT 19/8/
CG-6284
36
COMPUTER GRAPHICS
APPLICATIONS
DTEIT 19/8/
CG-6284
37
BUILDINGS,
AUTO-MOBILES,
AIRCRAFT,
WATRECRAFT,
SPACECRAFT,
TEXTILES and many other
DTEIT 19/8/
CG-6284
products.
38
COMPUTER ART
Computer graphics methods
are widely used in both fine :
ART &
COMMERCIAL ART.
APPLICATIONS.
DTEIT 19/8/
CG-6284
39
ENTERTAINMENT
Computer graphics methods are
now commonly used in making :
MOTION PICTURES,
MUSIC VIDEOS,
TELEVISION SHOWS.
DTEIT 19/8/
CG-6284
40
DTEIT 19/8/
CG-6284
41
DTEIT 19/8/
CG-6284
42
VISUALIZATION
DTEIT 19/8/
CG-6284
43
IMAGE PROCESSING
IMAGE PROCESSING Applies techniques
PHOTOGRAPHS AND
TV SCANS.
DTEIT 19/8/
CG-6284
44
IMAGE PROCESSING
DTEIT 19/8/
CG-6284
45
GRAPHICAL USER
INTERFACES
Graphical interface is a window
manager that allows a user to display
multiple-window areas.
Interfaces also display menus and
menus for fast selection of processing
options.
DTEIT 19/8/
CG-6284
46
PROCESS CONTROL
Status displays in
REFINERIES ,
POWER PLANTS &
COMPUTER NETWORKS
DTEIT 19/8/
CG-6284
47
PROCESS CONTROL
IN IT
FLIGHT SIMULATORS OR
ARCADE GAMES
DTEIT 19/8/
CG-6284
48
CARTOGRAPHY
GEOGRAPHICAL AND
OTHER NATURAL PHENOMENA
from
measurement data.
Examples :-
DTEIT 19/8/
CG-6284
49
e.g.
GEOGRAHPICAL MAPS,
RELIEF MAPS,
CG-6284
50
CLASSIFICATION OF
APPLICATIONS
First classification is by type (dimensionality) of
the object to be represented and the kind of picture
to be produced.
DTEIT 19/8/
CG-6284
51
CLASSIFICATION OF
APPLICATIONS
The 3rd classification is by the role
of the picture , or the degree to which
the picture is an end in itself or is
merely a means to an end.
Final categorization arises from the
logical temporal relationship between
objects & their pictures.
DTEIT 19/8/
CG-6284
52
CLASSIFIACTION OF
COMPUTER GRAPHICS BY
OBJECT & PICTURE
TYPE OF
OBJECT
2-D
PICTORIAL REPRESENTATION
LINE DRAWING,
GRAY SCALE IMAGE,
DTEIT 19/8/
COLOR IMAGE
CG-6284
53
TYPE OF
OBJECT
PICTORIAL REPRESENTATION
3-D
LINE DRAWING (WIREFRAME),
DRAWING WITH VARIOUS EFFECTS,
LINE
SHADED,
COLOR IMAGE WITH VARIOUS
DTEIT 19/8/
CG-6284
EFFECTS.
54
CONCEPTUAL FRAMEWORK
FOR INTERACTIVE GRAPHICS
APPLICATION
MODEL
APPLICATION
PROGRAM
V.D.U.
GRAPHICS
SYSTEM
INPUT DEVICES
DTEIT 19/8/
CG-6284
55
APPLICATION PROGRAM : IT
CREATES,
STORES
INTO,
AND
RETRIEVES FROM THE APPLICATION
MODEL.
INPUT DEVICES
DTEIT 19/8/
CG-6284
56
GRAPHICS SYSTEM
GRAPHICS SYSTEM :
DTEIT 19/8/
CG-6284
57
GRAPHICS SYSTEM
# The graphics system is an intermediary
DTEIT 19/8/
CG-6284
58
GRAPHICS SYSTEM
# It effects an input trans-formation
CG-6284
59
COMPONENTS OF
GRAPHICS SYSTEM
INPUT DEVICES
GRAPHIC SOFTWARE.
DTEIT 19/8/
CG-6284
60
APPLICATION MODEL
DATA,
OBJECTS AND
DTEIT 19/8/
CG-6284
61
APPLICATION MODEL
Postprocessing modules.
# Examples of such post-processing
module are analyses of the transient
behavior of a circuit or of the stress in an
aircraft wing.
DTEIT 19/8/
CG-6284
62
APPLICATION MODEL
# A data model can be as rudimentary as
DTEIT 19/8/
CG-6284
63
APPLICATION MODEL
# Models typically store descriptions of
CG-6284
64
1. ELECTRON
GUN
2. CONTROL ELECTRODE
3. FOCUSING ELECTRODE
4. DEFLECTION YOKE
5. PHOSPHORUS-COATED SCREEN
DTEIT 19/8/
CG-6284
65
CRT COMPONENTS
ELECTRON GUN
CG-6284
66
CRT COMPONENTS
CONTROL ELECTRODE
DTEIT 19/8/
CG-6284
67
CRT COMPONENTS
FOCUSING ELECTRODE
DTEIT 19/8/
CG-6284
68
CRT COMPONENTS
DEFLECTION YOKE :
DTEIT 19/8/
CG-6284
69
RETRACE
DTEIT 19/8/
CG-6284
70
CRT COMPONENTS
PHOSPHORUS-COATED SCREEN
DTEIT 19/8/
CG-6284
71
CRT COMPONENTS
DTEIT 19/8/
CG-6284
72
CRT COMPONENTS
It is very important that the persistence of
the phosphor used and the refresh rate be
matched.
DTEIT 19/8/
CG-6284
73
CRT COMPONENTS
INTERLACING
DTEIT 19/8/
CG-6284
74
INTERFACING
RASTER LINE
NUMBER
1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
DTEIT 19/8/
0
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
CG-6284
75
CRT COMPONENTS
If the refresh rate is greater than the
phosphors persistence, moving objects
will tend to become blurred.
DTEIT 19/8/
CG-6284
76
CRT COMPONENTS
ASPECT RATIO
9 in
DTEIT 19/8/
VIEWABLE AREA ON
A CRT
CG-6284
77
CRT COMPONENTS
RESOLUTION
CG-6284
78
CRT COMPONENTS
SQUARENESS
CG-6284
79
CRT COMPONENTS
FIT
Fit is how well model data will fit in
the memory map without scaling.
DTEIT 19/8/
CG-6284
80
CATHODE RAY
DTEIT 19/8/
CG-6284
81
DTEIT 19/8/
CG-6284
82
FOCUSING
SYSTEM
PHOSPHOR
COATED
SCREEN
CONNECTOR
PINS
ELECTRON
BEAM
ELECTRON
GUN
DTEIT 19/8/
CG-6284
83
WORKING
DTEIT 19/8/
CG-6284
84
DTEIT 19/8/
CG-6284
85
CATHODE
FOCUSING
ANODE
ELECTRON
BEAM PATH
HEATING
FILAMENT
CONTROL GRID
ACCELRATING
ANODE
CG-6284
86
DTEIT 19/8/
CG-6284
87
DTEIT 19/8/
CG-6284
88
DTEIT 19/8/
CG-6284
89
The frequency
or
color of
light emitted by the phosphor is
proportional to the energy difference
between the excited quantum state & the
ground state.
DTEIT 19/8/
CG-6284
90
use in crt.
Besides color , a major difference between
phosphors is their perisistence :
# how long they continue to emit light i.e.
DTEIT 19/8/
CG-6284
91
DTEIT 19/8/
CG-6284
92
PERSISTENCE
A phosphor with low persistence is useful
for animation ;
A high persistence phosphor is useful for
displaying highly complex, static pictures.
DTEIT 19/8/
CG-6284
93
DTEIT 19/8/
CG-6284
94
DTEIT 19/8/
CG-6284
95
DTEIT 19/8/
CG-6284
96
DTEIT 19/8/
CG-6284
97
DTEIT 19/8/
CG-6284
98
DTEIT 19/8/
CG-6284
99
DTEIT 19/8/
CG-6284
100
CG-6284
101
DTEIT 19/8/
CG-6284
102
DTEIT 19/8/
CG-6284
103
DTEIT 19/8/
CG-6284
104
DTEIT 19/8/
CG-6284
105
DTEIT 19/8/
CG-6284
106
DTEIT 19/8/
CG-6284
107
RASTER SCAN
Scan Line
Horizontal
Retrace
Vertical
Retrace
CG-6284
108
DTEIT 19/8/
CG-6284
109
CG-6284
110
RANDOM-SCAN
DISPLAY
In a random-scan display unit,
a CRT has the
DTEIT 19/8/
CG-6284
111
RANDOM-SCAN DISPLAY
CG-6284
112
RANDOM-SCAN DISPLAY
A pen plotter operates in a similar way
and is an example of random scan,
hardcopy device.
DTEIT 19/8/
CG-6284
113
RANDOM-SCAN DISPLAY
Picture defination is now stored as a set of
line drawing commands in an area of memory
referred to as refresh display file.
Some times refresh display file is called
display list
display program or
simply the refresh buffer.
DTEIT 19/8/
CG-6284
114
RANDOM-SCAN DISPLAY
Random scan displays are designed to
draw all the component lines of a picture
30 to 60 times each second.
High quality vector systems are capable
of handling approximately 100,000 short
lines at this refresh rate.
DTEIT 19/8/
CG-6284
115
RANDOM-SCAN DISPLAY
DTEIT 19/8/
CG-6284
116
RANDOM-SCAN DISPLAY
Also vector displays produce smooth line
drawing because the CRT beam directly
follows the line path.
DTEIT 19/8/
CG-6284
117
DTEIT 19/8/
VECTOR SCAN
CG-6284
118
DTEIT 19/8/
CG-6284
119
BEAM -PENETRATION
DTEIT 19/8/
CG-6284
120
BEAM -PENETRATION
A beam of slow electron excites only the
outer red layer.
A beam of very fast electrons penetrates
through the red layer and excites the inner
green layer.
DTEIT 19/8/
CG-6284
121
BEAM -PENETRATION
Beam penetration has been an
inexpensive way to produce color in
random scan monitors, but only four
colors are possible, and the quietly of
picture is not as good as with other
methods .
DTEIT 19/8/
CG-6284
122
SELECTION OF
SHADOW
MASK
MAGNIFIED
PHOSPHOR-DOT
TRIANGLE
RED
GREEN BLUE
SCREEN
DTEIT 19/8/
CG-6284
123
SHADOW-MASK
DTEIT 19/8/
CG-6284
124
SHADOW-MASK
DTEIT 19/8/
CG-6284
125
CG-6284
126
VOLUME ,
WEIGHT AND
POWER
DTEIT 19/8/
CG-6284
127
categories :
EMISSIVE DISPLAY
OR
EMITTERS
DTEIT 19/8/
CG-6284
128
DTEIT 19/8/
CG-6284
129
DTEIT 19/8/
CG-6284
130
DTEIT 19/8/
CG-6284
131
CATHODES :
DTEIT 19/8/
CG-6284
132
DTEIT 19/8/
CG-6284
133
DTEIT 19/8/
CG-6284
134
ANODES
DTEIT 19/8/
CG-6284
135
1. CATHODE
2. ELECTROFLUORESESCENT
MATERIAL
3. ANODE
4. GLASS
PLATES
ELECTROFLUORESESCENT DISPLAY
DTEIT 19/8/
CG-6284
136
ELECTROLUMINESCENT
plasma panel.
The difference is that the region between the
glass plates is filled with a phosphor, such as
zinc sulfide doped with manganese.
DTEIT 19/8/
CG-6284
137
Electroluminescent
displays
require more power than plasma
panels
Good color and
Gray scale displaced are hard to
achieve.
DTEIT 19/8/
CG-6284
138
buffer.
DTEIT 19/8/
CG-6284
139
DTEIT 19/8/
CG-6284
140
DTEIT 19/8/
CG-6284
141
DTEIT 19/8/
CG-6284
142
Liquid crystal
3
Conducting
coating
2
Trans1 parent
plates
4 Polarized film
DTEIT 19/8/
CG-6284
143
DTEIT 19/8/
CG-6284
144
DTEIT 19/8/
CG-6284
145
WORKING OF LCD
DTEIT 19/8/
CG-6284
146
WORKING OF LCD
To observe how this works, take two pairs of
Polaroid sunglasses and put the lenses on top of
each other.
Next, keeping the two lenses on top of each
other, rotate the glasses with respect to each
other. You should notice the lenses appearing to
become darker.
DTEIT 19/8/
CG-6284
147
VECTOR DEVICES
The simplest image or primitive that can
be drawn on the devices discussed so far is a
point.
The simplest image or primitive that can
be drawn on a vector device such as
DTEIT 19/8/
CG-6284
148
VECTOR DEVICES
Vector devices require less computer
memory because only the endpoints of lines
must be stored .
A major problem occurs when the list of
endpoints becomes too long.
The vector CRT is not able to refresh the
line often enough and the display begins to
flicker.
DTEIT 19/8/
CG-6284
149
MEMORY-TUBE DISPLAYS
DTEIT 19/8/
CG-6284
150
MEMORY-TUBE DISPLAYS
FLOODING GUN
An electron gun designed to flood the entire
screen with electron. This charges the
collector plate.
PHOSPHORUS GRAINS
Used in a memory-tube display and similar to
those used in a standard CRT except that they
have a much longer persistence.
DTEIT 19/8/
CG-6284
151
MEMORY-TUBE DISPLAYS
WRITING GUN SYSTEM:- Used in a
memory-tube display and basically the same
as the electron gun used in a conventional
CRT. It consist of a series of components
(primerly a heater, a cathode a focusing
electrod, and the deflection yoke) which
together cause electrons to congregate at the
end of the gun.
DTEIT 19/8/
CG-6284
152
MEMORY-TUBE DISPLAYS
COLLECTOR
Already partly energized by the flooding gun,
stores the charge generated by the writing gun.
The background charge from the flooding gun
supplies enough energy so that the phosphors will
continue to phosphoresce indefinitely after they
are hit by writing gun.
DTEIT 19/8/
CG-6284
153
MEMORY-TUBE DISPLAYS
GROUND
DTEIT 19/8/
CG-6284
154
COMPARISON OF DISPLAY
TECHNOLOGIES
POWER CONSUMPTION
CRT
: FAIR
ELECTRO-LUMINESENT : FAIR-GOOD
LIQUID CRYSTAL
: EXELLENT
PLASMA PANEL
: FAIR
DTEIT 19/8/
CG-6284
155
COMPARISON
SCREEN SIZE
CRT
: EXCELLENT
ELECTRO-LUMINESENT : GOOD
LIQUID CRYSTAL
: FAIR
PLASMA PANEL
: EXCELLENT
DTEIT 19/8/
CG-6284
156
COMPARISON
DEPTH
CRT
: POOR
ELECTRO-LUMINESENT : EXCELLENT
LIQUID CRYSTAL
: EXCELLENT
PLASMA PANEL
: GOOD
DTEIT 19/8/
CG-6284
157
COMPARISON
WEIGHT
CRT
: POOR
ELECTRO-LUMINESENT : EXCELLENT
LIQUID CRYSTAL
: EXCELLENT
PLASMA PANEL
: EXCELLENT
DTEIT 19/8/
CG-6284
158
COMPARISON
RUGGEDNESS
CRT
: FAIR-GOOD
ELECTRO-LUMINESENT : G-EXCELLENT
LIQUID CRYSTAL
: EXCELLENT
PLASMA PANEL
: EXCELLENT
DTEIT 19/8/
CG-6284
159
COMPARISON
BRIGHTNESS
CRT
ELECTRO-LUMINESENT EXCELLENT :
LIQUID CRYSTAL
EXCELLENT
PLASMA PANEL
: FAIR-GOOD
DTEIT 19/8/
CG-6284:
EXCELLENT
160
COMPARISON
ADDRESSABILITY
CRT
: EXCELLENT
ELECTRO-LUMINESENT : GOOD
LIQUID CRYSTAL
: FAIR-GOOD
PLASMA PANEL
: GOOD
DTEIT 19/8/
CG-6284
161
COMPARISON
CONTRAST
: EXCELLENT
CRT
ELECTRO-LUMINESENT : GOOD
LIQUID CRYSTAL
: FAIR
PLASMA PANEL
: GOOD
DTEIT 19/8/
CG-6284
162
COMPARISON
INTENSITY LEVEL PER DOT
: EXCELLENT
CRT
ELECTRO-LUMINESENT : FAIR
LIQUID CRYSTAL
: FAIR
PLASMA PANEL
: FAIR
DTEIT 19/8/
CG-6284
163
COMPARISON
VIEWING ANGLE
: EXCELLENT
CRT
ELECTRO-LUMINESENT : GOOD
LIQUID CRYSTAL
: POOR
PLASMA PANEL
: G-EXCELLENT
DTEIT 19/8/
CG-6284
164
COMPARISON
COLOR CAPABILITY
CRT
: EXCELLENT
ELECTRO-LUMINESENT : GOOD
LIQUID CRYSTAL
: GOOD
PLASMA PANEL
: FAIR
DTEIT 19/8/
CG-6284
165
COMPARISON
RELATIVE COST RANGE
CRT
: LOW
ELECTRO-LUMINESENT : MEDIUM-HIGH
LIQUID CRYSTAL
: LOW
PLASMA PANEL
: HIGH
DTEIT 19/8/
CG-6284
166
DTEIT 19/8/
CG-6284
167
DTEIT 19/8/
CG-6284
168
SYSTEM
MEMORY
FRAME
BUFFER
VIDEO
CONTROLLER
MONITOR
SYSTEM BUS
I/O DEVICES
DTEIT 19/8/
CG-6284
169
VIDEO CONTROLLER
A fixed area of the system memory is
reserved for the frame buffer, and the video
controller is given direct access to the framebuffer memory.
Locations & corresponding screen
positions are referenced in Cartesian
coordinates.
DTEIT 19/8/
CG-6284
170
VIDEO CONTROLLER
The origin of the
coordinate system for
identifying
screen
positions is usually
specified in the lower
left corner.
DTEIT 19/8/
CG-6284
171
VIDEO CONTROLLER
DTEIT 19/8/
CG-6284
172
VIDEO CONTROLLER
DTEIT 19/8/
CG-6284
173
VIDEO CONTROLLER
Two registers are used to store the
coordinates of the screen pixels.
DTEIT 19/8/
CG-6284
174
VIDEO CONTROLLER
The x register is incremented by 1 & the
DTEIT 19/8/
CG-6284
175
VIDEO CONTROLLER
DTEIT 19/8/
CG-6284
176
VIDEO CONTROLLER
Screen must be refreshed at rate of 60
frames per second.
DTEIT 19/8/
CG-6284
177
X
REGISTER
HORIZONTAL &
VERTICAL DEFLCTION
VOLTAGES
Y
REGISTER
MEMORY
ADDRESS
PIXEL
REGISTER
INTENSITY
FRAME BUFFER
DTEIT 19/8/
CG-6284
178
ARCHITECTURE OF A RASTER-GRAPHICS
SYSTEM WITH A DISPLAY PROCESSOR
DISPLAY
PRCESSOR
MEMORY
C.P.U.
FRAME
BUFFER
DISPLAY
PROCESSOR
VIDEO
CONTROLLER
MONITOR
SYSTEM
MEMORY
SYSTEM BUS
I/O DEVICES
DTEIT 19/8/
CG-6284
179
controller
or
display
coprocessor.
DTEIT 19/8/
CG-6284
180
DTEIT 19/8/
CG-6284
181
DTEIT 19/8/
CG-6284
182
DTEIT 19/8/
CG-6284
183
DTEIT 19/8/
CG-6284
184
DTEIT 19/8/
CG-6284
185
DTEIT 19/8/
CG-6284
186
C.P.U.
SYSTEM
MEMORY
DISPLAY
PROCESSOR
MONITOR
SYSTEM BUS
I/O DEVICES
DTEIT 19/8/
CG-6284
187
DTEIT 19/8/
CG-6284
188
a graphics controller.
DTEIT 19/8/
CG-6284
189
DTEIT 19/8/
CG-6284
190
3 - DIMENTIONAL
VIEWING DEVICES
OPERATION OF
3D - DISPLAY
SYSTEM USING
A
VIBRATING
MIRROR
THAT
CHANGES
FOCAL LENGTH
TO MATH THE
DEPTH
OF
POINTS IN A
SCENE
DTEIT 19/8/
TIMING &
CONTROL
SYSTEM
Projected
3D Image
Vibrating
Flexible Mirror
CRT
Viewer
CG-6284
191
DTEIT 19/8/
CG-6284
192
applications
to
analyze
DTEIT 19/8/
CG-6284
193
CG-6284
194
CG-6284
195
To obtain a stereoscopic
projection, we first need to obtain 2
views of scene generated from a
viewing direction corresponding to
each eye.
DTEIT 19/8/
CG-6284
196
DTEIT 19/8/
CG-6284
197
DTEIT 19/8/
CG-6284
198
DTEIT 19/8/
CG-6284
199
DTEIT 19/8/
CG-6284
200
ARCHITECHTURE OF
RASTER DISPLAY
INTERFACE WITH HOST COMPUTER
(DISPLAY COMMANDS)
000000000000000000000000
000000000001000000000000
0000000001111110000000000
0000001111111111000000000
00001111111111110000000000
0011110000111110000000000
0111100001111100000000000
1111000011111000000000001
11111111111100000000000000
000000000000000
(INTERACTION DATA)
DISPLAY
CONTROLLER
MOUSE
VIDEO
CONTROLLER
MONITOR
REFRESHER BUFFER
DTEIT 19/8/
KEYBOARD
CG-6284
201
INPUT DEVICES
KEYBOARD
DTEIT 19/8/
CG-6284
202
KEYBOARD
The keyboard is an efficient device
for inputting such non-graphic data as a
picture labels associated with a graphics
display.
It is used to type any text on the
screen.
DTEIT 19/8/
CG-6284
203
KEYBOARD
TYPES OF KEYBOARD
83-key PC and XT keyboard.
84-key AT keyboard.
101-key enhanced keyboard.
DTEIT 19/8/
CG-6284
204
KEYBOARD
SECTIONS OF KEYBOARD
Typing area.
Numeric keypad.
Cursor and screen controls.
Function keys.
DTEIT 19/8/
CG-6284
205
INPUT DEVICES
MOUSE
DTEIT 19/8/
CG-6284
206
MOUSE
Famous as an input device.
Mostly used for pointing the pictures.
COMPONENTS
A housing to hold in hand & move
around on desktop.
DTEIT 19/8/
CG-6284
207
MOUSE
A roller ball that signals movement
to the system.
Two buttons for making selections.
A cable for connecting the mouse to
the system.
DTEIT 19/8/
CG-6284
208
INPUT DEVICES
DTEIT 19/8/
CG-6284
209
INPUT DEVICES
JOYSTICK
A joystick consist of a small, vertical lever
(called the stick) mounted on a base that is
used to steer the screen cursor around.
Joystick select screen positions with actual
stick movement.
DTEIT 19/8/
CG-6284
210
INPUT DEVICES
DATA GLOVE
Electromagnetic
coupling
between
transmitting antennas and receiving antennas is
used to provide information about the position
and orientation of the hand.
DTEIT 19/8/
CG-6284
211
DIGITIZERS
TOUCH PANELS
Touch panel allow displayed objects or screen
positions to be selected with the touch of a finger.
DTEIT 19/8/
CG-6284
212
INPUT DEVICES
IMAGE SCANNERS
Drawing, graphs colour and black and
white photos or text can be stored for
computer processing with an image scanner
by passing an optical scanning mechanism
over the information to be stored.
DTEIT 19/8/
CG-6284
213
INPUT DEVICES
LIGHT PEN
Such pencil-shaped devices are used
to select screen position by detecting
the light coming from points on the
CRT screen.
DTEIT 19/8/
CG-6284
214
INPUT DEVICES
VOICE SYSTEM
The voice system input can be used to
initiate graphics operations or to enter data.
These systems operate by matching an
input against a predefined dictionary of
words and phrases.
DTEIT 19/8/
CG-6284
215
These are :
1. IMPACT PRINTERS
2. NON-IMPACT PRINTERS.
DTEIT 19/8/
CG-6284
216
PRINTERS
Most commonly used Hard copy output
device.
Capable of high-quality monochrome i.e.
Single color and multi-color print outs at very
high speed.
Can also produce graphic i.e. Images other
than plain text on the paper.
DTEIT 19/8/
CG-6284
217
IMPACT PRINTERS
IMPACT PRINTERS
LINE PRINTERS,
DRUM PRINTER,
CHAIN PRINTER,
DAISY WHEEL PRINTER,
PAGE PRINTER.
DTEIT 19/8/
CG-6284
218
IMPACT PRINTERS
Impact printers press formed character
faces against an inked ribbon on to paper
a line printer is a example of impact
device, with the type faces mounted on
bands, chains, drummer wheels.
DTEIT 19/8/
CG-6284
219
IMPACT PRINTERS
DTEIT 19/8/
CG-6284
220
characters
or
graphics
DTEIT 19/8/
CG-6284
221
printers.
DTEIT 19/8/
CG-6284
222
DTEIT 19/8/
CG-6284
223
CLASSIFICATION BASED ON
ITS CAPABILITIES
Extremely high volume models used
to print Electricity bills, banks etc.
High Volume models are used for
small business.
Personal model used for Office, Home
users.
DTEIT 19/8/
CG-6284
224
CG-6284
225
IMPACT PRINTERS
LINE PRINTERS
DTEIT 19/8/
CG-6284
226
LINE PRINTERS
DTEIT 19/8/
CG-6284
227
LINE PRINTERS
WORKING OF DRUM PRINTERS
A metal drum with all the printable
characters on its periphery is used.
As the drum rotates different letters of the
line gets printed and in one rotation of the
drum all the letter of the line gets printed.
DTEIT 19/8/
CG-6284
228
LINE PRINTERS
First all the letter A in the line will
get printed, next all B, then all the
C and so on until all the letters of the
line is printed.
DTEIT 19/8/
CG-6284
229
PRINTERS
NON-IMPACT PRINTERS
LASER,
INKJET SPRAY,
XEORX PROCESSOR MACHINES,
ELECTROSTATIC,
ELECTEOTHERMAL PRINTERS.
DTEIT 19/8/
CG-6284
230
NON-IMPACT PRINTERS
Non impact printers use laser
techniques,inkjet sprays ,xerographic
processes (as used in photocopying
machines), electrostatic methods and
electro-thermal methods to get images
onto paper.
DTEIT 19/8/
CG-6284
231
NON-IMPACT PRINTERS
LASER PRINTER
DTEIT 19/8/
CG-6284
232
LASER PRINTERS
A high end printer produces clear and
sharp images.
DTEIT 19/8/
CG-6284
233
LASER PRINTERS
Laser Printer can produce 300 to 1800 DPI
resolution.
A cylindrical photo-sensitive drum inside the
Printer is given an even electrostatic charge .
A Laser beam-focused to a tiny spot-scans
across the cylindrical drum from left to right.
DTEIT 19/8/
CG-6284
234
LASER PRINTERS
The area exposed by the LASER beam,
attract a black colored toner to the drum.
Black colored is transferred to the paper
to form the image.
DTEIT 19/8/
CG-6284
235
LASER PRINTERS
DTEIT 19/8/
CG-6284
236
DTEIT 19/8/
CG-6284
237
NON-IMPACT PRINTERS
INK-JET PRINTER
DTEIT 19/8/
CG-6284
238
NON-IMPACT PRINTERS
ELECTROSTATIC PRINTERS
DTEIT 19/8/
CG-6284
239
NON-IMPACT PRINTERS
The toner is positively charged and
so is attracted to negatively charged
areas , where it adheres to produce
the specified output.
DTEIT 19/8/
CG-6284
240
PLOTTERS
An output device used to get
hardcopy of information.
Used to produce output such as
drawing in
Architectural and
Engineering applications.
DTEIT 19/8/
CG-6284
241
PLOTTERS
It draws image by using a pen on the
paper surface.
DTEIT 19/8/
CG-6284
242
PLOTTERS
PLOTTER SIZE
Size of the plotter is fixed according
to maximum size of the paper used.
DTEIT 19/8/
CG-6284
243
PLOTTERS
TYPES OF PLOTTERS
Single and multiple pen plotters.
Flatbed and drum plotters.
Thermal/laser/pencil plotters.
DTEIT 19/8/
CG-6284
244
PLOTTERS
FLATBED PLOTTER
DTEIT 19/8/
CG-6284
245
PLOTTERS
PEN CARTRIDGE
Holds several
different- colored pens . A plotter capable
of multicolor output usually has a
program in read- only memory(ROM) that
instructs the plotter to pickup a new pen
when the programmer requests a color
change.
Y DRIVER MOTOR Moves the pen
vertically across the paper.
DTEIT 19/8/
CG-6284
246
PLOTTERS
DRUM PLOTTER
PEN An actual pen that draws on the plotted paper.
WRITE-MOVE MECHANISM Used to lift and
backward.
DTEIT 19/8/
CG-6284
247
PLOTTERS
colored pens.
# A plotter capable of multicolor
output
usually
has
a program in read- only
memory(ROM) that instructs the plotter to
pickup a new pen when the programmer
requests a color change.
X DRIVER MOTOR
Moves the pen
horizontally across the paper.
DTEIT 19/8/
CG-6284
248
GRAPHICS SOFTWARE
A
DTEIT 19/8/
CG-6284
249
GRAPHICS SOFTWARE
application graphics packages are
designed for non programmers, so that
users can generate display without
worrying about how graphics operation
work.
DTEIT 19/8/
CG-6284
250
GRAPHICS SOFTWARE
ATTRIBUTES
DTEIT 19/8/
CG-6284
251
GRAPHICS SOFTWARE
Geometric transformations are used to
specify the view that is to be presented
and the portion of the output display area
that is to be used.
Pictures can be subdivided into parts,
called structures or segments or objects,
depending on the software package in use.
DTEIT 19/8/
CG-6284
252
COORDINATE SYSTEM
MODELING
TRANSFORMATIONS
PLOTTER
NORMALIZED
COORDINATES
WORLD
COORDINATES
DTEIT 19/8/
OTHER
OTHEROUTPUT
OUTPUT
DEVICE
COORDINATES
CG-6284
253
COORDINATE REPRESENTATION
We can construct the shape of individual objects
,such as trees or furniture, in a scene within
separate coordinate reference frames called
Modeling coordinates or
Local coordinates.
or
Master coordinates.
DTEIT 19/8/
CG-6284
254
COORDINATE REPRESENTATION
DTEIT 19/8/
CG-6284
255
COORDINATE REPRESENTATION
The world-coordinates description of
the
scene is to one or more output-device reference
frames for display.
These display coordinate system are referred to
as
Device coordinates or
Screen coordinates.
DTEIT 19/8/
CG-6284
256
COORDINATE REPRESENTATION
A graphic system first converts worldcoordinate positions to normalized device
coordinates, in the range from 0 to 1,
before final conversion to specific device
coordinates.
DTEIT 19/8/
CG-6284
257
COORDINATE REPRESENTATION
An initial modeling-coordinate position (x mc,
ymc) Is transferred to a device coordinate
position (xdc, ydc) With the sequence:
(xmc, ymc)->(xwc, ywc)-> (xnc, ync)-> (xdc, ydc)
DTEIT 19/8/
CG-6284
258
COORDINATE REPRESENTATION
DTEIT 19/8/
CG-6284
259
COORDINATE REPRESENTATION
DTEIT 19/8/
CG-6284
260
COORDINATE REPRESENTATION
We carry out the viewing transformation in
several steps --First, we construct the scene in world
coordinates using the output primitives an
attributes.
DTEIT 19/8/
CG-6284
261
COORDINATE REPRESENTATION
Once the viewing reference frame is established ,
we can transform description in world
coordinates to viewing coordinates .We then
define a view port in normalized coordinates .
The final step ,all parts of the picture that lie
outside view port are clipped and the contents of
view port are transferred to device coordinates.
DTEIT 19/8/
CG-6284
262
COORDINATE REPRESENTATION
Next, to obtain a particular orientation for
the window ,we can set up a two
dimensional viewing coordinate system in
the world coordinate plane and define a
window in viewing coordinate system.
DTEIT 19/8/
CG-6284
263
SOFTWARE STANDARDS
The primary goal of standardized graphics
software is portability.
When packages are designed with standard
graphics functions, software can be moved
easily from one hardware system to another
and used in different implementations and
applications.
DTEIT 19/8/
CG-6284
264
SOFTWARE STANDARDS
For
object
modeling
,
color
specifications, surface rendering and picture
manipulations are developed in PHIGS.
DTEIT 19/8/
CG-6284
265
SOFTWARE STANDARDS
graphics
DTEIT 19/8/
CG-6284
266
SOFTWARE STANDARDS
DTEIT 19/8/
CG-6284
267
SOFTWARE STANDARDS
DTEIT 19/8/
CG-6284
268
SOFTWARE STANDARDS
Interactive
Graphics
DTEIT 19/8/
CG-6284
269
SOFTWARE STANDARDS
DTEIT 19/8/
CG-6284
270
SOFTWARE STANDARDS
Standardization
for device
interface methods is given in the
computer graphics interface (CGI)
system.
And the computer graphics metafile
(CGM) system specifies
DTEIT 19/8/
CG-6284
271
SOFTWARE STANDARDS
and
Functions
in
graphics
programming packages can be
divided into the following categories:
DTEIT 19/8/
CG-6284
272
SOFTWARE STANDARDS
Output primitives,
Attributes,
Geometric,
Modeling transformations,
Viewing transformations,
Structure operations,
Input functions and
Control operations.
DTEIT 19/8/
CG-6284
273
PROBLEM SOLUTIONS
PROBLEM:- Define analog device, and give
some examples of analog devices.
SOLUTION:- An analog device is a
continuous mechanism that represents
information with continuous physical
variations.
For
Example,
mercury
thermometer and record players are all
analog devices.
DTEIT 19/8/
CG-6284
274
PROBLEM SOLUTIONS
PROBLEM :- Define digital device ,and give
some examples of digital devices.
SOLUTION:- A digital device is a discrete
mechanism which represents all values with a
specific number system. For example, digital
watches and computer all process discrete
information and use the binary number system.
DTEIT 19/8/
CG-6284
275
PROBLEM SOLUTIONS
PROBLEM :-Explain what accuracy means as
DTEIT 19/8/
CG-6284
276
PROBLEM SOLUTIONS
Problem :- What are the major
components of a memory-tube crt ?
Solution :- The major components of
memory-tube CRT are the right gun,
the flooding gun, the collector, the
phosphorous-coated screen, and the
collector ground.
DTEIT 19/8/
CG-6284
277
PROBLEM SOLUTIONS
PROBLEM :-Why is high precision misleading
when combined with low accuracy ?
SOLUTION:- People tend to believe highprecision readings. Assume that we have a
digital thermometer with eight-place precision
that consistently gives readings 9 degrees
higher than the actual temperature.
DTEIT 19/8/
CG-6284
278
PROBLEM SOLUTIONS
PROBLEM:-
capacity?
Processor addressing
capacity relates the maximum number
of bytes to which a processor has
access,as determined by the number of
address lines (address width ) the
processor has.
SOLUTION
DTEIT 19/8/
:-
CG-6284
279
CG-6284
280
PROBLEM SOLUTIONS
PROBLEM :- What steps are required to record the
DTEIT 19/8/
CG-6284
281
DTEIT 19/8/
CG-6284
282
PROBLEM SOLUTIONS
CG-6284
283
PROBLEM SOLUTIONS
PROBLEM :- How does a magnetic tablet
system locate the coordinates of the stylus ?
SOLUTION:- The stylus used in a magnetic
tablet system is small radio transmitter. The
tablet is composed of an array of radio
receiver. By measuring the relative strength
of the radio signals at each of the receivers,
you can compute the location of the stylus.
DTEIT 19/8/
CG-6284
284
PROBLEM SOLUTIONS
PROBLEM:- What are some of the disadvantages of
developing a specialize keyboard with commands
printed on the function key ?
SOLUTION :-Printing commands on the function
keys limit flexibility, since any future software
change will require a change of keyboards.
Experience has shown that in most cases a removable
template placed over function keys is just as effective
but less limiting to future development.
DTEIT 19/8/
CG-6284
285
PROBLEM SOLUTIONS
CG-6284
286
PROBLEM SOLUTIONS
CG-6284
287
PROBLEM SOLUTIONS
PROBLEM:-
capacity?
Processor addressing
capacity relates the maximum number
of bytes to which a processor has
access,as determined by the number of
address lines (address width ) the
processor has.
SOLUTION
DTEIT 19/8/
:-
CG-6284
288
PROBLEM SOLUTIONS
DTEIT 19/8/
CG-6284
289
PROBLEM SOLUTIONS
CG-6284
290
PROBLEM SOLUTIONS
Problem :- What cases the electron beam
to move across the screen in regular
pattern in a raster scan CRT ?
Solution:- The deflection yoke which is
connected to the sweep generator creates a
fluctuating
electric
or
magnetic
potential.The change in potential causes
the electron to be deflected.
DTEIT 19/8/
CG-6284
291
PROBLEM SOLUTIONS
Problem :- What is persistence ?
exhibited
by
phosphor.
DTEIT 19/8/
CG-6284
292
PROBLEM SOLUTIONS
Problem :- What are some of the more
CG-6284
293
PROBLEM SOLUTIONS
Problem
:-
WHAT
COMPONENTS
ARE
OF
THE
THE
MAJOR
PLASMA
DISPLAY ?
SOLUTION:- THE MAJOR COMPONENTS OF
A PLASMA DISPLAY ARE THE CATHODES,
ANODES,
GAS
CELLS,
AND
GLASS
PLATES .
DTEIT 19/8/
CG-6284
294
PROBLEM SOLUTIONS
Problem :- WHAT ARE THE MAJOR
COMPONENTS OF AN LCD ?
SOLUTION :- THE MAJOR COMPONENTS
OF AN LCD ARE THE CODUCTIVE
COATING, THE TRANSPARENT PLATE,
THE LIQUID CRYSTAL AND THE
POLARIZED FILM.
DTEIT 19/8/
CG-6284
295
PROBLEM SOLUTIONS
Problem :- What are the major
components of a memory-tube crt ?
Solution :- The major components of
memory-tube CRT are the right gun,
the flooding gun, the collector, the
phosphorous-coated screen, and the
collector ground.
DTEIT 19/8/
CG-6284
296
PROBLEM SOLUTIONS
Problem :- What are the differences
between raster-scan CRT and randomaccess or vector CRT ?
Solution:- Random-access CRT do not
follow
a
regular
scanning
pattern.Instead, the electron beam is
directed from one point to another in
the order in which the points were
DTEIT 19/8/
CG-6284
297
PROBLEM SOLUTIONS
Originally plotted.This method allows
the random-access CRT to present
much better animation than a rasterscan CRT. Memory requirements are
also reduced because a coordinate list
is stored rather than memory map.
DTEIT 19/8/
CG-6284
298
PROBLEM SOLUTIONS
Problem :- What is the major
with random-access CRT
problem
application?
DTEIT 19/8/
CG-6284
299
PROBLEM SOLUTIONS
DTEIT 19/8/
CG-6284
300
PROBLEM SOLUTIONS
Problem :- WHAT ARE THE MAJOR
COMPONENTS OF AN LCD ?
SOLUTION :- THE MAJOR COMPONENTS
OF AN LCD ARE THE CODUCTIVE
COATING, THE TRANSPARENT PLATE,
THE LIQUID CRYSTAL AND THE
POLARIZED FILM.
DTEIT 19/8/
CG-6284
301
PROBLEM SOLUTIONS`
CG-6284
302
PROBLEM SOLUTIONS
Problem :- What is the major
difference between a flatbed plotter
and a drum plotter ?
Solution :- The drum plotter moves the
paper to change the y axis. The flatbed
plotter moves the pen.
DTEIT 19/8/
CG-6284
303
PROBLEM SOLUTIONS
There are four steps involve
converting Cartesian coordinates into
a form the computer can understand
these four steps are:
DTEIT 19/8/
CG-6284
304
Locate the address of the byte in which
the point will be represented.
Locate the bit which will represent the
correct pixel.
Logically OR the calculated value with
the present value of the byte.
DTEIT 19/8/
CG-6284
305
PROBLEM SOLUTIONS
CG-6284
306
PROBLEM SOLUTIONS
CG-6284
307
PROBLEM SOLUTIONS
PROBLEM :- What causes the electron beam the
move across the screen in a regular pattern in a
raster-scan CRT ?
SOLUTION :- The deflection yoke which is
connected to the sweep generator creates a
fluctuating electric or magnetic potential. The
change in potential causes the electron beam to be
deflected.
DTEIT 19/8/
CG-6284
308
PROBLEM SOLUTIONS
exhibited
of
by
phosphor.
DTEIT 19/8/
CG-6284
309
PROBLEM SOLUTIONS
DTEIT 19/8/
CG-6284
310
PROBLEM SOLUTIONS
PROBLEM:-
What
are
the
major
DTEIT 19/8/
CG-6284
311
PROBLEM SOLUTIONS
PROBLEM:- What are
components of an LCD ?
the
major
CG-6284
312
PROBLEM SOLUTIONS
PROBLEM:- What are the major
components of a memory-tube CRT ?
SOLUTION:- The major components
of a memory-tube CRT are the write
gun, the flooding gun , the collector, the
phosphorus-coated screen , and the
collector ground.
DTEIT 19/8/
CG-6284
313
PROBLEM SOLUTIONS
PROBLEM:- What are the differences
between raster-scan CRTs and random-access
or vector CRTs ?
SOLUTION:- Random-access CRTs do not
follow a regular scanning pattern. Instead, the
electron beam is directed from one point to
another in order in which the points originally
plotted.
DTEIT 19/8/
CG-6284
314
PROBLEM SOLUTIONS
PROBLEM:- What is a major problem with
random-access CRT application ?
SOLUTION:- When the coordinate data list
becomes too long , the display will begin to
flicker.
DTEIT 19/8/
CG-6284
315
PROBLEM SOLUTIONS
DTEIT 19/8/
CG-6284
316
PROBLEM
:-
What
are
the
major
DTEIT 19/8/
CG-6284
317
PROBLEM SOLUTIONS
CG-6284
318
EXERCISE
List
the
disadvantages
relative
of
advantages
the
major
and
display
DTEIT 19/8/
CG-6284
319
EXERCISE
DTEIT 19/8/
CG-6284
320
EXERCISE
CG-6284
321
EXERCISE
Compare
the
functions
performed
by
CG-6284
322
EXERCISE
DTEIT 19/8/
CG-6284
323
DTEIT 19/8/
CG-6284
324
OUTPUT PRIMITIVES
POINT PLOTTING,
LINE DRAWING ALGORITHMS#
DDA ALGORITHMS,
#
BRESENHAMS LINE ALGORITHMS,
CIRCLE GENERATING ALGORITHMS,
ELLIPSES,
ATTRIBUTES AND
CONSTRUCTION TECHNIQUES.
DTEIT 19/8/
CG-6284
325
OUTPUT PRIMITIVES
POINTS AND LINES,
LINE-DRAWING ALGORITHMS,
a. DDA-ALGORITHAM,
b. BRESENHAMS LINEALGORITHAM,
CIRCLE GENERATING ALGORITHAM,
MIDPOINT CIRCLE ALGORITHAM,
ELLIPSE GENERATING ALGORITHAMS,
MIDPOINT ELLIPSE ALGORITHAM.
DTEIT 19/8/
CG-6284
326
Point
plotting is accomplished by
converting a single coordinate position
furnished by an application program into
appropriate operation for the output device
in use.
y
point
DTEIT 19/8/
CG-6284
327
DTEIT 19/8/
CG-6284
328
DTEIT 19/8/
CG-6284
329
Line
line
endpoints
x
DTEIT 19/8/
CG-6284
330
CG-6284
331
LINE
DTEIT 19/8/
CG-6284
332
DTEIT 19/8/
CG-6284
333
LINE
CG-6284
334
LINE
We will assume that pixel positions are of
referenced according scan line number and
column number ( pixel position across a scan
line ).
CG-6284
335
CG-6284
336
5
4
3
2
1
0
PIXEL COLUMN
NUMBER
CG-6284
337
retrieve
intensity
the
current
setting
for
frame-buffer
a
specified
location.
DTEIT 19/8/
CG-6284
338
LINE-DRAWING ALGORITHMS
Line-drawing algorithms are the cartesian
slope-intercept equation for a straight line is
y = m.x+b
-----(1)
with m representing the slope of the line
and
b as the y intercept.
Given that the two endpoints of a line
segment are specified at position (x1, y1)
and (x2, y2).
DTEIT 19/8/
CG-6284
339
y2
y1
CG-6284
x1
x2
340
LINE-DRAWING ALGORITHMS
For any given x interval along a line ,we can
compute the corresponding y interval
from :
y=m. x -----(4)
Similarly, we can obtain the x interval x
corresponding to a specified y as
x =y/m -----(5)
These equations form the basis for determining
deflection voltages in analog device.
DTEIT 19/8/
CG-6284
341
For lines whose slopes have
magnitude
|m|<1 , x can be set
proportional to a small horizontal
deflection
voltage
and
the
corresponding vertical deflection is
then set proportional to y.
For lines whose slopes have
magnitudes |m| > 1 , y can be set
proportional to a small vertical
deflection voltage set proportional to
x.
DTEIT 19/8/
CG-6284
342
LINE-DRAWING ALGORITHMS
Y2
Y1
X1
X2
CG-6284
343
DDA - ALGORITHM
The digital differential analyzer (dda) is
a scan-concersion line algorithm
based
on calculating either y or x using
equation
y=m x
x= y/m
DTEIT 19/8/
CG-6284
344
DDA - ALGORITHM
CG-6284
345
DDA - ALGORITHM
Subscript k takes integer value starting
from 1,for the first point and increases by
one until the final endpoint is reached.
Since m can be any real number between 0
& 1, the calculated y values must be
rounded to the nearest integer.
DTEIT 19/8/
CG-6284
346
DDA - ALGORITHM
CG-6284
347
DDA - ALGORITHM
If this processing is reversed , so that the
starting point is at right, then either we have dx
= -1and
Yk+1=yk-m -----(8)
Xk+1=xk-1/m -----(9)
These two equations can be used to calculate
pixel positions along a line with negative slope.
DTEIT 19/8/
CG-6284
348
DDA - ALGORITHM
If the absolute value of slope is less than one
and the start endpoint is at left, we set x=1
and calculate y values.
When the start endpoint is at right we set x=
-1 and obtain y positions.
When the absolute value of a negative slope is
greater than one we use y=-1.
DTEIT 19/8/
CG-6284
349
DDA - ALGORITHM
Procedure line DDA.(Xa,ya,xb,yb : integer
var
dx, dy, steps, k : integer;
xinctrment, yincrement, x, y: real;
begin
dx := xb - xa ; dy := yb - ya;
if abs(dx)>abs(dy) then steps :=abs(dx)
DTEIT 19/8/
CG-6284
);
350
DDA - ALGORITHM
DTEIT 19/8/
CG-6284
351
DTEIT 19/8/
CG-6284
352
CG-6284
353
DTEIT 19/8/
CG-6284
354
DTEIT 19/8/
CG-6284
355
DTEIT 19/8/
CG-6284
356
DTEIT 19/8/
CG-6284
357
Y k+1
d1
yk
d2
x k+1
DISTANCES
BETWEEN
PIXEL POSITIONS AND
THE LINE y COORDINATE
AT SAMPLING POSITION
xk+1
DTEIT 19/8/
CG-6284
358
DTEIT 19/8/
CG-6284
359
CG-6284
360
Pk+1=2ay.Xk+1 - 2ax.Yk+1 + c
CG-6284
361
CG-6284
362
DTEIT 19/8/
CG-6284
363
CG-6284
364
CG-6284
365
position(x,y) is calculated as :
addr(x,y)=addr(0,0)+y(xmax+1)+x
Moving across a scan line, we can calculate
the frame-buffer address for the pixel at
DTEIT 19/8/
CG-6284
366
addr(x+1,y)=addr(x,y)+1
DTEIT 19/8/
CG-6284
367
DTEIT 19/8/
CG-6284
368
DTEIT 19/8/
CG-6284
369
GENERATING
ALGORITHAM CIRCLE
(x - xc)^2 +
CG-6284
370
MIDPOINT ALGORITHM
To apply the midpoint method
we define the circle function .
yk
yk-1
X 2+ y2 - r2 = 0
Midpoint
xk
CG-6284
yk+1
yk+2
MIDPOINT
BETBEEN
CANDIDATE PIXELS AT
SAMPLING POSITION
xk+1
ALONG
A
CIRCULAR PATH
371
MIDPOINT CIRCLE
ALGORITHAM
1. Input radius r and circle center (xc, yc) and obtain
the first point on the circumference of a circle
centered on the origin as
(x0,y0) = (0,r)
2.
decision
p0=5/4 - r
DTEIT 19/8/
CG-6284
372
DTEIT 19/8/
CG-6284
373
octants.
5. Move each calculated pixel position (x, y)
onto the circular path centered on (xc, yc)and
plot the coordinate values:
x=x+xc, y=y+yc
6. Repeat step 3 through 5 until x>=y
DTEIT 19/8/
CG-6284
374
ELLIPSE-GENERATING ALGORITHMS
PROPERTIES OF ELLIPSES :
An ellipse is defined as the set of points such that the sum
of the distances from two fixed positions (foci) is the same for
all points. If the distances to the two foci from any point p=(x,
y) on the ellipse are labeled d1 and d2, then the general
equation of an ellipse can be stated as
d1+d2=constant
DTEIT 19/8/
CG-6284
375
ELLIPSE-GENERATING ALGORITHMS
expressing distances d1 and d2 in terms of the focal coordinates
f1=(x1,y1)andf2=(x1,y2),we have
((X-x2)^2+(y-y1)^2 + (x-x2)^2+(y-y2)^2)^1/2= constant. The
general ellipse equation in the form
X^2+by^2+cxy+dx+ey+f=0
Expressing distances d1 and d2 in terms of the focal coordinates
f1=(x1,y1) and f2=(x1,y2),
DTEIT 19/8/
CG-6284
376
ELLIPSE-GENERATING ALGORITHMS
we have
y
F1
d1
F2 d2
p=(x,y)
ELLIPSE GENERATED
ABOUT FOCI F1 AND F2
DTEIT 19/8/
CG-6284
377
ELLIPSE-GENERATING ALGORITHMS
Symmetry of an ellipse.
(-x,y)
ry (x,y)
(x,y)
rx
(-x,-y)
Calculation of a point
(x,-y)
in
one
quadrant
DTEIT 19/8/
CG-6284
378
ELLIPSE-GENERATING ALGORITHMS
DTEIT 19/8/
CG-6284
379
ELLIPSE-GENERATING ALGORITHMS
ry
rx
yc
xc
DTEIT 19/8/
CG-6284
380
ELLIPSE-GENERATING ALGORITHMS
Which has the following properties:
Fellipse(x,y) {<0, if(x,y)is inside the
ellipse boundary
ellipse boundary
DTEIT 19/8/
CG-6284
381
DTEIT 19/8/
CG-6284
382
Ellipse
Algorithm
3. AtMidpoint
each xk position
in region
1, starting at k=0,
perform the following test: if p1k<0, the next point
along the ellipse centered on (0,0) is (xk+1, yk) and
P1k+1=p1k+2ry^2xk+1+ry^2
Otherwise,next point along the circle is (xk+1,yk-1)
and p1k+1=p1k + 2ry^2xk+1 -2rx^2yk+1 + ry^2
DTEIT 19/8/
CG-6284
383
DTEIT 19/8/
CG-6284
384
yk
midpoint
yk+1
xk
xk+1
DTEIT 19/8/
CG-6284
385
(xk+1,yk-1)
DTEIT 19/8/
CG-6284
386
y = y+yc
CG-6284
387
DTEIT 19/8/
CG-6284
388
DTEIT 19/8/
CG-6284
389
DTEIT 19/8/
CG-6284
390
p1k
(xk+1, yk+1)
0
1
2
3
4
5
6
-332
-224
-44
208
-108
288
244
(1,6)
(2,6)
(3,6)
(4,5)
(5,5)
(6,4)
(7,3)
DTEIT 19/8/
2ry2 xk+1
2rx2 yk+1
72
144
216
288
360
432
504
768
768
768
640
640
512
384
CG-6284
391
DTEIT 19/8/
CG-6284
392
(xk+1, yk+1)
(8,2)
(8,1)
(8,0)
2ry2 xk+1
2rx2 yk+1
576 256
576 128
--CG-6284
393
DTEIT 19/8/
CG-6284
394
6
5
4
3
2
1
0
0 1 2 3 4 5 6 7 8
CG-6284
395
DTEIT 19/8/
CG-6284
396
DTEIT 19/8/
CG-6284
397
Twory2 := 2* ry2;
Tworx2 := 2* rx2;
{ Region 1 }
x := 0;
Y := ry;
Plotpoints;
P :=round ( ry2 - rx2 * ry + (0.25* rx2));
Px :=0;
DTEIT 19/8/
CG-6284
398
DTEIT 19/8/
CG-6284
399
{ region 2 }
DTEIT 19/8/
CG-6284
400
rx2* (y - 1)
while y > 0 do
Begin
Y := y -1;
Py := py - tworx2;
If p <= 0 then
begin
DTEIT 19/8/
CG-6284
401
CG-6284
402
ATTRIBUTES
Any parameter that affects the way a
primitive is to be displayed is referred to as
an attribute parameter.
Some attribute parameters, such as color &
size , determine the fundamental
characteristics of a primitive.
DTEIT 19/8/
CG-6284
403
ATTRIBUTES
Others specified how the primitive is to be
displayed under special conditions.
Example of attributes in this class include
depth information for 3-d viewing &
visibility or detectability options for
interactive object selection programs
DTEIT 19/8/
CG-6284
404
ATTRIBUTES
Attributes that control the basic
CG-6284
405
ATTRIBUTES
Areas might be filled with one color
CG-6284
406
ATTRIBUTES
Individual character can be displayed
DTEIT 19/8/
CG-6284
407
LINE ATTRIBUTES
Basic attributes of a straight line segment
DTEIT 19/8/
CG-6284
408
LINE TYPE
Possible selections for the line type
attribute include solid lines, dashed lines &
dotted lines.
We modify a line -drawing algorithm to
generate such lines by setting the length &
spacing of displayed solid.
DTEIT 19/8/
CG-6284
409
LINE TYPE
That is equal to the length of the solid
sections along the line path.
A dashed line could be displayed by
generating an interdash spacing sections.
DTEIT 19/8/
CG-6284
410
LINE TYPE
Both the length of the dashes & the
interdash spacing are often specified as user
options.
A doted line can be displayed by
generating very short dashes with the
spacing equal to or greater than the dash.
DTEIT 19/8/
CG-6284
411
LINE TYPE
Size, similar methods are used to produce
other line type variations.
To set line type attributes in a phigs
application program, a user invokes the
function.
Setlinetype(it)
Where parameter it is
DTEIT 19/8/
CG-6284
412
LINE TYPE
Setlinestyle
Declaration:
Void far setlinestyle(int linestyle, unsigned
upattern, int thickness);
DTEIT 19/8/
CG-6284
413
LINE TYPE
Remarks:
Setlinestyle sets the style for all lines drawn
by line, lineto, rectangle,
Drawpoly, etc.
Return value : if invalid input is passed to
setlinestyle, graphresult returns -11, and the
Current line style remains unchanged.
DTEIT 19/8/
CG-6284
414
LINE TYPE
Example:
#Include <graphics.H>
#Include <stdlib.H>
#Include <string.H>
#Include <stdio.H>
#Include <conio.H>
/* The names of the line styles supported */
Char *lname[] = {
"solid_line",
DTEIT 19/8/
CG-6284
415
LINE TYPE
"Dotted_line",
"Center_line",
"Dashed_line",
"Userbit_line"
};
Int main(void)
{
/* request auto detection */
DTEIT 19/8/
CG-6284
416
LINE TYPE
Int gdriver = DETECT, gmode;
Int style, midx, midy, userpat;
Char stylestr[40];
/* Initialize graphics and local variables */
initgraph(&gdriver, &gmode, "");
midx = getmaxx() / 2;
Midy = getmaxy() / 2;
/* A user defined line pattern */
/* binary: "0000000000000001" */
userpat = 1;
DTEIT 19/8/
CG-6284
417
LINE TYPE
For (style=solid_line; style<=userbit_line; style++)
{
Setlinestyle(style, userpat, 1);
/* Convert style into a string */
strcpy(stylestr, lname[style]);
/* Draw a line */
line(0, 0, midx-10, midy);
/* Draw a rectangle */
DTEIT 19/8/
CG-6284
418
LINE TYPE
rectangle(0, 0, getmaxx(), getmaxy());
/* Output a message */
outtextxy(midx, midy, stylestr);
/* Wait for a key */
getch();
Cleardevice();
}
/* Clean up */
closegraph();
Return 0;
}
DTEIT 19/8/
CG-6284
419
LINE WIDTH
Implementation of line width options
depends on the capabilities of the output
device.
A heavy line on a video monitor could be
displayed as adjacent parallel lines , while a
pen plotted might require pen changes.
DTEIT 19/8/
CG-6284
420
LINE WIDTH
We set the line width attribute with the
command :
Setlinewidthscalefactor (lw)
Linewidth parameter lw is assigned a
positive no to indicate the relative width of
the line to be displayed.
DTEIT 19/8/
CG-6284
421
LINE WIDTH
A value of one specifies a standard width
line.
On a pen plotter, for instance, a user could
set lw to value of 0.5 to plot a line whose
width is half that of the standard line.
DTEIT 19/8/
CG-6284
422
LINE WIDTH
Values grater than 1 produce lines thicker
than the standard.
For raster implementation, a standard width
line is generated with single line pixels at
each sample position, as in the bresenham
algorithm.
DTEIT 19/8/
CG-6284
423
LINE WIDTH
Other width lines are dirplaed as positive
integer multiples of the standard line by plotting
additional pixels along adjacent parallel line
paths.
For lines with slope magnitude less than 1, we
can modify a line drawing routine to display
thick lines by plotting a vertical span of pixels at
each x positions along the line.
DTEIT 19/8/
CG-6284
424
LINE WIDTH
We plot a double width line by generating a
parallel line above the original line path.
For lines with slope magnitude greater than
1, we can plot thick lines with horizontal
spans, alternately picking up pixels to the
right & left of the line path.
DTEIT 19/8/
CG-6284
425
LINE WIDTH
Another problem with implementing width
options using horizontal or vertical pixel
spans is that the method produce lines
whose ends are horizontal or vertical
regardless of the slope of the line.
DTEIT 19/8/
CG-6284
426
LINE WIDTH
This effect is more noticeable with very
thick lines.
We can adjust the shape of the line ends to
give them a better appearance by adding
line caps.
DTEIT 19/8/
CG-6284
427
LINE WIDTH
DTEIT 19/8/
CG-6284
428
LINE WIDTH
Another line cap is the round cap obtained
by adding a filled semicircle to each butt cap.
The circular arcs are centered on the line
endpoints & have a diameter equal to the line
thickness.
A third type of line cap is the projective
square cap.
DTEIT 19/8/
CG-6284
429
LINE WIDTH
Other methods for producing thick lines
include displaying the line as a filled
rectangle or generating the line with a
selected pan or brush pattern.
DTEIT 19/8/
CG-6284
430
LINE WIDTH
DTEIT 19/8/
CG-6284
431
LINE WIDTH
DTEIT 19/8/
CG-6284
432
LINE WIDTH
Displaying thick lines using horizontal &
vertical pixel spans, for example, leaves
pixel gaps at the boundaries between lines
of different slopes where there is a shift
from horizontal spans to vertical spans.
DTEIT 19/8/
CG-6284
433
LINE WIDTH
We can generate thick polylines that are
smoothly joined at the cost of additional
processing at the segment end points.
DTEIT 19/8/
CG-6284
434
LINE WIDTH
Three possible methods for smoothly joining
DTEIT 19/8/
CG-6284
435
LINE WIDTH
CG-6284
436
MITER JOIN
DTEIT 19/8/
ROUND JOIN
CG-6284
BEVEL JOIN
437
CG-6284
438
DTEIT 19/8/
CG-6284
439
DTEIT 19/8/
CG-6284
440
LINE COLOR
When a system provides color (or
intensity) options, a parameter giving the
current color index is included in the list of
system- attribute values.
DTEIT 19/8/
CG-6284
441
LINE COLOR
A polyline routine displays a line in the
current color by setting this color value in
the frame buffer at pixel locations along the
line path using the set pixel procedure.
DTEIT 19/8/
CG-6284
442
LINE COLOR
The number of color choices depends upon
the no. Of bits available per pixel in the
frame buffer.
We set the line color value in phigs with
the function :
Setpolylinecolourindex (lc).
DTEIT 19/8/
CG-6284
443
LINE COLOR
Nonnegative integer values, corresponding
to allowed color choices, are assigned to the
line color parameter lc.
A line drawn in the background color is
invisible, & user can erase a previously line
by sespecifying it in the background color.
DTEIT 19/8/
CG-6284
444
LINE COLOR
Example :this program segment would
display two figures, drawn with doublewide dashed lines.The first is displayed in a
color corresponding to code 5, & second in
color 6.
DTEIT 19/8/
CG-6284
445
LINE COLOR
setLinetype(2);
setLinewidthScaleFactor(2);
setPolylineColorIndex(5);
polyline(n1, wcpoints1);
setPolylineColorIndex(6);
polyline(n2, wcpoints2);
DTEIT 19/8/
CG-6284
446
DTEIT 19/8/
CG-6284
447
LINE
PATH
DTEIT 19/8/
CG-6284
448
DTEIT 19/8/
CG-6284
449
CURVE ATTRIBUTES
Parameters for curve attributes are same as
those for line segments.
We can display curves with varying colors,
widths, dot-dash patterns & available pen or
brush options.
DTEIT 19/8/
CG-6284
450
CURVE ATTRIBUTES
Methods for adapting curve-drawing
algorithms to accommodate attribute
selections are similar to those for line
drawing.
The pixel masks are used also uased in raster
curve algorithms to generate dashed or
dotted patterns.
DTEIT 19/8/
CG-6284
451
CURVE ATTRIBUTES
We can generate the dashes in the various
octant using circle symmetry, but we must shift
the pixel positions to maintain the correct
sequence of dashes.
Raster curves of various widths can be
displayed using the method of horizontal or
vertical pixel spans.
DTEIT 19/8/
CG-6284
452
CURVE ATTRIBUTES
Where the magnitude of the curve slope is
less than one, we plot vertical spans; where
the slope magnitude is greater than one, we
plot horizontal span.
Figure demonstrates this method for
displaying a circular arcs of width four in
the first quadrant.
DTEIT 19/8/
CG-6284
453
CG-6284
454
CURVE ATTRIBUTES
Using a circle symmetry, we generate the circle path
with vertical spans in the octant from x=0 to x=y &
then reflect pixel positions about the line y=x to
obtain the reminder of the curve shown.
Circle sections in the other quadrants are obtained
by reflecting pixel positions in the first quadrant
about the coordinate axes.
DTEIT 19/8/
CG-6284
455
CURVE ATTRIBUTES
DTEIT 19/8/
CG-6284
456
CURVE ATTRIBUTES
We could do this using the specified curve path as
one boundary & setting up the second boundary
either inside or outside the original curve path.
Disadvantage : this approach , however , shifts
the original curve path either inward or outward,
depending on which direction we choose for the
second boundary.
DTEIT 19/8/
CG-6284
457
CURVE ATTRIBUTES
We can maintain the original curve position by
setting the two boundary curves at a distance of
one half the width on either side of the specified
curve path.
An example of this approach is shown in figure,
for a circle segment with radius 16 & a specified
width of four.
DTEIT 19/8/
CG-6284
458
DTEIT 19/8/
CG-6284
459
CURVE ATTRIBUTES
The boundary arcs are then set at a separation
distance of two on either side of the radius of 16.
To maintain the proper dimensions of the circular
arcs, we can set the radii for the concentric boundary
arcs at r=14 & r=17.
The inner & outer boundaries of a fat ellipse
generated with this method do not have the same
foci.
DTEIT 19/8/
CG-6284
460
CURVE ATTRIBUTES
Pen (or brush) displays of curves are
generated using the same techniques.
We replicate a pen shape along the line
path, as illustrated in figure, for circular arc
in the first quadrant.
DTEIT 19/8/
CG-6284
461
DTEIT 19/8/
CG-6284
462
DTEIT 19/8/
CG-6284
463
CG-6284
464
DTEIT 19/8/
CG-6284
465
THE 8 COLOR CODES FOR A THREE BIT PER PIXEL FRAME BUFFER
Code
0 0
1 0
2 0
3 0
4 1
5 1
6 1
7 1
DTEIT 19/8/
Red
0
0
1
1
0
0
1
1
Green
0
1
0
1
0
1
0
1
Blue
Black
Blue
Green
Cyan
Red
Magenta
Yellow
White
CG-6284
466
CG-6284
467
DTEIT 19/8/
CG-6284
468
COLOR
LOOKUP
TABLE
TO RED GUN
TO GREEN GUN
TO BLUE GUN
Y 196
196
2081
255
X
A COLOR LOOKUP TABLE WITH 24 BITS PER ENTRY
ACCESED FROM A FRAME BUFFERWITH 8 BITS PER PIXEL.
A VALUE OF 196 STORED AT PIXEL POSITION ( X, Y)
REFERENCES THE LOCATION IN THIS TABLE CONTAINING
THEVALUE 2081.
DTEIT 19/8/
CG-6284
469
DTEIT 19/8/
CG-6284
470
CG-6284
471
CG-6284
472
CG-6284
473
GRAYSCALE
With monitors that have no color capabilities,
color functions can be used in an application
program to set the shades of gray, or gray
scale, for displayed primitives. Numeric values
over the range 0 to 1 can be used to specify the
gray scale levels, which are then converted to
appropriate binary codes for storage in the
raster.
DTEIT 19/8/
CG-6284
474
GRAYSCALE
DTEIT 19/8/
CG-6284
475
GRAYSCALE
In this case, a color table for a
monochrome monitor can be setup using a
range of RGB values as in fig, with the
display intensity corresponding to a given
color index ci calculated as:
intensity= 0.5 [ min(r,g,b) + max(r, g, b)]
DTEIT 19/8/
CG-6284
476
DISPLAYED
GRAYSCALE
0.0
0.33
0.67
1.0
DTEIT 19/8/
0
1
2
3
(00)
(01)
(10)
(11)
CG-6284
Black
Dark gray
Light gray
White
477
CG-6284
478
FILL STYLES
Areas are displayed with three basic fill styles:hollow with a color border, filled with a solid
color or filled with a specified pattern or design.
A basic fill style is selected in a PHIGS
program with the function.
Setinteriorstyle (fs)
Pattern fill
Soft fill
DTEIT 19/8/
CG-6284
479
FILL STYLES
Values for the fill style parameter fs
includes hollow, solid and pattern.
Another values for fill style is hatch, which
is used to fill an area with selected hatching
patterns- parallel lines or crossed lines .
DTEIT 19/8/
CG-6284
480
FILL STYLES
HOLLOW
SOLID
PATTERNED
DTEIT 19/8/
CG-6284
481
PATTERN FILL
AND
OR
PATTERN
BACKGROUND
XOR
CHARACTER ATTRIBUTES
The appearance of displayed is controlled
by attributes such as font size, color, and
orientation.
Attributes can be set both for entire
character strings (text) and for individual
characters defined as marker symbols.
DTEIT 19/8/
CG-6284
483
TEXT ATTRIBUTES
There are a great many text options that
can be made available to graphics
programmer's.
First of all, there is the choice of font
which is a set of characters with a particular
design style such as arial, times new roman.
DTEIT 19/8/
CG-6284
484
TEXT ATTRIBUTES
The character in a selected can also be
displayed with assorted underlying styles
(solid dotted , double ), in bold face, in italics,
and in out line or shadow styles.
A particular font & associated style is selected
in a PHIGS program by setting an integer code
for the text font parameter tf in the function :
settextfont (tf)
DTEIT 19/8/
CG-6284
485
Character body
kern
top
cap
H f j
Character
height
base
bottom
kern
CG-6284
486
Height 1
Height 1
Height 3
THE
EFFECT
OF
DIFFERENT CHARACTER
HEIGHT SETTINGS ON
DISPLAYED TEXT.
CG-6284
487
Width 0.5
Width 1.0
Width 2.0
CG-6284
488
Spacing 1.0
Spacing 0.0
Spacing 0.5
DTEIT 19/8/
CG-6284
489
SL
A
UP VECTOR
NT
ED
TE
X
DIRECTION
OF
UP
VECTOR & CONTROLS
THE ORIENTATION OF
DISPLAYED TEXT.
CG-6284
490
V
E
R
T
HORIZONTAL TEXT
I
C
A
L
CG-6284
491
S
T
R
I
N
G
top
cap
top
STRING
cap
half
base
bottom
half
base
bottom
DTEIT 19/8/
ALIGNMENT
ATTRIBUTE
VALUES FOR HORIZONTAL
& VERTICAL STRINGS
CG-6284
492
P
U
FT
LE
UP VECTORS TO CONTROL
THE DIRECTION OF THE
TEXT PATH
D
N
H
IG
R
W
O
DTEIT 19/8/
CG-6284
493
DTEIT 19/8/
CG-6284
494
MARKER ATTRIBUTES
A marker symbol is a single character that can be
displayed in different colors & in different sizes.
Marker attributes are implemented by procedures
that load the chosen character into the raster at the
defined positions with the specified color & size.
We select a particular character to be the marker
symbol with :
DTEIT 19/8/
CG-6284
495
MARKER ATTRIBUTES
setMarkerType(mt)
where the marker type parameter mt is set to an
integer code. Typical codes for marker type are the
integers 1 through 5.
We set the marker size with :
setMarkerSizeScaleFactor(ms)
with parameter marker size ms assigned a positive
no.
DTEIT 19/8/
CG-6284
496
MARKER ATTRIBUTES
Marker color is specified with :
setpolymarkercolorindex(mc)
A selected color code for parameter mc is
stored in the current attribute list & used to
display subsequently specified marker
primitives.
DTEIT 19/8/
CG-6284
497
OUTPUT
PRIMITIVE
TYPE
ASSOCIATED
ATTRIBUTES
ATTRIBUTE SETTING
FUNCTIONS
Line
Type setLinetype
Width
setLineWidthScaleFactor
Color
setPolylineColorIndex
Text
Font setTextFont
Color
setTextColorIndex
Size
setCharcterHeight
setCharcterExpansionFactor
Orientation
setCharcterUpVector
setTextPath
setTextAlignment
DTEIT 19/8/
CG-6284
498
OUTPUT
PRIMITIVE
TYPE
ASSOCIATED
ATTRIBUTES
Fill Area
Fill Style
Fill Color
Pattern
Marker
Type
Size
Color
DTEIT 19/8/
ATTRIBUTE SETTING
FUNCTIONS
setInteriorStyle
setInteriorColorIndex
setInteriorStyleIndex
setPatternRepresentation
setPatternsize
setPatternReferencePoint
setMarkerType
setMarkersizeScaleFactor
setPolyMarkerColourIndex
CG-6284
499
EXERCISE 2
Write a program to draw a line using
DDA algorithm in C language.
Write a program to draw a line using
Bresenhams algorithm using C
language.
Write a program to draw a circle using
mid-point algorithm using C language.
DTEIT 19/8/
CG-6284
500
EXERCISE 2
Modify mid-point circle algorithm to display
ellipse, as specified by input values for the
ellipse center and the major and minor
axis.Write a program to implement this
algorithm on your system.
Using DDA algorithm draw a triangle,
rectangle etc.
DTEIT 19/8/
CG-6284
501
EXERCISE 2
Modify a line-drawing algorithm so that
the intensity of the output is set
according to its slope.That is by
adjusting pixel intensity according to the
value of the slope, all lines are displayed
with the same intensity per unit length.
DTEIT 19/8/
CG-6284
502
DTEIT 19/8/
CG-6284
503