ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Computer Graphics
    ITEC4128
    Progress0 / 15 topics
    Topics
    1. Introduction to Computer Graphics2. Graphics Systems3. Point and Line Drawing Techniques4. Circle Drawing Techniques5. Ellipse and Other Curves6. 2D Transformations7. Clipping8. 3D Concepts9. 3D Transformations10. Perspective Projection11. Triangles and Planes12. Triangle Rasterization13. Lighting14. Introduction to OpenGL15. Animations
    ITEC4128›Clipping
    Computer GraphicsTopic 7 of 15

    Clipping

    3 minread
    542words
    Beginnerlevel

    📘 Clipping in Computer Graphics — Exam Notes


    🔹 1. Introduction

    Clipping is the process of removing (cutting off) parts of objects that lie outside a specified region called the clipping area.

    👉 In simple terms: Only the visible part inside a boundary is displayed; everything else is discarded.


    🔹 2. Clipping Window & Viewport

    ✔️ Clipping Window

    • The selected visible region in world coordinates
    • Defined by boundaries: [ x_{min},\ x_{max},\ y_{min},\ y_{max} ]

    ✔️ Viewport

    • The area on the screen where the clipped image is displayed

    ✔️ Relationship

    • First clip → then map to viewport

    🔹 3. Types of Clipping

    1. Point Clipping
    2. Line Clipping
    3. Polygon Clipping
    4. Text Clipping

    🔹 4. Point Clipping

    ✔️ Concept

    A point is visible if it lies inside the clipping window.


    ✔️ Condition

    A point ((x, y)) is inside if: [ x_{min} \le x \le x_{max} ] [ y_{min} \le y \le y_{max} ]


    🔹 5. Line Clipping

    ✔️ Concept

    • A line may be:

      • Completely inside → accept
      • Completely outside → reject
      • Partially inside → clip

    🔸 5.1 Cohen–Sutherland Line Clipping Algorithm (Important)

    ✔️ Idea

    • Divide plane into 9 regions
    • Assign a 4-bit code (Region Code) to each endpoint

    ✔️ Region Code Format

    Each bit represents:

    • Top
    • Bottom
    • Right
    • Left

    ✔️ Steps

    1. Assign region codes to endpoints

    2. If both codes = 0000 → Accept line

    3. If logical AND ≠ 0 → Reject line

    4. Else → Clip line:

      • Find intersection with boundary
      • Replace point and repeat

    ✔️ Advantages

    • Fast
    • Easy to implement

    🔸 5.2 Liang–Barsky Algorithm

    ✔️ Idea

    • Uses parametric equations of line
    • More efficient than Cohen-Sutherland

    ✔️ Line Equation

    [ x = x_1 + u(x_2 - x_1) ] [ y = y_1 + u(y_2 - y_1) ]


    ✔️ Advantages

    • Fewer calculations
    • More precise

    🔹 6. Polygon Clipping

    ✔️ Concept

    Used to clip complex shapes (polygons).


    🔸 6.1 Sutherland–Hodgman Algorithm

    ✔️ Steps

    1. Take polygon edges

    2. Clip against each boundary:

      • Left
      • Right
      • Top
      • Bottom
    3. Generate new vertices


    ✔️ Cases

    • Inside → Inside
    • Outside → Outside
    • Inside → Outside
    • Outside → Inside

    🔹 7. Text Clipping

    ✔️ Methods

    1. All-or-None String Clipping

      • Entire text visible or invisible
    2. Character Clipping

      • Individual characters clipped
    3. Component Clipping

      • Each character treated as polygon

    🔹 8. Important Terms

    • Clipping Window: Visible region
    • Viewport: Display area
    • Region Code: Binary code for position
    • Intersection Point: Where line meets boundary

    🔹 9. Diagram Descriptions

    ✔️ Clipping Window

    • Draw rectangle (window)
    • Show objects partly inside/outside

    ✔️ Cohen-Sutherland Regions

    • Divide plane into 9 regions
    • Label region codes

    ✔️ Line Clipping

    • Draw line crossing boundary
    • Show clipped portion

    🔹 10. Advantages of Clipping

    • Improves efficiency
    • Displays only required part
    • Saves memory and processing time

    🔹 11. Limitations

    • Complex calculations for polygons
    • May require multiple steps

    📝 Likely Exam Questions

    1. Define clipping in computer graphics.
    2. What is a clipping window and viewport?
    3. Explain point clipping with conditions.
    4. Describe Cohen-Sutherland algorithm.
    5. Explain Liang-Barsky algorithm.
    6. What is polygon clipping?
    7. Explain Sutherland-Hodgman algorithm.
    8. What are types of text clipping?
    9. Differentiate between clipping and windowing.
    10. Solve a numerical on line clipping.

    ⚡ Quick Revision Summary

    • Clipping removes unwanted parts outside window
    • Types: Point, Line, Polygon, Text
    • Cohen-Sutherland → region codes
    • Liang-Barsky → parametric method
    • Sutherland-Hodgman → polygon clipping
    • Condition for point: [ x_{min} \le x \le x_{max},\ y_{min} \le y \le y_{max} ]

    Previous topic 6
    2D Transformations
    Next topic 8
    3D Concepts

    Past Papers

    Open this section to load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time3 min
      Word count542
      Code examples0
      DifficultyBeginner