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›Point and Line Drawing Techniques
    Computer GraphicsTopic 3 of 15

    Point and Line Drawing Techniques

    4 minread
    669words
    Beginnerlevel

    📘 Point and Line Drawing Techniques — Exam Notes


    🔹 1. Introduction

    Point and Line Drawing Techniques are fundamental methods in computer graphics used to display basic geometric primitives like points and lines on a screen.

    👉 These are the building blocks for drawing complex shapes and images.


    🔹 2. Point Drawing (Pixel Plotting)

    ✔️ Definition

    A point is the smallest graphical element displayed on the screen, represented by a pixel at a specific coordinate (x, y).


    ✔️ How a Point is Drawn

    1. Specify coordinates (x, y)
    2. Assign a color value
    3. Store in frame buffer
    4. Display on screen

    ✔️ Example

    To draw a point at (5, 10):

    • Activate pixel at row = 10, column = 5

    ✔️ Diagram Description

    • Draw X-axis and Y-axis
    • Mark a point at (x, y)
    • Show it as a single filled dot

    🔹 3. Line Drawing

    ✔️ Definition

    A line is a continuous set of points between two endpoints:

    [ (x_1, y_1) \quad \text{and} \quad (x_2, y_2) ]


    ✔️ Challenges in Line Drawing

    • Pixels are discrete (not continuous)
    • Need to choose best pixels to approximate a straight line
    • Efficiency is important

    🔹 4. Line Drawing Algorithms


    🔸 4.1 DDA Algorithm (Digital Differential Analyzer)

    ✔️ Concept

    • Uses incremental calculation
    • Calculates intermediate points between endpoints

    ✔️ Steps

    1. Calculate: [ dx = x_2 - x_1,\quad dy = y_2 - y_1 ]

    2. Find number of steps: [ steps = \max(|dx|, |dy|) ]

    3. Calculate increments: [ x_{inc} = \frac{dx}{steps},\quad y_{inc} = \frac{dy}{steps} ]

    4. Start from (x₁, y₁)

    5. Repeat:

      • Plot (x, y)
      • Update: [ x = x + x_{inc},\quad y = y + y_{inc} ]

    ✔️ Example

    Draw line from (2, 2) to (6, 4):

    • dx = 4, dy = 2
    • steps = 4
    • x_inc = 1, y_inc = 0.5

    Points: (2,2), (3,2.5), (4,3), (5,3.5), (6,4)


    ✔️ Advantages

    • Simple to understand
    • Easy implementation

    ✔️ Disadvantages

    • Uses floating-point operations
    • Less efficient

    🔸 4.2 Bresenham’s Line Algorithm

    ✔️ Concept

    • Uses integer calculations only
    • More efficient than DDA

    ✔️ Idea

    • Decide which pixel is closer to the true line
    • Use a decision parameter

    ✔️ Steps (for slope < 1)

    1. Input endpoints (x₁, y₁), (x₂, y₂)

    2. Calculate: [ dx = x_2 - x_1,\quad dy = y_2 - y_1 ]

    3. Initialize decision parameter: [ p = 2dy - dx ]

    4. Start from (x₁, y₁)

    5. For each x:

      • If ( p < 0 ): → Next point = (x+1, y) → ( p = p + 2dy )

      • Else: → Next point = (x+1, y+1) → ( p = p + 2dy - 2dx )


    ✔️ Example (Simple)

    Line from (0,0) to (5,3)

    • dx = 5, dy = 3
    • p = 2(3) − 5 = 1

    Then calculate points step by step using decision parameter.


    ✔️ Advantages

    • Fast and efficient
    • Uses integer arithmetic
    • Widely used in graphics systems

    ✔️ Disadvantages

    • More complex than DDA

    🔹 5. Comparison: DDA vs Bresenham

    Feature DDA Algorithm Bresenham Algorithm
    Calculation Floating-point Integer-based
    Speed Slower Faster
    Accuracy Less accurate More accurate
    Complexity Simple Moderate

    🔹 6. Important Terms

    • Pixel: Smallest display unit
    • Resolution: Number of pixels
    • Slope (m): [ m = \frac{dy}{dx} ]
    • Decision Parameter: Helps choose next pixel

    🔹 7. Diagram Descriptions

    ✔️ Line Drawing

    • Draw a grid (pixels)
    • Mark start and end points
    • Show approximate line using filled pixels

    ✔️ DDA Representation

    • Show incremental steps along line

    ✔️ Bresenham Representation

    • Show two possible pixels at each step
    • Highlight chosen pixel

    📝 Likely Exam Questions

    1. Define point and line in computer graphics.
    2. Explain point plotting with example.
    3. Describe DDA line drawing algorithm with steps.
    4. Explain Bresenham’s line algorithm.
    5. Compare DDA and Bresenham algorithms.
    6. What are the challenges in line drawing?
    7. Define slope and decision parameter.
    8. Solve a numerical using DDA algorithm.

    ⚡ Quick Revision Summary

    • Point = Single pixel at (x, y)

    • Line = Set of connected pixels

    • DDA Algorithm = Uses floating-point increments

    • Bresenham Algorithm = Uses integer calculations

    • Bresenham is faster and more efficient

    • Key formulas:

      • ( dx = x_2 - x_1 ), ( dy = y_2 - y_1 )
      • ( m = dy/dx )

    Previous topic 2
    Graphics Systems
    Next topic 4
    Circle Drawing Techniques

    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 count669
      Code examples0
      DifficultyBeginner