Skip to content

This JavaFX-based application visually demonstrates core computer graphics algorithms — DDA Line Drawing and Midpoint Circle Drawing — implemented from scratch using low-level pixel plotting directly on the canvas

Notifications You must be signed in to change notification settings

mennadevhub/Graphics-Algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎨 Computer Graphics – DDA Line & Midpoint Circle Drawing

This JavaFX project demonstrates two classic computer graphics algorithms:

  1. DDA Line Drawing Algorithm
  2. Midpoint Circle Drawing Algorithm

These algorithms are used to draw straight lines and perfect circles pixel-by-pixel on a canvas, which is a foundational topic in computer graphics.


📷 Output Screenshot

![DDA Line & Circle Output] Screenshot (24)


💡 Description

This JavaFX application draws a line using the DDA algorithm and a circle using the Midpoint Circle Drawing algorithm on a black canvas.
It uses pixel-level plotting via GraphicsContext.fillRect() to simulate low-level drawing, just like what happens in OpenGL or raster graphics.


🧠 Algorithms Used

✅ DDA Line Drawing

  • Calculates dx and dy between two points
  • Determines the number of steps based on the greater value
  • Increments x and y gradually using floating-point arithmetic

✅ Midpoint Circle Drawing

  • Uses symmetry of a circle to plot 8 points per iteration
  • Efficient integer-based algorithm
  • Avoids floating-point arithmetic for speed

🚀 How to Run

  1. Download or clone the project:

    git clone https://github.com/mennadevhub/projectfx.git
    
  2. Make sure you have Java 21 and JavaFX SDK configured.

  3. Run GraphicsReport.java in your IDE or via terminal:

    javac --module-path javafx-sdk-21.0.7/lib --add-modules javafx.controls src/GraphicsReport.java
    java --module-path javafx-sdk-21.0.7/lib --add-modules javafx.controls -cp src GraphicsReport
    

About

This JavaFX-based application visually demonstrates core computer graphics algorithms — DDA Line Drawing and Midpoint Circle Drawing — implemented from scratch using low-level pixel plotting directly on the canvas

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages