ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalCOMP3145Clipping Polygonal Fil…
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    COMP3145

    HCI & Computer Graphics

    Progress0 / 73 done
    Topics73
    1Input-output channels2Human memory3Thinking, Reasoning, Problem solving4Emotions and Individual differences5Psychology and design of interacting systems
    6Text entry devices7Positioning, Pointing, and drawing devices8Display devices9Devices for virtual reality and 3D interaction10Physical controls, Sensors and special devices11Paper printing and scanning12Memory, Processing and networks
    13Models of interaction14Frameworks and HCI15Ergonomics16Interaction styles17Elements of the WIMP interfaces18Interactivity and Context of interaction
    19Introduction20Paradigms for interaction
    21What is design22Process of design and User focus23Navigation design24Screen design and layout25Iteration and prototyping
    26Software life cycle27Usability engineering28Iterative design and prototyping29Design rationale30Design rules and Guidelines31Golden rules and heuristics32HCI patterns33Evaluation techniques and methods34Task analysis35Universal design36User support systems37Computer Supported Cooperative Work38Groupware systems39Implementation of synchronous groupware40Ubiquitous computing41History of Computer Graphics42Graphics architectures and software
    43Pinhole camera, Human vision, Synthetic camera44Modeling vs. rendering45OpenGL Architecture46Displaying simple two-dimensional geometric objects47Positioning systems and windowed environment48Color perception and models49RGB, CMY, HLS color models50Color transformations
    51RGB and indexed color
    52Network environment and client-server computing
    53event, sample and request input54Using callbacks and picking
    55translation, rotation, scaling, shear56Homogeneous coordinates and concatenation57Current transformation and matrix stacks
    58Classical viewing59Specifying views in 3D60Affine transformation in 3D61Projective transformations62Ray tracing
    63Illumination and surface modeling64Phong shading model65Polygon shading
    66Line drawing via Bresenham's algorithm67Clipping and polygonal fill68BitBlt operations69Hidden surface removal (z buffer)
    70Buffers71Reading and writing bitmaps and pixel maps72Texture mapping73Compositing
    3 min read
    Topic 67 of 73
    Topic Study Note Illustration
    67

    Clipping and polygonal fill

    Clipping is the process of removing parts of graphics primitives (lines, polygons) that lie outside a defined viewing area or window .

    1. Clipping

    Clipping is the process of removing parts of graphics primitives (lines, polygons) that lie outside a defined viewing area or window.

    • The viewing area is often called the clip window.
    • Clipping ensures that only visible parts of objects are drawn, improving performance.

    1.1 Types of Clipping

    A. Point Clipping

    • Check if a point lies inside or outside the clipping window.

    B. Line Clipping

    • Remove portions of a line outside the clip window.

    • Common algorithms:

      1. Cohen–Sutherland Algorithm

        • Divides space into 9 regions.
        • Uses region codes to determine trivial acceptance or rejection.
      2. Liang–Barsky Algorithm

        • Uses parametric line equations for efficient clipping.

    C. Polygon Clipping

    • Remove portions of a polygon outside the clip window.

    • Common algorithms:

      1. Sutherland–Hodgman Algorithm

        • Clips polygon edge by edge against each boundary.
      2. Weiler–Atherton Algorithm

        • Handles complex polygons and holes.

    1.2 Example: Cohen–Sutherland Line Clipping

    • Assign a 4-bit code to each endpoint based on position relative to window.

    • Use logical AND/OR operations to decide if line is:

      • Completely inside → draw fully.
      • Completely outside → reject.
      • Partially inside → compute intersection with window boundaries.

    2. Polygonal Fill

    Polygonal fill is the process of coloring the interior of a polygon.

    • After clipping, polygons may need to be filled for rendering solid shapes.
    • Filling determines which pixels inside the polygon should take the polygon’s color.

    2.1 Polygon Filling Algorithms

    A. Scan-Line Algorithm

    • Process the polygon row by row (scanlines).

    • Steps:

      1. Compute intersections of polygon edges with the scanline.
      2. Sort intersections by x-coordinate.
      3. Fill pixels between pairs of intersections.
    • Efficient and widely used.

    B. Flood Fill Algorithm

    • Start at a seed point inside polygon.
    • Recursively (or iteratively) fill neighboring pixels until boundary is reached.
    • Slower for large polygons; good for irregular shapes.

    C. Boundary Fill Algorithm

    • Similar to flood fill but uses boundary color instead of interior color for stopping.

    2.2 Scan-Line Polygon Fill Example

    For a polygon with vertices:

    1. Determine Ymin and Ymax.

    2. For each scanline from Ymin to Ymax:

      • Find intersection points with polygon edges.
      • Sort intersections by X.
      • Fill pixels between pairs of intersections.

    3. Summary Table

    Concept Purpose Common Algorithms Notes
    Clipping Remove parts outside view Cohen–Sutherland, Liang–Barsky, Sutherland–Hodgman Improves efficiency and avoids drawing invisible pixels
    Polygon Fill Color the interior of polygon Scan-line, Flood fill, Boundary fill Scan-line most efficient for convex & concave polygons

    Key Points:

    • Clipping → ensures only visible parts of graphics primitives are drawn.
    • Polygon fill → fills the interior of polygons for rendering solid objects.
    • Scan-line and flood-fill are fundamental filling techniques, often used in raster graphics.
    ← Previous topic 66
    Rasterization: Line drawing via Bresenham's algorithm
    Next topic 68 →
    BitBlt operations

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    3mremaining
    428words
    Beginnerlevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    HCI & Computer Graphics