/Computer-Graphics-6th-Sem

Contains the weekly assignments of the course Computer Graphics

Primary LanguageC++

Computer-Graphics-6th-Sem

This repository contains the code for all the weekly assignments of the course Computer Graphics. It uses OpenGL as the underlying software. Various algorithms are implemented. They are listed as follows,

  1. Week 1 Line Drawing Algorithms
    1. DDA - Calculate the number of steps needed to reach the destination and find the increment needed in X and Y direction. Plot the points accordingly.
    2. Bresenham - At a point (x,y) you have a choice to go to (x+1,y) and (x+1,y+1). This algorithm makes this choice on the basis of which point is closer. Uses only Integer calculations.
  2. Week 2 Circle Drawing algorithm
    1. Bresenham - At a point (x,y), you have a choice to go to (x+1,y-1) or (x+1,y). This algorithm makes this choice on the basis of decision parameter.
  3. Week 3
    1. 2 dimensional transformations like rotation, scaling and translation were performed.
  4. Week 4
    1. 2 Dimensional trnasformations were performed by using a state matrix of the figure and making the appropriate calculations.
  5. Week 5
    1. Cohen's Line clipping algorithm - The screen is divided into 9 parts with the center part as the focus. The remaining 4 parts are described with the help of a 4 bit value. Line is clipped accordingly.
  6. Week 6
    1. Sierpinski triangle - This is a recursive algorithm which divided a trianel into 4 smaller triangle by joining the medians of the three sides and then performing the same on the three outer triangles.
  7. Week 7
    1. Stack - Visual implementation of push and pop operations of a stack along with a pointer which moves along te top value.
    2. Queue - Visual implementation of enqueue and dequeue operations of a queue along with 2 pointers which moved along the front and rear value.