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›Triangle Rasterization
    Computer GraphicsTopic 12 of 15

    Triangle Rasterization

    4 minread
    603words
    Beginnerlevel

    📘 Triangle Rasterization — Exam Notes (Computer Graphics)


    🔹 1. Introduction

    Triangle Rasterization is the process of converting a triangle (defined by 3 vertices in 2D/3D space) into a set of pixels on the screen.

    👉 In simple words: It decides which pixels inside a triangle should be colored to display it on a raster screen.


    🔹 2. Why Triangles?

    Triangles are used because:

    • Always planar (flat surface)
    • Simple mathematical processing
    • Efficient for GPUs
    • Basis of all 3D models (triangle mesh)

    🔹 3. Basic Idea of Rasterization

    Given triangle vertices: [ A(x_1,y_1),; B(x_2,y_2),; C(x_3,y_3) ]

    👉 Goal:

    • Fill all pixels inside the triangle boundary

    🔹 4. Steps in Triangle Rasterization

    ✔️ Step 1: Find Bounding Box

    • Determine smallest rectangle covering triangle: [ x_{min}, x_{max}, y_{min}, y_{max} ]

    👉 Only pixels inside this box are checked.


    ✔️ Step 2: Scan Each Pixel

    • Check every pixel inside bounding box

    ✔️ Step 3: Inside-Outside Test

    • Decide whether pixel lies inside triangle

    ✔️ Step 4: Color Pixel

    • If inside → fill pixel
    • If outside → ignore

    🔹 5. Methods of Triangle Rasterization


    🔸 5.1 Edge Function Method (Very Important)

    ✔️ Concept

    A point is inside triangle if it is on the same side of all edges.


    ✔️ Edge Equation

    For edge between two points: [ E(x,y) = Ax + By + C ]


    ✔️ Rule

    For triangle ABC:

    • Compute edge functions:

      • AB, BC, CA
    • If all have same sign → point is inside


    ✔️ Advantages

    • Fast
    • Used in GPUs
    • Easy parallelization

    🔸 5.2 Barycentric Coordinate Method

    ✔️ Concept

    Any point inside triangle can be written as:

    [ P = \alpha A + \beta B + \gamma C ]

    Where:

    • (\alpha + \beta + \gamma = 1)

    ✔️ Inside Condition

    Point is inside if: [ 0 \le \alpha, \beta, \gamma \le 1 ]


    ✔️ Advantages

    • Used for interpolation (color, texture, depth)
    • Very accurate

    🔸 5.3 Scan Line Algorithm

    ✔️ Concept

    • Draw horizontal lines (scan lines)
    • Find intersection points with triangle edges
    • Fill pixels between intersections

    ✔️ Steps

    1. For each scan line (row):
    2. Find intersection with triangle edges
    3. Sort intersection points
    4. Fill pixels between pairs

    ✔️ Advantage

    • Efficient for filled polygons

    🔹 6. Pixel Coverage Concept

    • Each pixel has a center point
    • If center lies inside triangle → pixel is filled

    🔹 7. Important Tests (Inside Triangle)


    ✔️ 7.1 Area Method

    Idea:

    If point is inside triangle:

    [ Area(ABC) = Area(PBC) + Area(APC) + Area(ABP) ]


    ✔️ 7.2 Sign Method

    • Check orientation using cross product
    • Same sign → inside

    🔹 8. Interpolation (Important in Graphics)

    Used to calculate:

    • Color
    • Texture
    • Depth

    Using barycentric coordinates.


    🔹 9. Applications

    • 3D rendering
    • Games
    • Animation
    • GPU pipelines
    • CAD systems

    🔹 10. Advantages

    • Efficient rendering
    • Works well with hardware (GPU)
    • Forms basis of real-time graphics

    🔹 11. Limitations

    • Large number of pixels to process
    • Requires optimization for real-time rendering

    🔹 12. Diagram Descriptions

    ✔️ Triangle Rasterization Grid

    • Draw triangle on pixel grid
    • Show filled pixels inside

    ✔️ Bounding Box

    • Rectangle surrounding triangle

    ✔️ Scan Lines

    • Horizontal lines filling triangle

    ✔️ Edge Test

    • Show pixel checked against triangle edges

    📝 Likely Exam Questions

    1. Define triangle rasterization.
    2. Why are triangles used in graphics?
    3. Explain bounding box method.
    4. What is edge function method?
    5. Explain barycentric coordinates.
    6. Describe scan line algorithm.
    7. How do you determine if a point lies inside a triangle?
    8. What is pixel coverage?
    9. Explain interpolation in rasterization.
    10. Compare different rasterization methods.

    ⚡ Quick Revision Summary

    • Triangle rasterization = converting triangle into pixels

    • Steps:

      • Find bounding box
      • Test pixels
      • Fill inside pixels
    • Methods:

      • Edge function (fastest, GPU-based)
      • Barycentric coordinates (used for interpolation)
      • Scan line algorithm (horizontal filling)
    • Core idea: decide inside vs outside pixels


    Previous topic 11
    Triangles and Planes
    Next topic 13
    Lighting

    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 time4 min
      Word count603
      Code examples0
      DifficultyBeginner