CG Unit 1
CG Unit 1
Computer graphics is an art of drawing pictures, lines, charts, etc. using computers with the help of
programming. Computer graphics image is made up of number of pixels. Pixel is the smallest addressable
graphical unit represented on the computer screen.
Introduction
Computer is information processing machine. User needs to communicate with computer and the
computer graphics is one of the most effective and commonly used ways of communication with the
user.
Itdisplaystheinformationintheformofgraphicalobjectssuchaspictures,charts,diagramandgraphs.
Graphical objects convey more information in less time and easily understandable formats for example
statically graph shown in stock exchange.
Incomputergraphicspictureorgraphicsobjectsarepresentedasacollectionofdiscretepixels.
Wecancontrolintensityandcolorofpixelwhichdecidehowpicturelooklike.
The specialprocedure determineswhich pixelwill provide thebestapproximation to the desired picture or
graphics object this process is known as Rasterization.
Theprocess ofrepresentingcontinuouspictureor graphicsobjectasa collectionof discretepixelsis
called Scan Conversion.
Advantagesofcomputergraphics
Computergraphicsisoneof themost effectiveand commonlyusedwaysofcommunicationwith
computer.
It provides tools for producing picture of “real-world” as well as synthetic objects such as mathematical
surfaces in 4D and of data that have no inherent geometry such as survey result.
Ithasabilitytoshowmovingpicturesthuspossibletoproduceanimationswithcomputergraphics.
Withtheuseofcomputergraphicswecancontroltheanimationbyadjustingthespeed,portionof picture in
view the amount of detail shown and so on.
Itprovidestoolscalledmotiondynamics.Inwhichusercanmoveobjectsaswellasobservesasper requirement
for example walk throw made by builder to show flat interior and surrounding.
Itprovidesfacilitycalledupdatedynamics.Withthiswecanchangetheshapecolorandotherproperties of
object.
Now in recentdevelopment of digital signal processing and audio synthesis chip the interactive graphics
can now provide audio feedback along with the graphical feed backs.
Applicationofcomputergraphics
User interface: - Visual object which we observe on screen which communicates with user is one of the
most useful applications of the computer graphics.
Plotting of graphics and chart in industry, business, government and educational organizations drawing
like bars, pie-charts, histogram’s are very useful for quick and good decision making.
Office automation and desktop publishing: - It is used for creation and dissemination of information. Itis
used in in-house creation and printing of documents which contains text, tables,graphs and other forms
of drawn or scanned images or picture.
Computer aided drafting and design: - It uses graphics to design components and system such as
automobile bodies structures of building etc.
Simulationandanimation:-Useofgraphicsinsimulation makesmathematic modelsandmechanical systems
more realistic and easy to study.
Art and commerce: - There aremanytools provided by graphicswhich allowsused to maketheirpicture
animated and attracted which are used in advertising.
Processcontrol:-Nowaday’sautomationisusedwhichisgraphicallydisplayedonthescreen.
Cartography:-Computergraphicsisalsousedtorepresentgeographicmaps,weathermaps,
oceanographic charts etc.
Education and training: - Computer graphics can be used to generate models of physical, financial
andeconomic systems. These models can be used as educational aids.
Imageprocessing:-Itisusedtoprocessimagebychangingpropertyoftheimage.
Displaydevices
Displaydevicesarealsoknownasoutputdevices.
Mostcommonlyusedoutputdeviceinagraphicssystemisavideomonitor.
Cathode-ray-tubes
Fig.1.1:-Cathoderaytube.
Itisanevacuatedglasstube.
Anelectrongunattherearofthetubeproduceabeamofelectronswhichisdirectedtowardsthe screen of the
tube by a high voltage typically 15000 to 20000 volts
Innersidescreeniscoatedwithphosphorsubstancewhichgiveslightwhenitisstrokedbyeelectrons.
Controlgridcontrolsvelocityofelectronsbeforetheyhitthephosphor.
The control gridvoltage determines howmany electrons areactually intheelectron beam.The negative
the control voltage is the fewer the electrons that pass through the grid.
ThuscontrolgridcontrolsIntensityofthespotwherebeamstrikesthescreen.
Thefocusingsystemconcentratestheelectronbeamsoitconvergestosmallpointwhenhitsthe phosphor
coating.
Deflectionsystemdirectsbeamwhichdecidesthepointwherebeamstrikesthescreen.
DeflectionsystemoftheCRTconsistsoftwopairsofparallelplateswhichareverticalandhorizontal deflection
plates.
Voltage applied to vertical and horizontal deflection plates is control vertical and horizontal
deflectionrespectively.
TherearetwotechniquesusedforproducingimagesontheCRTscreen:
1. Vectorscan/Randomscandisplay.
2. Rasterscandisplay.
Vectorscan/Randomscandisplay
CPU
I/OPort
Displayb
ufferme (Interaction (Displayco
mory data) mmand)
Displaycontroller CRT
Keyboard Mouse
Fig.1.2:-Architectureofavectordisplay.
VectorscandisplaydirectlytracesoutonlythedesiredlinesonCRT.
If we want line between point p1 & p2 then we directly drive the beam deflection circuitry which focus
beam directly from point p1 to p2.
Ifwedonotwant todisplaylinefromp1top2andjustmovethenwecanblankthebeamaswemoveit.
Tomove the beam across the CRT,the informationaboutboth magnitudeand direction is required. This
information is generated with the help of vector graphics generator.
Fig.1.2showsarchitectureofvector display. Itconsists ofdisplaycontroller,CPU,displaybuffermemory and
CRT.
DisplaycontrollerisconnectedasanI/Operipheraltothe CPU.
Displaybufferstorescomputerproduceddisplaylistordisplayprogram.
The Program contains point & line plotting commands with end point co-ordinates as well as character
plotting commands.
Displaycontrollerinterpretscommandandsendsdigitalandpointco-ordinatestoavectorgenerator.
Vector generator then converts the digital co-ordinate value to analog voltages for beam deflection
circuits that displace an electron beam which points on the CRT’s screen.
In this technique beam is deflected from end point to end point hence this techniques is also called
random scan.
We know as beam strikes phosphors coated screen it emits light but that light decays after few
milliseconds and therefore it is necessary to repeat through the display list to refresh the screen at least
30 times per second to avoid flicker.
Asdisplaybufferisusedtostoredisplaylistandusedtorefreshing,itisalsocalledrefreshbuffer.
Rasterscan display
CPU
I/OPort
(Interaction (Displayco
data) mmand
Keyboard
Displaycontroller
Mouse
00000000000000000
00000111111100000 CRT
00000000100000000 Videocontroller
T
00000000100000000
00000000100000000
Refreshbuffer
Fig.1.3:-Architectureofarasterdisplay.
Fig. 1.3 shows the architecture of Raster display. It consists of display controller, CPU, video controller,
refresh buffer, keyboard, mouse and CRT.
Thedisplayimageisstoredintheformof1’sand0’sin therefreshbuffer.
Thevideocontrollerreadsthisrefreshbufferandproducestheactualimageonscreen.
Itwillscanonelineatatimefromtoptobottom&thenbacktothetop.
Horizontal
Vertical OFF ON Retrace
Retrace
Fig.1.4:-Rasterscan CRT.
Inthismethodthehorizontalandverticaldeflectionsignalsaregeneratedtomovethebeamalloverthe screen
in a pattern shown in fig. 1.4.
Herebeamissweptback&forthfromlefttotheright.
WhenbeamismovedfromlefttorightitisON.
WhenbeamismovedfromrighttoleftitisOFFandprocessofmovingbeamfromrighttoleftafter completion of
row is known as Horizontal Retrace.
Whenbeam isreachatthebottom of the screen. Itis madeOFFand rapidly retracedback to thetopleft to
start again and process of moving back to top is known as Vertical Retrace.
Thescreenimageismaintainedbyrepeatedlyscanningthesameimage.Thisprocessisknownas
RefreshingofScreen.
Inrasterscandisplaysaspecialareaofmemoryisdedicatedtographicsonly.Thismemoryiscalled
FrameBuffer.
Framebufferholdssetofintensityvaluesforallthescreenpoints.
Thatintensityisretrievedfromframebufferanddisplayonscreenonerowatatime.
EachscreenpointreferredaspixelorPel(PictureElement).
Eachpixelcanbespecifiedbyitsrowandcolumnnumbers.
Itcanbesimplyblackandwhitesystemorcolorsystem.
InsimpleblackandwhitesystemeachpixeliseitherONorOFF,soonlyonebitperpixelisneeded.
Additional bits are required when color and intensity variations can be displayed up to 24-bits per pixel
are included in high quality display systems.
On a black and white system with one bit per pixel the frame buffer is commonly called a Bitmap.
Andfor systems with multiple bits per pixel, the frame buffer is often referred as a Pixmap.
Differencebetweenrandomscanandrasterscan
BaseofDifference RasterScanSystem RandomScanSystem
ElectronBeam The electron beam is swept across the The electron beam is directed only to the
screen, one row at a time, from top to parts of screen where a picture is to be
bottom. drawn.
Resolution Its resolution is poor because raster Its resolution is good because this system
system in contrast produces zigzaglines produces smooth lines drawings because
that are plotted as discrete point sets. CRT beam directly follows the line path.
RealisticDisplay The capability of this system to store These systems are designed for line-
intensity values for pixel makes it well drawing and can’t display realistic shaded
suitedfortherealisticdisplayofscenes scenes.
contain shadow and color pattern.
Beam-penetrationtechnique
Fig.1.5:-Beam-penetrationCRT
Thistechniqueisusedwithrandomscanmonitors.
InthistechniqueinsideofCRTcoated withtwophosphorlayersusuallyredandgreen.Theouterlayerof red and
inner layer of green phosphor.
Thecolordependsonhowfartheelectronbeampenetratesintothephosphorlayer.
A beam of fast electron penetrates more and excites inner green layer while slow electron excites outer
red layer.
At intermediate beam speed we can produce combination of red and green lights which emit additional
two colors orange and yellow.
Thebeamaccelerationvoltagecontrolsthespeedoftheelectronsandhencecolorofpixel.
Itisalowcosttechniquetoproducecolorinrandomscanmonitors.
Itcandisplayonlyfourcolors.
Qualityofpictureisnotgoodcomparedtoothertechniques.
Shadow-masktechnique
Fig.1.6:-Shadow-maskCRT.
Q. Explain shadow mask technique with suitable diagram.
Itproduceswiderangeofcolorsascomparedtobeam-penetrationtechnique.
Thistechniqueisgenerallyusedinrasterscandisplays.IncludingcolorTV.
InthistechniqueCRThasthreephosphorcolordotsateachpixelposition.Onedotforred,onefor green and one
for blue light. This is commonly known as Dot Triangle.
Here in CRT there are three electron guns present, one for each color dot. And a shadow mask grid just
behind the phosphor coated screen.
Theshadowmaskgridconsistsofseriesofholesalignedwiththephosphordot pattern.
Three electron beams are deflected and focused as a group onto the shadow mask and when they pass
through a hole they excite a dot triangle.
Indottrianglethreephosphordotsarearrangedsothateachelectronbeamcanactivateonlyits corresponding
color dot when it passes through the shadow mask.
A dot triangle when activated appears as a small dot on the screen which has color ofcombination
ofthree small dots in the dot triangle.
Bychangingthe intensityofthethreeelectron beamswecanobtaindifferent colorsintheshadowmask CRT.
Graphics input devices
Keyboards
Keyboards are used as entering text strings. It is efficient devices for inputting such a non-graphics data
as picture label.
Cursor control key’s & function keys are common features on general purpose keyboards.
Many other application of key board which we are using daily used of computer graphics are
commanding & controlling through keyboard etc.
Mouse
Mouse is small size hand-held box used to position screen cursor.
Wheel or roller or optical sensor is directing pointer on the according to movement of mouse.
Three buttons are placed on the top of the mouse for signaling the execution of some operation.
Now a day’s more advance mouse is available which are very useful in graphics application for example Z
mouse.
Joysticks
A joy stick consists of small vertical lever mounted on a base that is used to steer the screen cursor
around.
Most joy sticks selects screen positioning according to actual movement of stick (lever).
Some joy sticks are works on pressure applied on sticks.
Sometimes joy stick mounted on keyboard or sometimes used alone.
Movement of the stick defines the movement of the cursor.
In pressure sensitive stick pressure applied on stick decides movement of the cursor. This pressure is
measured using strain gauge.
This pressure sensitive joy sticks also called as isometric joy sticks and they are non movable sticks.
Data glove
Data glove is used to grasp virtual objects.
The glow is constructed with series of sensors that detect hand and figure motions.
Electromagnetic coupling is used between transmitter and receiver antennas which used to provide
position and orientation of the hand.
Transmitter & receiver Antenna can be structured as a set of three mutually perpendicular coils forming
3D Cartesian coordinates system.
Input from the glove can be used to position or manipulate object in a virtual scene.
Digitizer
Digitizer is common device for drawing painting or interactively selecting coordinates position on an
object.
One type of digitizers is graphics tablet which input two dimensional coordinates by activating hand
cursor or stylus at selected position on a flat surface.
Stylus is flat pencil shaped device that is pointed at the position on the tablet.
Image Scanner
Image Scanner scan drawing, graph, color, & black and white photos or text and can stored for computer
processing by passing an optical scanning mechanism over the information to be stored.
Once we have internal representation of a picture we can apply transformation.
We can also apply various image processing methods to modify the picture.
For scanned text we can apply modification operation.
Touch Panels
As name suggest Touch Panels allow displaying objects or screen-position to be selected with the touch
or finger.
A typical application is selecting processing option shown in graphical icons.
Some system such as a plasma panel are designed with touch screen
Other system can be adapted for touch input by fitting transparent touch sensing mechanism over a
screen.
Touch input can be recorded with following methods.
1. Optical methods
2. Electrical methods
3. Acoustical methods
Optical method
Optical touch panel employ a line of infrared LEDs along one vertical and one horizontal edge.
The opposite edges of the edges containing LEDs are contain light detectors.
When we touch at a particular position the line of light path breaks and according to that breaking line
coordinate values are measured.
In case two line cuts it will take average of both pixel positions.
LEDs operate at infrared frequency so it cannot be visible to user.
Electrical method
An electrical touch panel is constructed with two transparent plates separated by small distance.
One is coated with conducting material and other is coated with resistive material.
When outer plate is touch it will come into contact with internal plate.
When both plates touch it creates voltage drop across the resistive plate that is converted into
coordinate values of the selected position.
Acoustical method
In acoustical touch panel high frequency sound waves are generated in horizontal and vertical direction
across a glass plates.
When we touch the screen the waves from that line are reflected from finger.
These reflected waves reach again at transmitter position and time difference between sending and
receiving is measure and converted into coordinate values.
Light pens
Light pens are pencil-shaped device used to select positions by detecting light coming from points on the
CRT screen.
Activated light pens pointed at a spot on the screen as the electron beam lights up that spot and
generate electronic pulse that causes the coordinate position of the electron beam to be recorded.
Voice systems
It is used to accept voice command in some graphics workstations.
It is used to initiate graphics operations.
It will match input against predefined directory of words and phrases.
Dictionary is setup for a particular operator by recording his voice.
Each word is speak several times and then analyze the word and establishes a frequency pattern for that
word along with corresponding function need to be performed.
When operator speaks command it will match with predefine dictionary and perform desired action.