Skip to content

This repository hosts C++ implementations of essential computer graphics algorithms. Included are algorithms such as DDA (Digital Differential Analyzer), Bresenham's Line Algorithm, Bresenham's Circle Algorithm, Midpoint Ellipse Algorithm, Rotational Midpoint Ellipse, and the Scan Line Polygon Algorithm. These algorithms serve as foundational tool.

License

Notifications You must be signed in to change notification settings

nightmare117/Computer-Graphics-Algorithms

Repository files navigation

Computer Graphics Algorithms in C++ with GLUT

This repository contains C++ implementations of fundamental computer graphics algorithms, including DDA (Digital Differential Analyzer), Bresenham's Line Algorithm, Bresenham's Circle Algorithm, Midpoint Ellipse Algorithm, Rotational Midpoint Ellipse, and the Scan Line Polygon Algorithm. These algorithms are commonly used in computer graphics for tasks like drawing lines, circles, ellipses, and filling polygons.

Table of Contents

Prerequisites

Before you can use or contribute to this project, you should have the following installed on your system:

  • C++ Compiler (e.g., g++)
  • GLUT Library (OpenGL Utility Toolkit)

Getting Started

To get started with this project, follow these steps:

  • Clone the repository to your local machine:

    git clone https://github.com/nightmare117/Graphics-Algorithms.git
  • Compile the cpp files using your C++ compiler

Usage

There are seperate cpp files for each algorithm. You can run any fiile and it may require some inputs from the user.

Algorithms Included

  • DDA (Digital Differential Analyzer) Line Drawing Algorithm: This algorithm draws a line segment between two given points.
  • Bresenham's Line Algorithm: An efficient algorithm for drawing lines.
  • Bresenham's Circle Algorithm: Used for drawing circles.
  • Midpoint Ellipse Algorithm: Draws ellipses based on user input.
  • Rotational Midpoint Ellipse Algorithm: Draws rotated ellipses, allowing for arbitrary orientations.
  • Scan Line Polygon Algorithm: Fills a polygon defined by its vertices using the scan line algorithm.

Contributing

Contributions to this project are welcome! If you'd like to contribute:

  • Fork the repository.
  • Create a new branch for your feature or bug fix: git checkout -b feature-name.
  • Implement your changes.
  • Test your changes to ensure they work as expected.
  • Commit your changes: git commit -m "Add feature or fix"
  • Push your changes to your fork: git push origin feature-name.
  • Create a Pull Request in this repository.

Please follow the Contributing Guidelines for more details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

This repository hosts C++ implementations of essential computer graphics algorithms. Included are algorithms such as DDA (Digital Differential Analyzer), Bresenham's Line Algorithm, Bresenham's Circle Algorithm, Midpoint Ellipse Algorithm, Rotational Midpoint Ellipse, and the Scan Line Polygon Algorithm. These algorithms serve as foundational tool.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages