You are on page 1of 109

Ch3ComputerGraphics

Convertvectorstraightlinestorasterimagestobe
displayedonarasterterminalutilizingthepixelinformation
Understandtheproblemsassociatedwithdisplaying
vectorialinformationonarasterterminal
VarioustypesofcoordinatesystemsusedindisplayingCAD
information
Thedatarequirementsofagraphicimageandthedatabase
storagemethodsused
Learnabouttheengineeringdatamanagementsystems
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 2
Differenttypesofgeometrictransformationsused
duringCADgeometrygenerationanddisplayand
theirevaluation
Mathematicsrequiredtodisplaya3Dimageonthe
2Dscreenofthedisplaydevice
Understandtheproblemsassociatedwiththe
displayofgraphicimagesinthedisplayscreensuch
asclippingandhiddenlineelimination
Learnaboutaddingcolourandshadingtothe
displayforbettervisualization.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 3
DDA or Digital Differential Analyser is one of the first
algorithms developed for rasterising the vectorial
information.Theequationofastraightlineisgivenby
Y=mX+C
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 4
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 5
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 6
Bresenham'smethodisanimprovementoverDDA
sinceitcompletelyeliminatesthefloatingpoint
arithmeticexceptfortheinitialcomputations.
Allothercomputationsarefullyintegerarithmetic
thusismoreefficientforrasterconversion
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 7
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 8
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 9
Therasterisationalgorithmsdiscussedearlierwillbe
generatingthepixelpointsbyroundingofftothe
nearestinteger.
Asaresulttheinclinedlineshavethejaggedeffect
oftencalledthestaircaseeffectasshowninFig.35.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 10
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 11
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 12
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 13
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 14
Therighthandedcartesiancoordinatesystemisused
fordefiningthegeometryoftheparts.Inorderto
specifythegeometryofagivensolid,itisnecessaryto
useavarietyofcoordinatesystems.
WorldCoordinateSystem
UserCoordinateSystem
DisplayCoordinates
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 15
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 16
Thisreferstotheactualcoordinatesystemusedas
masterforthecomponent.
Sometimesitmayalsobecalledasmodelcoordinate
system.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 17
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 18
However,sometimesitbecomesdifficulttodefine
certaingeometriesiftheyaretobedefinedfromthe
WCS.Insuchcasesalternatecoordinatesystemscan
bedefinedrelativetotheWCS.Thesecoordinate
systemsaretermedasusercoordinatesystems(UCS)
orworkingcoordinatesystems.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 19
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 20
Thisreferstotheactualcoordinatestobeusedfor
displayingtheimageonthescreen.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 21
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 22
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 23
Themajorfunctionsofadatabasearetomanipulate
thedataonscreen,suchaszoomingandpanning;to
interactwiththeuser,essentiallyforthepurposeof
editingfunctionsliketrimming,filleting,stretching,
etc.;toevaluatethepropertieslikeareas,volumes,
inertias,etc.toprovideadditionalinformationlike
manufacturingspecifications.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 24
Organisationaldata
Identificationnumber,
Drawingnumber,
Design origin and status of
changes,
Currentstatus,
Designername,
Dateofdesign,
Scale,
Typeofprojections,
Company.
Technologicaldata
Geometry,
Dimensions,
Tolerances,
Surfacefinishes,
Material specifications or
reference,
Manufacturingprocedures,
Inspectionprocedures.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 25
Allowforgreaterinteractionoftheuserwiththe
modellingsystem.
Supportalargevarietyoftypesofdatatobe
representedinthedatabaseasexplainedearlier.
Thedatastructureshouldbeabletoallowfor
associatingthedatawiththemodellingprocess.
Thedatashouldallowforstoringinformationinthe
mostcompactformpossible.
Datashouldmaintaincompleteassociativitywithall
thedownstreamandupstreamapplications.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 26
Databasecanbedefinedasacollectionofdata,which
issharedthroughoutagivenprocessformultiple
applications.
Datarecord:Datarecordconsistsofaseriesoffacts
orstatements.
DataFile:Afileisacollectionofdataitemsput
together.
Datafield:Afieldisasingleunitofdatastoredaspart
ofadatabaserecord.
Datamodel:Datamodelisconcernedwithwhatthe
datainthedatabaseisrepresented.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 27
Thehierarchicalmodel
Thenetworkmodel,and
Therelationalmodel
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 28
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 29
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 30
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 31
Inmostofthegeometricmodellersa
combinationofrandomandsequential
formofdatastorageisused.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 32
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 33
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 34
Themanagementoflargeamountofdataoverthe
entirelifecycleoftheproductiscalledbyanumberof
nameswithdifferentunderstandingsuchasProduct
DataManagement(PDM),ProductInformation
management(PIM),EngineeringDataManagement
(EDM),TechnicalDocumentationManagement
(TDM),EngineeringManagementSystem(EMS),etc.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 35
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 36
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 37
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 38
Translation
Scaling
ReflectionorMirror
Rotation
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 39
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 40
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 41
Thismovesageometricentityinspaceinsuchaway
thatthenewentityisparallelatallpointstotheold
entity.
P*=[x*,y*]
x*=x+dX
y*=y+dY
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 42
[ ]

+
+
=

=
dY y
dX x
y
x
P
*
*
*
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 43
Scalingisthetransformationappliedtochange
thescaleofanentity
P*=[X*,Y*] =[S
x
X,S
y
dY]
[P
*
]=[T
s
].[P]
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 44

y
x

S
0
0
S
= ]
P
[
y
x
*
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 45
Reflectionormirrorisatransformation,which
allowsacopyoftheobjectistobedisplayed
whiletheobjectisreflectedaboutalineora
plane.
P*=[X*,Y*] =[X,Y]
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 46

y
x

0
0
= ]
P
[
*
1
1
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 47
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 48
Thefinalpositionandorientationofa
geometricentityisdecidedbytheangleof
rotationandthebasepointaboutwhichthe
rotation,
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 49

y
x

y
x
= ]
P
[
*


cos sin
sin cos
*
*
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 50
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 51
[P*]=[Tn][Tn1][Tn2]..[T3][T2][T1]
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 52
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 53
[ ]

=
1 1 0 0
1 0
0 1
1
*
*
* y
x
dY
dX
y
x
P
TranslatethepointPtoO,theoriginoftheaxes
system.
Rotatetheobjectbythegivenangle
Translatethepointbacktoitsoriginalposition.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 54
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 55
TranslatethemirrorlinealongtheYaxissuchthatthe
linepassesthroughtheorigin,O
Rotatethemirrorlinesuchthatitcoincideswiththe
Xaxis.
MirrortheobjectthroughtheXaxis.
Rotatethemirrorlinebacktotheoriginalanglewith
Xaxis.
TranslatethemirrorlinealongtheYaxisbacktothe
originalposition.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 56
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 57
TranslatethepointPtoO,theoriginof
theaxessystem.
Rotatetheobjectbythegivenangle
Translatethepointbacktoitsoriginal
position.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 58
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 59
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 60

1 1 0 0 0
1 0 0
0 1 0
0 0 1
1
*
*
*
z
y
x
dZ
dY
dX
z
y
x
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 61

1 1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
1
*
*
*
z
y
x
z
y
x
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 62

1 1 0 0 0
0 1 0 0
0 0 cos sin
0 0 sin cos
1
*
*
*
z
y
x
z
y
x


Orthographicprojection
Isometricprojection
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 63
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 64
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 65
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 66
Thishelpsindiscardingthepartofthegeometry
outsidetheviewingwindow,suchthatallthe
transformationsthataretobecarriedoutfor
zoomingandpanningoftheimageonthescreenare
appliedonlyonthenecessarygeometry.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 67
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 68
Toknowwhetherthelineiscompletelyinsideor
outsidetheclippingrectanglecanbedoneby
comparingtheendpointsofthelinewiththeclipping
boundaries.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 69
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 70
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 71
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 72
Inthismethodallthelinesareclassifiedastowhether
theyarein,outorpartiallyinthewindowbydoingan
edgetest.
T=1ifpointisabovetopofwindow
=0otherwise
B=1ifpointisabovebelowofwindow
=0otherwise
R=1ifpointisaboverightofwindow
=0otherwise
L=1ifpointisaboveleftofwindow
=0otherwise
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 73
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 74
Thelineclippingalgorithmdiscussedearliercanbe
modifiedtoobtainpolygonclipping.
However,ascanbeseenfromFig.341,extendingthe
lineclippingproceduredescribedaboveproducesa
result,whichcanmeanmorethanonegeometry.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 75
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 76
Thebasicideausedinpolygonclippingisthatann
sidedpolygonisrepresentedbynvertices.
Oneachofthepolygontwotestsareconducted.If
theline(edgeofthepolygon)intersectsthewindow
edge,theprecursorpointisaddedtotheoutputlist.
Ifthenextvertexisoutsidethewindow,discardit
otherwiseaddtotheoutputlist.
Thisprocessisrepeatedforalltheedgesofthe
polygon.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 77
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 78
Removinghiddenlinesandsurfacesgreatly
improvesthevisualisationoftheobjects.
Backfaceremoval
Zbuffer(depthbuffer)
Depthsortalgorithm
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 79
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 80
Thebasicconceptusedinthisalgorithmisthat
onlythosefacesthatarefacingthecamera
(centreofprojection)arevisible.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 81
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 82
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 83
TheZbufferisaseparatedepthbufferusedto
storethezcoordinate(depth)ofeachpixelin
thegeometricmodel.
Thismethodutilisestheprinciplethatforeach
ofthepixellocations,onlythatpointwiththe
smallestZdepthisdisplayed.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 84
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 85
Thedepthsortalgorithmsutilizetheprincipleof
paintingthepolygonsintotheframebufferinthe
orderofdecreasingdistance(depth)fromtheview
point.
Sortallthepolygonsaccordingtothesmallestz
coordinateofeach
Resolveanyambiguities(Fig.3.47)whenthez
coordinatesofpolygonsoverlap,bysplittingthe
polygons
Scanconverteachpolygoninascendingorderfrom
backtofront(intermsofzcoordinate)
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 86
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 87
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 88
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 89
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 90
X
Y
S
S
S
S
1
2
3
4
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 91
Theuseofcoloursenhancesthepresentation
ofinformationinCAD/CAMinanumberof
ways.
Usingdifferentcoloursfordifferenttypeof
geometricentitiesduringtheconstruction
stagehelpstheengineertofollowthe
modellingprocesseswithmoreclarity.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 92
RGBModel
CMYModel
HSIModel
YIQModel
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 93
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 94
Red light
Green light
Blue light
Magenta
White
Yellow
Cyan
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 95
Red
Green
Blue
Magenta dye
Black
Yellow dye
Cyan dye
Havingstudiedtheprinciplesthatarerequiredfor
displayingrealisticgraphicalimageswithoutthe
hiddensurfaces,thenextlogicalstepisrenderthem
byincorporatingthecorrectshadingofdifferent
surfaces.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 96
Thelightthatisfallingontheobjectcanbecoming
fromalightsourcesuchassunoralightbulb,ora
reflectedlight,forexamplethereflectedlightfrom
thelightbulbformthesurroundingwalls.
Itisthereflectedlightthatallowstheobjecttobe
seenasshowninFig3.52.
Specularreflectionisthepropertyofasurfacethat
reflectstheincidentlightinanearlyfixeddirection
andwithoutaffectingitsquality.Itisthisreflection
thatisresponsibleforthehighlightsseenonshiny
objects.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 97
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 98
IntheLambertshadingmethodalsocalledas
facetedshading,thesurfaceoftheobjectis
approximatedbypolygons(flatsurface)even
thoughitissmooth.
Thisgivesrisetotheappearanceofthesmooth
solidasafacetedsolidasshowninFig3.53.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 99
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 100
Thesmoothnessisobtainedbylinearlyinterpolatinga
colourorshadeacrossthepolygonunlikethe
Lambertshadingwhichhasasinglecolouracrossthe
entirepolygon.
Inordertodothis,intensityiscalculatedforeach
pixelratherthanoneintensityfortheentirepolygon.
Itisalsocalledintensityinterpolationandisvery
simpleandeffectivemethodofaddingacurvedfeel
toapolygonthatwouldotherwiseappearflat.
S
E
=S
A
+(X
E
X
A
)*G
AB
S
D
=S
A
+(X
D
X
A
)*G
AB
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 101
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 102
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 103
Determineanormalvectorateachvertexofa
polygonsimilartotheprocedureusedinGouraud
shading.
Interpolatenormalvectorsalongtheedgesofthe
polygon.
Interpolatenormalvectorsacrosseachscanline,so
thatthereisonenormalvectorforeachpixelinthe
polygon.
Applyanilluminationmodelatpositionsalongscan
linestocalculatepixelintensitiesusingthe
interpolatednormalvectors.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 104
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 105
A B
A C B C B A
X X
) X (X N ) X (X N

+
Inordertodisplaythegraphicalinformation,whichis
vectorialinnature,itisnecessarytoconvertitintoraster
format.
Forconvertinglinesintorasterformat,DDAalgorithmis
simplestwhileBresenhamsalgorithmreducesthe
computationsintointegerformattherebymakingita
fasteralternative.
Itisnecessarytomodifythepixelinformationfordisplay
togetmorerealisticvisualexperience.
Dependinguponthetypeofgraphicdisplayused,itis
necessarytobefamiliarwithanumberofdifferent
coordinatesystemstofacilitatethegraphicconstruction
aswellasdisplay.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 106
Inadditiontotheactualgraphicinformation,alargeamountof
additionaldatasuchasorganizationalandtechnologicaldatais
storedwiththeproductdata.
Threedifferenttypesofdatamodelsareusedforstoring
modellingdata.Theyarehierarchicalmodel,networkmodel
andtherelationalmodel.Ofthesetherelationalmodelquite
extensivelyisusedbecauseofitsflexibilityinusage.It
maintainsdatatablesandpointerstostoretherequireddatain
averycompactmanner.
Engineeringdatamanagement(EDM)takescareofallthedata
thatisrequiredforagivenproductthroughoutitslifecycle.
Geometrictransformationscanbehandledconvenientlyusing
matrixalgebra.Forthispurposeitisnecessarytouse
homogenousrepresentationofvertexdata.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 107
Varioustransformationsthatarequiteusefulare
translation,rotation,scaleandreflection.Itispossibleto
extendthesebasictransformationsformorecomplex
transformations.
The2Dtransformationmethodscanbeeasilyextended
into3D.
The3Dgeometrydataneedstobeconvertedinto2Dby
adoptingasuitableprojectionsystemsuchas
orthographic,isometricorperspectiveprojection.
Sinceonlypartofthegeometricmodelwillbedisplayed
mostofthetime,itisnecessarytocliptheinformation
outsidethedisplaywindow.Anumberofmethodsare
availableforstraightlineaswellaspolygonclipping.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 108
Lineclippingissimple,butpolygonclippingwillbemore
comprehensiveandcanbeeasilyextendedto3D.
Alsoitisnecessarysometimestoremovethehiddenlines
tomakethedisplayeasiertounderstand.Forthispurpose
backfaceremoval,depthbuffer(Z)anddepthsort
algorithmareused.
Thereareanumberofcolourmodelsusedwiththe
graphicdisplaysandhardcopies.Addingcolourand
shadingcoupledwiththeremovalofhiddensurfaces
allowsforrealisticvisualizationofobjectsmodelled.
Gourad shadingandPhong shadingmodelsarefrequently
usedtogetsmoothlyshaded3Dprofiles.
10July2013
(c)TMH,NewDelhi,CAD/CAMPrinciples
andApplicationsbyPNRao,3rdEd 109

You might also like