This repository contains the Assignment code of Computer Graphics Assignments of SPPU, Second Year IT Syllabus (2019 pattern)
OS used: Ubuntu
- sudo apt-get update
- sudo apt-get install freeglut3
- sudo apt-get install freeglut3-dev
- sudo apt-get install g++ cmake
- sudo apt-get install libglew-dev
- sudo apt-get install g++
- sudo apt-get install mesa-common-dev
- sudo apt-get install build-essential
- sudo apt-get install libglew1.5-dev libglm-dev
After your development libraries have been installed to get information about the OpenGL and GLX implementations running on a given X display.
glxinfo | grep OpenGL
- g++ filename.cpp -lglut -lGL -lGLEW -lGLU -o filename
- ./filename
#include<iostream>
#include<GL/glut.h>
void Draw(){
glClear(GL_COLOR_BUFFER_BIT);
glPointSize(5);
glBegin(GL_POINTS);
glVertex2f(0,0);
glEnd();
glFlush();
}
int main(int c, char*V[]) {
glutInit(&c,V);
glutInitWindowSize(500,700);
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
glutCreateWindow("Basic opengl program");
glClearColor(0,0,0,1);
glColor3f(1,1,1);
glutDisplayFunc(Draw);
glutMainLoop();
return 0;
}
This repository contains the Assignment code of Computer Graphics Lab of SPPU, Second Year IT Syllabus (2019 pattern)
ASSIGNMENT | PROBLEM STATEMENT |
---|---|
Assignment 2 | Implement DDA and Bresenham line drawing algorithm to draw: i) Simple Line ii) Dotted Line iii) Dashed Line iv) Solid line; using mouse interface Divide the screen in four quadrants with center as (0, 0). The line should work for all the slopes positive as well as negative. |
Assignment 3 | Implement Bresenham circle drawing algorithm to draw any object.The object should be displayed in all the quadrants with respect to center and radius |
Assignment 4 | Implement the following polygon filling methods : i) Flood fill / Seed fill ii) Boundary fill ; using mouse click, keyboard interface and menu driven programming |
Assignment 5 | Implement Cohen Sutherland polygon clipping method to clip the polygon with respect the viewport and window. Use mouse click, keyboard interface |
Assignment 6 | Implement following 2D transformations on the object with respect to axis i) Scaling ii) Rotation about arbitrary point iii) Reflection |
Assignment 7 | Generate fractal patterns using i) Koch Curve |