Design, Develop and Implement a Program in C for converting an Infix Expression to Postfix Expression

ABOUT THE EXPERIMENT: Infix: Operators are written in-between their operands. Ex: X + YPrefix: Operators are written before their operands. Ex: +X Ypostfix: Operators are written after their operands. Ex:…

Continue ReadingDesign, Develop and Implement a Program in C for converting an Infix Expression to Postfix Expression

OpenGL program to develop a menu driven program to fill the polygon using scan line algorithm

Objective: In this program the students will learn to apply scan-line area filling algorithm to fill a polygon using OpenGL functions.Input: Provide the eight vertices to draw the polygon.Output: Polygon…

Continue ReadingOpenGL program to develop a menu driven program to fill the polygon using scan line algorithm

OpenGL program to Implement Bresenham’s line drawing algorithm for all types of slope

Program // Bresenham's Line Drawing #include #include #include int x1, y1, x2, y2; void myInit() { glClear(GL_COLOR_BUFFER_BIT); glClearColor(0.0, 0.0, 0.0, 1.0); glMatrixMode(GL_PROJECTION); gluOrtho2D(0, 500, 0, 500); } void draw_pixel(int x,…

Continue ReadingOpenGL program to Implement Bresenham’s line drawing algorithm for all types of slope

Create and rotate a triangle about the origin and a fixed point

#include #include #include #include int x,y; int rFlag=0; void draw_pixel(float x1,float y1) { glColor3f(0.0,0.0,1.0); glPointSize(5.0); glBegin(GL_POINTS); glVertex2f(x1,y1); glEnd(); } void triangle() { glColor3f(1.0,0.0,0.0); glBegin(GL_POLYGON); glVertex2f(100,100); glVertex2f(250,400); glVertex2f(400,100); glEnd(); } float…

Continue ReadingCreate and rotate a triangle about the origin and a fixed point