Presentation is loading. Please wait.

Presentation is loading. Please wait.

Midterm Review Ceng 477 Introduction to Computer Graphics Computer Engineering METU.

Similar presentations


Presentation on theme: "Midterm Review Ceng 477 Introduction to Computer Graphics Computer Engineering METU."— Presentation transcript:

1 Midterm Review Ceng 477 Introduction to Computer Graphics Computer Engineering METU

2 Review Topics ● The Graphics Pipeline ● Output primitives: line drawing, circle drawing algorithms ● Filled Area Primitives: polygon filling algorithms ● Geometric transformation: 2D/3D transformation, composite transformations ● 2D Viewing: Viewing transformations, line clipping, polygon clipping algorithms

3 Model M1 M2 M3 3D World Scene View Coordinates V Projection Transformation Viewport Transformation 2D Image Projection Rasterization Modeling Transformations Viewing Transformations MCS WCSVCS Normalized coordinates DCS SCS The Graphics Pipeline Normalization Transformation and Clipping

4 Midterm Review Exercise #1 ● Using the Cohen-Sutherland line clipping algorithm clip the following line:

5 Solution

6 Midterm Review Exercise #2 ● We want to put a mirror in a 3D scene. The mirror is specified as a 3D rectangle specified with its corner points and with one of its principle axes parallel to the y axis and the other parallel to the xz plane (illustrated below). parallel to xz plane Give the transformation matrix that will generate mirror objects of all the objects in the scene (you may assume all the objects are in front of the mirror). And show the results as a product of matrices. z y x

7 Solution ● Basically what we are asked is reflection with respect to a plane. ● We can formulate this with a composite transformation – Align the mirror plane with one of the planes, e.g., yz plane – Compute reflection wrt to yz plane – Restore the mirror plane’s original position and orientation z y x

8 Solution ● Align the mirror plane with one of the planes, e.g., yz plane – Translate P 1 onto the y axis. – Rotate the plane so that P 2 is on the z axis. z y x z y x z y x

9 Solution ● Reflection around yz plane is just inversion of x coordinate – Reflection around yz. – Do the reverse transformations: rotate 45 degrees counterclockwise and translate P 1 back to (3,10,-1) to finish the composite transformation. z y x z y x Final Solution: T(3,0,-1)R y (45)Ref yz ( )R y (-45)T(-3,0,1)

10 Midterm Review Exercise #3 ● Write the contents of the sorted edge table for the given polygon. Assume the scan conversion starts from the bottom scan line. ● Which edges are in the Active Edge List at scan line 4? ● Show the double or single counted vertices. But you do not need to consider their updated values when filling in the edge table

11 Solution ● The vertex A is the bottommost vertex. Starting from vertex A fill in the Sorted Edge table. ● E is the only vertex that need to be counted once, so we need update the edge FE to FE’. The other vertices are not need to be updated.

12 Solution YE1E2 1ABAG 2FGFE’ 3CBCD 4ED The sorted edge table

13 Solution Y X init, Y max,1/m 1AB: 1,6,0AG: 1,3,1 2FG: 6,3,-3FE’: 6,4,2 3CB: 6,6,-5/3CD: 6,6,2/3 4ED: 10,6,-1 The contents of the sorted edge table At scanline 4: AB,CB,CD,ED are active (FE’ is just dropped from the list)


Download ppt "Midterm Review Ceng 477 Introduction to Computer Graphics Computer Engineering METU."

Similar presentations


Ads by Google