comethrusws / CG-Practicals

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CG Practical Codes Repository

Welcome to the CG (Computer Graphics) Practical Codes Repository! ๐ŸŽ‰

This repository contains C implementations of various computer graphics algorithms and techniques i did in 3rd Semester of my CS Degree. Whether you're a newbie learning computer graphics or a junior looking for reference implementations, you've come to the right place! ๐Ÿ–ฅ๏ธ

Algorithms Implemented

2D Transformations

  • 2DLineClip.cpp: Implementation of 2D line clipping algorithm.
  • 2DReflection.cpp: Implementation of 2D reflection about different axes.
  • 2DRotation.cpp: Implementation of 2D rotation around a point.
  • 2DScaling.cpp: Implementation of 2D scaling transformation.
  • 2Dtranslation.cpp: Implementation of 2D translation transformation.

3D Transformations

  • 3DTransformation.cpp: Implementation of 3D transformations.
  • 3dTranslation.cpp: Implementation of 3D translation transformation.

Line Drawing Algorithms

  • BLA.cpp: Implementation of Bresenham's Line Drawing Algorithm.
  • DDA.cpp: Implementation of Digital Differential Analyzer (DDA) Line Drawing Algorithm.

Circle and Ellipse Drawing Algorithms

  • MidpointCircle.cpp: Implementation of Midpoint Circle Drawing Algorithm.
  • MidpointEllipse.cpp: Implementation of Midpoint Ellipse Drawing Algorithm.

How to Use

Each .cpp file contains the implementation of a specific algorithm. To use any of these implementations, simply compile the respective file using a C++ compiler such as g++: g++ 2DLineClip.cpp -o 2DLineClip && ./2DLineClip

For Linux Systems, refer to the run.txt or simply, run: g++ -o ellip MidpointEllipse.cpp -lglut -lGLU -lGL && ./ellip

Replace 2DLineClip.cpp and 2DLineClip with the name of the desired file and executable, respectively.

Feel free to explore the code, experiment with different parameters, and integrate these algorithms into your own projects! โœจ

Contribution

If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request. Contributions from all skill levels are welcome! ๐Ÿ™Œ

Cheers x ๐ŸŒŸ

About


Languages

Language:C 72.6%Language:C++ 27.4%