































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Graphics is a fascinating area in Computer Science. It has wide applications both in research and industry. This course will teach the fundamentals of Computer Graphics. It deals with science of image formation and rendering on a computer screen. This lecture includes: 2, D, Viewing, Graphics, Package, Translation, Rotation, Scaling, Transformation, Coordinates, Primitive, Composite, Placement
Typology: Slides
1 / 39
This page cannot be seen from the preview
Don't miss anything!
































2-D ViewingWhat is involved in effective viewing of graphics?
Cartesian coordinate values (World Coordinates) maybe used to specify the picture part to be displayed in2D referred to as picture area ^ Selected picture parts can then be mapped ontothe device coordinates ^ Transformation from World Coordinates toDevice Coordinates involve operations such astranslation, rotation and scaling ^ Parts not to be shown are deleted or clipped
Hence, scaling operation is involved.First scaling is done and then translation is appliedRelative proportions are maintained if sx=sy
7
3D PrimitivesClipping Viewport Transformation
Scan Conversion
Image
Clip portions of geometric primitivesresiding outside windowTransform the clipped primitivesfrom screen to image coordinatesFill pixel representing primitivesin screen coordinates
2D Primitives
Window defines what is to be viewed ^ The area on the display device where the window ismapped is referred to as the viewport^ ^
Viewport defines where it is to be displayed ^ Viewports and windows are generally rectangles^ ^
Polygon shapes and circles may also be used but they takelonger to be processed ^ Mapping from the world co-ordinate scene to devicecoordinates is referred to as viewing transformation ^ Term window here is not to be confused with the Windowin your OS; they do not mean the same thing ^ Window rectangles may have any orientation
Window defines part of scene being viewed Must draw geometric primitives only inside window
Points Lines Polygons Circles etc.
^ Is Point(x,y) Inside the Clip Window?
13
(x, y)
wx
wy2^ wy1wx
Inside =
(x>=wx1) &&(x<=wx2) &&(y>=wy1) &&(y<=wy2);
^ Find the Part of a Line Inside the Clip Window
14
10
Before Clipping
Test whether the line is within the window If its not, determine if its entirely outside the window If its not either of the above, determine intersectionpoints with the clipping boundaries ^ The inside outside tests are carried out bychecking the endpoints^ ^
A line with both endpoints within the clippingboundary is completely inside A line with both endpoints out is completely outside Otherwise its partly in and partly out
^ Use Simple Tests to Classify Easy Cases First
17
10
x is set to either xw
or xwmin
for verticalmax
boundariesx=x1+(y-y1)/m y is set to either yw
or ywmin
for horizontalmax
boundaries
^ Classify Some Lines Quickly by AND of Bit CodesRepresenting Regions of Two Endpoints (Must Be0)
20 P^10
Bit 4 Bit 3
Bit 2
Bit 1