Program: #include <GL/gl.h> #include <GL/glut.h> #include <math.h> //global variable diclaration int frameNumber = 0; //fr...
Read More
Showing posts with label CG_OPENGL. Show all posts
Showing posts with label CG_OPENGL. Show all posts
13 Program to draw Koch Curve/Koch snowflake in OpenGL
Program: #include <iostream> #include <GL/glut.h> #include <GL/freeglut.h> #include <math.h> using namespace std; #...
Read More
12 Program to implement Sutherland Hodgman Polygon Clipping in OpenGL
Program: // Sutherland Hodgman Polygon Clipping Complete Code | implementation through openGL #include <stdio.h> #include <GL/gl.h...
Read More
11 OpenGL Program to Perform 2D Transformation: 1) Reflection and 2)Shearing on a Polygon
Program: #include<GL/glut.h> #include<math.h> double parr[8]; void init() { glClear(GL_COLOR_BUFFER_BIT); glClearColor(0,0,...
Read More
10 Program to draw hill using Bresenham Line Drawing Algorithm and fill color using Seed fill Algorithm in OpenGL
Program: #include<GL/glut.h> void init() { glClear(GL_COLOR_BUFFER_BIT); glClearColor(1,1,1,0); gluOrtho2D(0,500,0,500); } int l...
Read More
9 OpenGL Program for 2D Transformation 1) Translation 2) Scaling 3) Rotation on a Polygon
Program: #include<GL/glut.h> #include<math.h> double parr[8]; void init() { glClear(GL_COLOR_BUFFER_BIT); glClearColor(0,0,...
Read More
8 Program for clipping a Line using Cohen Sutherland Algorithm in OpenGL
Program: #include<GL/glut.h> // TBRL int left = 1,right = 2, top = 8, bottom = 4; int xmin = 100, xmax = 400, ymin = 100, ymax = 40...
Read More
7 Program to fill Polygon using Boundary Fill Algorithm in OpenGL
Program: #include<GL/glut.h> #include<iostream> using namespace std; void myInit() { gluOrtho2D(0,500,0,500); glClear...
Read More
6 Program to draw Ring Pattern using Bresenham Circle Drawing Algorithm using OpenGL
Program 1: #include<GL/glut.h> #include<iostream> #include <math.h> using namespace std; void myInit() { gluOrtho2D...
Read More
Subscribe to:
Posts (Atom)