GraphicsCSCI.343 Fall 2023 - Exam Review: Algorithms for Clipping, Line Drawing, Curves, and Texture Mapping
Explore the Cohen-Sutherland and Liang-Barsky clipping algorithms, DDA and Bresenham line drawing algorithms, Bezier curves parametric representations, and texture mapping concepts. Understand how these algorithms work, make clipping decisions, and achieve accurate rendering in computer graphics.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Graphics CSCI 343, Fall 2023 Lecture 27 Final Exam Review 1
1. Cohen-Sutherland Clipping Given a clipping rectangle defined by (xmin, ymin) = (3, 2) (xmax, ymax) = (6, 4) For the pairs of points in parts a and b: i) Indicate the Cohen-Sutherland outcode for each point ii) State what the algorithm will dictate concerning the rendering of the line- segment (entirely rendered, clipped with part rendered, entirely clipped (i.e. not rendered) or not known) iii) Briefly state why the algorithm gives this output. iv) If clipping is required, or if it is not known, calculate the intersection points to determine where to clip. 2
1. Cohen-Sutherland Clipping a) P0 = (2, 3), P1 = (5, 5) b) P0 = (7, 1), P1 = (8, 3) 3
1c. Liang-Barsky Clipping Problem 1 (continued) For the following pair of points i) Determine the clipping values using Liang-Barsky clipping. ii) Indicate whether the line is discarded entirely, rendered entirely, or clipped. iii) If the line is clipped, indicate the (x, y) value(s) at which it is clipped. c) P0 = (4, 3), P1 = (5,1) 4
2. Line Drawing Given the line, y = 1/3x + 2 and the starting and ending points of a line segment: (x1, y1) = (0,2) (x2, y2) = (6,4) For each pixel between x = 0 and x = 6, what y value will be colored as part of the line in: a) The DDA algorithm? b) The Bresenham algorithm? (Show your work, indicating the values of pk at each step). c) Which of the 2 algorithms is preferred and why? 5
3. Curves Given the following four points: P0 = (1, 1, 1) P1 = (3, 5, 2) P2 = (5, 5, 3) P3 = (8, 2, 4) Find the parametric representations, x(u), y(u), z(u) for the Bezier (also know Interpolation, Hermite and Spline techniques) curve that fits these points. 6
4. Texture Mapping Suppose you are texture mapping an image that has width = 256 pixels and height = 128 pixels. This image is represented by a texture mapping with s (width) ranging from 0 to 1.0 and t (height) ranging from 0 to 1.0. a) What region of the image (in pixels) is mapped by the rectangle in the texture map with lower left corner at (0.5, 0.5) and upper right corner at (0.75, 0.75)? b) Suppose you are mapping this image onto a rectangle that, when rendered, has lower left corner at (100, 100) with width and height that are both 100 pixels. What region of the rectangle will the region given in a) map to? c) Will the image be distorted? Why or why not? 7
Other things to study Be prepared to discuss some of the topics discussed more generally, such as: aliasing (Why is it a problem? What can be done about it?) polygon clipping and filling texture mapping techniques etc. Also be prepared to solve problems involving: transformations (similar to those on the homework), lighting and shading viewing (e.g. camera motion, clipping volumes, etc.) 8