Unformatted text preview:

CSCE 441 Computer Graphics Jinxiang Chai 1 Midterm Time 10 10pm 11 20pm 10 20 Location HRBB 113 2 What you ve learned in this class 2D Graphics Drawing lines polygons Color 3D Graphics Transformations Hidden surface removals 3 Scan Line Conversion How to draw a line Digital Differential Analyzer DDA Midpoint algorithm Understand both algorithms Strengths and limitations 4 Scan Conversion of Polygons How to draw a polygons Active edge list Boundary fill Flood fill Understand three algorithms Limitations and strengths 5 Clipping Lines P6 P3 P4 P10 P8 P9 P5 P7 P2 P1 6 Clipping Lines P 6 P 10 P 9 P8 P5 P7 7 Clipping Lines Given a line with end points x0 y0 x1 y1 and clipping window xmin ymin xmax ymax determine if line should be drawn and clipped end points of line xto draw y max max x1 y1 x0 y0 xmin ymin 8 Line Clipping How to clip a line Simple line clipping algorithm Cohen Sutherland Liang Barsky 9 Clipping Polygons Clipping polygons is more complex than clipping the individual lines Input polygon 10 Clipping Polygons Clipping polygons is more complex than clipping the individual lines Input polygon Output original polygon new polygon or nothing 11 Polygon Clipping How to clip a polygon Sutherland Hodgman Clipping convex polygons Weiler Atherton Algorithm general polygons 12 2D 3D Transformation Various transform matrices 2D 3D rotation 2D 3D translation 2D 3D scaling 2D affine transform 13 Arbitrary Rotation Center To rotate about an arbitrary point P px py by px py 14 Arbitrary Rotation Center To rotate about an arbitrary point P px py by Translate the object so that P will coincide with the origin T px py px py 15 Arbitrary Rotation Center To rotate about an arbitrary point P px py by Translate the object so that P will coincide with the origin T px py Rotate the object R px py 16 Arbitrary Rotation Center To rotate about an arbitrary point P px py by Translate the object so that P will coincide with the origin T px py Rotate the object R Translate the object back T px py px py 17 Arbitrary Rotation Center Translate the object so that P will coincide with the origin T px py Rotate the object R Translate the object back T px py Put in matrix form P x y 1 1 0 px 0 1 py 00 1 T px py R T px py cos sin 0 sin cos 0 0 0 1 1 0 px 0 1 py 0 0 1 x y 1 18 Scaling Revisit The standard scaling matrix will only anchor at 0 0 Sx 0 0 0 Sy 0 0 0 1 What if I want to scale about an arbitrary pivot point 19 2D 3D Coordinate Transformation Various transform matrix 2D 3D rotation 2D 3D translation 2D 3D scaling 2D affine transform How to do 2D 3D matrix composition 20 2D Coordinate Transformation Transform object description from i j to j p i j o x0 y0 o i T x x0 i T i y y0 j T T x i i i j T T y j i j j 1 0 0 ij x j y x0 x y0 y 1 1 21 2D Coordinate Transformation 2D translation j T x i i 1T y j0 i 1 0 p j o x0 y0 o T i 0 j x0 x T j1 j y0 y 0 1 1 i i 22 2D Coordinate Transformation 2D translation rotation j p i j x cos sin y sin cos 1 0 0 x0 x y0 y 1 1 o x0 y0 o i 23 2D Coordinate Transformation 2D translation scaling j x x 0 y 0 2 1 0 0 p j o x0 y0 o x0 x y0 y 1 1 i i 24 Hierarchical Modeling Lamp 3 A What s the current coordinate c3 2 A c2 c1 1 How to do opengl implementation c0 x y 0 p T x y R 0 T 0 l0 R 1 T l1 0 R 2 T l2 0 R 3 p0 25 A More Complex Example Human Figure How to do opengl implementation 26 3D 2D Geometry Pipeline Rotate and translate the camera Object space World space View space Focal length Aspect ratio resolution Normalized project Image space space 27 3D Geometry Pipeline Before being turned into pixels by graphics hardware a piece of geometry goes through a number of transformations Model space 28 3D Geometry Pipeline Before being turned into pixels by graphics hardware a piece of geometry goes through a number of transformations World space 29 3D Geometry Pipeline Before being turned into pixels by graphics hardware a piece of geometry goes through a number of transformations Eye space 30 Camera Coordinate 31 3D Coordinate Trans Transform object description from camera v x v y v z nx n y nz to world u u u x ux v x nx uy vy ny 1 Tw c Tc w uz v z nz 0 0 0 y z x0 y0 z0 1 32 Viewing Trans gluLookAt gluLookAt eyex eyey eyez atx aty atz upx upy upz 33 Viewing Trans gluLookAt Mapping from world to eye coordinates gluLookAt eyex eyey eyez atx aty atz upx upy upz V upx up y upz pref at x at y at z p0 eyex eye y eyez How to determine u v n 34 Viewing Trans gluLookAt Mapping from world to eye coordinates gluLookAt eyex eyey eyez atx aty atz upx upy upz N p0 pref pref at x at y at z V upx up y upz p0 eyex eye y eyez N n N 35 Viewing Trans gluLookAt Mapping from world to eye coordinates gluLookAt eyex eyey eyez atx aty atz upx upy upz N p0 pref pref at x at y at z N n N V upx up y upz p0 eyex eye y eyez V n u V 36 Viewing Trans gluLookAt Mapping from world to eye coordinates gluLookAt eyex eyey eyez atx aty atz upx upy upz N p0 pref pref at x at y at z N n N V n u V V upx up y upz p0 eyex eye y eyez v n u H B equation 7 1 37 3D Geometry Pipeline Before being turned into pixels by graphics hardware a piece of geometry goes through a number of transformations Normalized projection 38 3D 2D Consider the projection of a point on the camera plane x x dx x z d z y y dy y z d z By similar triangles we can compute how much the x and y coordinates are scaled 39 The Perspective Matrix Now we can rewrite the perspective projection equation as matrix vector multiplications x x dx x z d z y y dy y z d z x x 1 0 0 0 y y 0 1 0 0 w 0 0 1 0 z d 1 After the division by w we have dx x z dy y z 1 1 40 Projections Parallel projection definition …


View Full Document

TAMU CSCE 441 - mid_review

Documents in this Course
Load more
Download mid_review
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view mid_review and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view mid_review 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?