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
    🧩
    HCI & Computer Graphics
    COMP3145
    Progress0 / 73 topics
    Topics
    1. The Human: Input-output channels2. Human memory3. Thinking, Reasoning, Problem solving4. Emotions and Individual differences5. Psychology and design of interacting systems6. The Computer: Text entry devices7. Positioning, Pointing, and drawing devices8. Display devices9. Devices for virtual reality and 3D interaction10. Physical controls, Sensors and special devices11. Paper printing and scanning12. Memory, Processing and networks13. The Interaction: Models of interaction14. Frameworks and HCI15. Ergonomics16. Interaction styles17. Elements of the WIMP interfaces18. Interactivity and Context of interaction19. Usability Paradigm and Principles: Introduction20. Paradigms for interaction21. Interaction Design Basics: What is design22. Process of design and User focus23. Navigation design24. Screen design and layout25. Iteration and prototyping26. HCI in Software Process: Software life cycle27. Usability engineering28. Iterative design and prototyping29. Design rationale30. Design rules and Guidelines31. Golden rules and heuristics32. HCI patterns33. Evaluation techniques and methods34. Task analysis35. Universal design36. User support systems37. Computer Supported Cooperative Work38. Groupware systems39. Implementation of synchronous groupware40. Ubiquitous computing41. History of Computer Graphics42. Graphics architectures and software43. Imaging and vision: Pinhole camera, Human vision, Synthetic camera44. Modeling vs. rendering45. OpenGL Architecture46. Displaying simple two-dimensional geometric objects47. Positioning systems and windowed environment48. Color perception and models49. RGB, CMY, HLS color models50. Color transformations51. Color in OpenGL: RGB and indexed color52. Input: Network environment and client-server computing53. Input measures: event, sample and request input54. Using callbacks and picking55. Affine transformations: translation, rotation, scaling, shear56. Homogeneous coordinates and concatenation57. Current transformation and matrix stacks58. Three Dimensional Graphics: Classical viewing59. Specifying views in 3D60. Affine transformation in 3D61. Projective transformations62. Ray tracing63. Shading: Illumination and surface modeling64. Phong shading model65. Polygon shading66. Rasterization: Line drawing via Bresenham's algorithm67. Clipping and polygonal fill68. BitBlt operations69. Hidden surface removal (z buffer)70. Discrete Techniques: Buffers71. Reading and writing bitmaps and pixel maps72. Texture mapping73. Compositing
    COMP3145›Clipping and polygonal fill
    HCI & Computer GraphicsTopic 67 of 73

    Clipping and polygonal fill

    3 minread
    428words
    Beginnerlevel

    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 load past papers

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