graphics 1
graphics 1
Introduction
1. Introduction to Computer
Graphics
The computer graphics is one of the most effective and
commonly used way to communicate the processed
information to the user.
It displays the information in the form of graphics
objects such as pictures, charts, graphs and diagrams
instead of simple text.
The processing of geometric primitive with pixel level in
an image or graphical image.
In computer graphics, pictures or graphics objects are
presented as a collection of discrete picture elements
called pixels.
Applications of Computer
Graphics
User Interfaces
Plotting of graphics and chart
Office automation and Desktop publishing
Computer-aided drafting and design
Simulation and Animation
Art and Commerce
Process Control
Cartography
Classification of CG
Applications
2. Video Display Devices
Frame: Where the term frame refers to the total screen area. This memory
area holds the set of color values for the screen points.
Pixel or pel: Each screen spot that can be illuminated by the electron beam is
referred to as a pixel.
Aspect ratio: the number of pixel columns divided by the number of scan lines
that can be displayed by the systems. 4/3
Raster-Scan Displays…
Raster Scan Display
Architecture
Random-Scan Displays
Keyboard.
Mouse
Microphone
Digital
Camera
Scanner
The Keyboard
The most commonly used input device is the
keyboard on which data is entered by manually
keying in or typing certain keys. A keyboard
typically has 101 or 105 keys.
Keyboard
BUT
mouse
tracker ball
track point
touchpad…
Indirect pointing
devices - other
Tracker ball, trackpad, trackpoint
Less space on desktop
Good in moving environments, e.g.
car, train
Indirect pointing devices -
other
Joystick
The main use of a joystick is to
play computer games by
controlling the way that
something moves on the
screen.
Microphones - Speech Recognition
Text output
Graphics output
Video output
Audio output
Output Devices: Engaging our Senses
Monitors
Printers
Speakers
Data Projectors
Monitors
CRT LCD
Laser Printer
More expensive, faster, lower per page
cost than ink jet,
Printers
A printer is a peripheral device that
produces a physical copy or hard
copy of the computer’s output.
Types of Printers
Inkjet Laser
A plotter is a printer that uses a pen that moves over a large revolving
sheet of paper.
It is used in engineering, drafting, map making, and seismology.
Audio Output: Sound Cards and
Speakers
Immersion
VR Triangle or I3
Imaginatio Interactio
n n
What is Virtual Reality?
Definition:
Virtual Reality is a high-end user-computer interface that involves real-
time simulation and interactions through multiple sensorial channels.
These sensorial modalities are visual, auditory, tactile, smell and taste.
Modeling
Geometric modeling
Kinematics modeling
Physical modeling
Behavior modeling
Model management
Continue…
Travel
Wayfinding
Hand Dataglove…
Eye Tracker
Virtual Reality Equipments
Hand Dataglove
Continue…
Hand Dataglove
Continue…
Face tracker
Virtual Reality tools and
packages
Cortona 3D
VRML
OpenSceneGraph
WorldToolKit
Java 3D
APIs
AR toolkits
Demo Videos
Traditional application
Medical applications 1 2
Military VR applications 1
Continue…
VR applications in manufacturing
Applications of VR in Robotics 1 2
Information Visualization 1 2
3. Raster-Scan Systems
Open Inventor
Virtual Reality Modeling Language (VRML)
Java2D
Java3D
RenderMan Interface
Mathematica
Matlab
Maple
Problems
Bresenham’s Algorithm.
Basic concept of Line drawing
Direct use of Line Equation
Step6: Calculate m =
Advantages:
It is a faster method than method of using direct use of
line equation.
This method does not use multiplication theorem.
It allows us to detect the change in the value of x and y, so
plotting of same point twice is not possible.
This method gives overflow indication when a point is
repositioned.
It is an easy method because each step involves just two
additions.
Disadvantages of DDA
Disadvantages:
It involves floating point additions rounding off is done.
Accumulations of round off error cause accumulation of
error.
Rounding off operations and floating point operations
consumes a lot of time.
It is more suitable for generating line using the software.
But it is less suited for hardware implementation.
Example: If a line is drawn from (2, 3) to (6, 15) with use of DDA. How
many points will needed to generate such line?
Solution: P1 (2,3) P11 (6,15)
x1=2
y1=3
x2= 6
y2=15
dx = 6 - 2 = 4
dy = 15 - 3 = 12
m=
For calculating next value of x takes x = x + 1/m
Problems of DDA
1 1 d+I2=1+(-6)=-5
2 2 d+I1=-5+8=3
3 2 d+I2=3+(-6)=-3
4 3 d+I1=-3+8=5
5 3 d+I2=5+(-6)=-1
6 4 d+I1=-1+8=7
7 4 d+I2=7+(-6)=1
8 5
Difference Between DDA and
Bresenham’s Line Algorithms
DDA Algorithm Bresenham's Line Algorithm
2. DDA Algorithms uses multiplication & 2.Bresenham's Line Algorithm uses only
division its operation subtraction and addition its operation
5.DDA Algorithm can draw circle and 5. Bresenham's Line Algorithm can
curves but are not accurate as draw circle and curves with more
Bresenham's Line Algorithm accurate than DDA Algorithm.
Antialiasing of Lines
In the line drawing algorithm, we have seen that all rasterized locations
do not match with the true line and we have to select the optimum
raster locations to represent a straight line.
Increasing resolution:
Unweighted area sampling: The intensity of pixel is proportional to the
amount of line area occupied by the pixel. This technique produces
noticeably better results than does setting pixels either to full intensity or
to zero intensity.
Weighted area sampling: in weighted area sampling equal areas
contribute unequally i.e. a small area closer to the pixel center has
greater intensity than does one at a greater distance. Thus, the intensity
of the pixel is dependent on the line area occupied and the distance of
area from the pixel’s center.
Displaying Polylines
Implementation of a polyline procedure is accomplished by invoking a
line-drawing routine n-1 times to display the line connecting the n
endpoints.
Each successive call passes the coordinate pair needed to plot the next
line section, where the first endpoint of each coordinate pair is the last
endpoint of the previous section.
Once the color values for pixel positions along the first line segment have
been set in the frame buffer, we process subsequent line segments
starting with the next pixel position following the first endpoint for that
segment.
In this way, we can avoid setting the color of some endpoints twice.
Parallel Line Algorithms