Warli Painting Computer Graphics Project in OpenGL Source Code – 18CSL67

Warli Painting Computer Graphics Project in OpenGL Source Code – 18CSL67

Here you can download the source code of Warli Painting Computer Graphics Project in OpenGL aceedemic mini-project.

Project Description of Warli painting of CGV mini-project

The basic objective of our project is to draw a Warli painting. This project demonstrates the usage of various functions available in OpenGL to draw a simple Warli painting. Warli art is a beautiful folk art of Maharashtra, traditionally created by the tribal women. Tribals are the Warli, Malkhar Koli, Kathodi, Konkana, Dhodi tribes found on the northern outskirts of Mumbai, in Western India. This art was first explored in the early seventies & from then it was named “Warli art”. 

Tribal people express themselves in vivid styles through paintings which they execute on the walls of their house. This was the only means of transmitting folklore to a populace not acquainted with the written word. Warli paintings were mainly done by the womenfolk. The most important aspect of the painting is that it does not depicts mythological characters or images of deities, but depicts social life.

Pictures of human beings and animals, along with scenes from daily life are created in a loose rhythmic pattern. Warli paintings are painted white on mud walls. The paintings are beautifully executed and usually depict scenes of human figures engaged in activities like hunting, dancing, sowing, and harvesting.        

READ  17CS32 Analog and Digital Electronics Module 3

In this project, we have created a scene with two houses, mountains, sun, tree, and two humans with one human activity as dancing and the other human harvesting. All these objects are created with the graphics functions available in OpenGL.

Flow Diagram of Warli painting of CGV mini-project

Warli Painting Computer Graphics Project in OpenGL Source Code – 18CSL67

Source code of Warli Painting Computer Graphics Project in OpenGL

#include <stdlib.h>
#include<GL/glut.h>
#include<float.h>
#include<math.h>
#include<stdio.h>
#include<stdarg.h>
#include<string.h>
GLint Submenu1,Submenu2,Submenu3,flag=0,flag1=0,flag2=0,flag3=0,flag4=0,flag5=0,flag6=0,flag7=0, flag123=0;
GLfloat Red=1.0,Green=0.0,Blue=0.0;

void drawstring(float x,float y,float z,char *string)
{
char *c;
 glRasterPos3f(x,y,z);
 for(c=string;*c!='\0';c++)
 {
  glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24,*c);
 }
}

void screen()
{
	glColor3f(1.0,0.0,1.0);
	drawstring(120,450,0.0,"CGV MINI PROJECT");
	drawstring(200,420,0.0,"BY");
	drawstring(150,380,0.0,"RISING STARS");
	drawstring(200,350,0.0,"ON");
	drawstring(150,320,0.0,"WARLI PAINING");
	drawstring(100,280,0.0,"By:");
	drawstring(50,250,0.0," Name ");
	drawstring(50,220,0.0," Name");
	drawstring(350,250,0.0,"USN");
	drawstring(350,220,0.0,"USN");
	drawstring(200,170,0.0,"GUIDE");
	drawstring(150,140,0.0,"Prof ");
	drawstring(50,30,0.0,"Press 'p' to start the project");
	glutSwapBuffers();

}


void draw_circle(float x, float y, float radius)
{
	glPushMatrix();
	glTranslatef(x,y,0.0f);
	static const int circle_points=100;
	float angle=2.0*3.14167/circle_points;
	glBegin(GL_POLYGON);
	double angle1=0.0;
	glVertex2d(radius*cos(0.0), radius*sin(0.0));
	int i;
	for(i=0; i<circle_points; i++)
	{
		glVertex2d(radius*cos(angle1), radius*sin(angle1));
		angle1+=angle;
	}
	glEnd();
	glPopMatrix();
}

void drawsun(float x,float y,float radius)
{
	if(flag6==0)
	{
	glColor3f(1.0,1.0,1.0);
	glPushMatrix();
	glTranslatef(x,y,0.0f);
	static const int circle_points=100;
	float angle=2.0*3.14167/circle_points;
	glBegin(GL_POLYGON);
	double angle1=0.0;
	glVertex2d(radius*cos(0.0), radius*sin(0.0));
	int i;
	for(i=0; i<circle_points; i++)
	{
		glVertex2d(radius*cos(angle1), radius*sin(angle1));
		angle1+=angle;
	}
	glEnd();
	glPopMatrix();
	}
	else if(flag6==1)
	{
	glColor3f(1.0,0.0,0.0);
	glPushMatrix();
	glTranslatef(x,y,0.0f);
	static const int circle_points=100;
	float angle=2.0*3.14167/circle_points;
	glBegin(GL_POLYGON);
	double angle1=0.0;
	glVertex2d(radius*cos(0.0), radius*sin(0.0));
	int i;
	for(i=0; i<circle_points; i++)
	{
		glVertex2d(radius*cos(angle1), radius*sin(angle1));
		angle1+=angle;
	}
	glEnd();
	glPopMatrix();
	}

	else if(flag6==2)
	{
	glColor3f(1.0,1.0,0.0);
	glPushMatrix();
	glTranslatef(x,y,0.0f);
	static const int circle_points=100;
	float angle=2.0*3.14167/circle_points;
	glBegin(GL_POLYGON);
	double angle1=0.0;
	glVertex2d(radius*cos(0.0), radius*sin(0.0));
	int i;
	for(i=0; i<circle_points; i++)
	{
		glVertex2d(radius*cos(angle1), radius*sin(angle1));
		angle1+=angle;
	}
	glEnd();
	glPopMatrix();
	}
	
}

void drawtree()
{
		glPushMatrix();
		glBegin(GL_TRIANGLES);
		glColor3f(1.0, 1.0, 1.0);
		glVertex2f(50.0, 300.0);
		glVertex2f(35.0, 50.0);
		glVertex2f(65.0, 50.0);
		glEnd();
		
		glBegin(GL_TRIANGLES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(65.0, 300.0);
		glVertex2f(65.0, 265.0);
		glVertex2f(100.0, 275.0);
		glEnd();
		glFlush();

		glBegin(GL_TRIANGLES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(100.0, 300.0);
		glVertex2f(145.0, 315.0);
		glVertex2f(115.0, 325.0);
		glEnd();

		glBegin(GL_TRIANGLES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(60.0, 310.0);
		glVertex2f(100.0, 315.0);
		glVertex2f(80.0, 335.0);
		glEnd();

		glBegin(GL_TRIANGLES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(75.0, 350.0);
		glVertex2f(75.0, 385.0);
		glVertex2f(110.0, 350.0);
		glEnd();

		glBegin(GL_TRIANGLES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(50.0, 325.0);
		glVertex2f(65.0, 350.0);
		glVertex2f(35.0, 350.0);
		glEnd();

		glBegin(GL_TRIANGLES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(25.0, 350.0);
		glVertex2f(50.0, 375.0);
		glVertex2f(15.0, 385.0);
		glEnd();

		glBegin(GL_TRIANGLES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(40.0, 300.0);
		glVertex2f(10.0, 290.0);
		glVertex2f(25.0, 325.0);
		glEnd();

		glPopMatrix();
		glFlush();
		glutSwapBuffers();
}

void mountain()
{
	if(flag5==0)
	{
	glPushMatrix();
		glBegin(GL_TRIANGLES);
		glColor3f(1.0, 1.0, 1.0);
		glVertex2f(500.0, 475.0);
		glVertex2f(500.0, 400.0);
		glVertex2f(400.0, 400.0);
		glEnd();

		glBegin(GL_TRIANGLES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(400.0, 400.0);
		glVertex2f(250.0, 475.0);
		glVertex2f(100.0, 400.0);
		glEnd();

		glBegin(GL_TRIANGLES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(100.0, 400.0);
		glVertex2f(0.0, 400.0);
		glVertex2f(0.0, 475.0);
		glEnd();
	glPopMatrix();
	glutSwapBuffers();
	}
 	else if(flag5==1)
	{
	glPushMatrix();
		glBegin(GL_TRIANGLES);
		glColor3f(0.0,1.0,0.0);
		glVertex2f(500.0, 475.0);
		glVertex2f(500.0, 400.0);
		glVertex2f(400.0, 400.0);
		glEnd();

		glBegin(GL_TRIANGLES);
		glColor3f(0.0,1.0,0.0);
		glVertex2f(400.0, 400.0);
		glVertex2f(250.0, 475.0);
		glVertex2f(100.0, 400.0);
		glEnd();

		glBegin(GL_TRIANGLES);
		glColor3f(0.0,1.0,0.0);
		glVertex2f(100.0, 400.0);
		glVertex2f(0.0, 400.0);
		glVertex2f(0.0, 475.0);
		glEnd();
	glPopMatrix();
	glutSwapBuffers();
	}
	else if(flag5==2)
	{
	glPushMatrix();
		glBegin(GL_TRIANGLES);
		glColor3f(0.60,0.40,0.20);
		glVertex2f(500.0, 475.0);
		glVertex2f(500.0, 400.0);
		glVertex2f(400.0, 400.0);
		glEnd();

		glBegin(GL_TRIANGLES);
		glColor3f(0.60,0.40,0.20);
		glVertex2f(400.0, 400.0);
		glVertex2f(250.0, 475.0);
		glVertex2f(100.0, 400.0);
		glEnd();

		glBegin(GL_TRIANGLES);
		glColor3f(0.60,0.40,0.20);
		glVertex2f(100.0, 400.0);
		glVertex2f(0.0, 400.0);
		glVertex2f(0.0, 475.0);
		glEnd();
	glPopMatrix();
	glutSwapBuffers();
}
	else if(flag5==3)
	{
	glPushMatrix();
		glBegin(GL_TRIANGLES);
		glColor3f(0.0,0.0,1.0);
		glVertex2f(500.0, 475.0);
		glVertex2f(500.0, 400.0);
		glVertex2f(400.0, 400.0);
		glEnd();

		glBegin(GL_TRIANGLES);
		glColor3f(0.0,0.0,1.0);
		glVertex2f(400.0, 400.0);
		glVertex2f(250.0, 475.0);
		glVertex2f(100.0, 400.0);
		glEnd();

		glBegin(GL_TRIANGLES);
		glColor3f(0.0,0.0,1.0);
		glVertex2f(100.0, 400.0);
		glVertex2f(0.0, 400.0);
		glVertex2f(0.0, 475.0);
		glEnd();
	glPopMatrix();
	glutSwapBuffers();
}
}
void drawhouse1()
{
	glPushMatrix();
		glBegin(GL_TRIANGLES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(200.0, 350.0);
		glVertex2f(250.0, 375.0);
		glVertex2f(300.0, 350.0);
		glEnd();

		glBegin(GL_QUADS);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(215.0, 350.0);
		glVertex2f(215.0, 300.0);
		glVertex2f(285.0, 300.0);
		glVertex2f(285.0,350.0);
		glEnd();

		glBegin(GL_LINE_LOOP);
		glColor3f(0.60,0.40,0.0);
		glVertex2f(235.0, 325.0);
		glVertex2f(265.0, 325.0);
		glVertex2f(265.0, 300.0);
		glVertex2f(235.0,300.0);
		glEnd();
	glPopMatrix();

}

void drawhouse2()
 {
	if(flag4==0)
	{
	glPushMatrix();
		glBegin(GL_TRIANGLES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(375.0, 390.0);
		glVertex2f(335.0, 350.0);
		glVertex2f(420.0, 350.0);
		glEnd();

		glBegin(GL_QUADS);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(350.0, 350.0);
		glVertex2f(350.0, 300.0);
		glVertex2f(405.0, 300.0);
		glVertex2f(405.0,350.0);
		glEnd();

		glBegin(GL_LINE_LOOP);
		glColor3f(0.60,0.40,0.0);
		glVertex2f(370.0, 325.0);
		glVertex2f(370.0, 300.0);
		glVertex2f(385.0, 300.0);
		glVertex2f(385.0,325.0);
		glEnd();
	glPopMatrix();
	glutSwapBuffers();
	}
	else if(flag4==1)
	{
	glPushMatrix();
		glBegin(GL_TRIANGLES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(375.0, 390.0);
		glVertex2f(335.0, 350.0);
		glVertex2f(420.0, 350.0);
		glEnd();

		glBegin(GL_QUADS);
		glColor3f(1.0,0.0,0.0);
		glVertex2f(350.0, 350.0);
		glVertex2f(350.0, 300.0);
		glVertex2f(405.0, 300.0);
		glVertex2f(405.0,350.0);
		glEnd();

		glBegin(GL_QUADS);
		glColor3f(0.60,0.40,0.20);
		glVertex2f(370.0, 325.0);
		glVertex2f(370.0, 300.0);
		glVertex2f(385.0, 300.0);
		glVertex2f(385.0,325.0);
		glEnd();
	glPopMatrix();
	glutSwapBuffers();
	}
	else if(flag4==2)
	{
		glPushMatrix();
		glBegin(GL_TRIANGLES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(375.0, 390.0);
		glVertex2f(335.0, 350.0);
		glVertex2f(420.0, 350.0);
		glEnd();

		glBegin(GL_QUADS);
		glColor3f(0.0,1.0,0.0);
		glVertex2f(350.0, 350.0);
		glVertex2f(350.0, 300.0);
		glVertex2f(405.0, 300.0);
		glVertex2f(405.0,350.0);
		glEnd();

		glBegin(GL_QUADS);
		glColor3f(0.60,0.40,0.20);
		glVertex2f(370.0, 325.0);
		glVertex2f(370.0, 300.0);
		glVertex2f(385.0, 300.0);
		glVertex2f(385.0,325.0);
		glEnd();
	glPopMatrix();
	glutSwapBuffers();
	}
	else if(flag4==3)
	{
	glPushMatrix();
		glBegin(GL_TRIANGLES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(375.0, 390.0);
		glVertex2f(335.0, 350.0);
		glVertex2f(420.0, 350.0);
		glEnd();

		glBegin(GL_QUADS);
		glColor3f(0.0,0.0,1.0);
		glVertex2f(350.0, 350.0);
		glVertex2f(350.0, 300.0);
		glVertex2f(405.0, 300.0);
		glVertex2f(405.0,350.0);
		glEnd();

		glBegin(GL_QUADS);
		glColor3f(0.60,0.40,0.20);
		glVertex2f(370.0, 325.0);
		glVertex2f(370.0, 300.0);
		glVertex2f(385.0, 300.0);
		glVertex2f(385.0,325.0);
		glEnd();
	glPopMatrix();
	glutSwapBuffers();
	}
		
}

void drawgrass()
{
	glPushMatrix();
		glBegin(GL_LINES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(315.0, 25.0);
		glVertex2f(300.0, 70.0);

		glVertex2f(320.0, 25.0);
		glVertex2f(330.0,75.0);
	
		glVertex2f(335.0,25.0);
		glVertex2f(330.0,65.0);

		glVertex2f(345.0,25.0);
		glVertex2f(360.0,75.0);
		
		glVertex2f(360.0,25.0);
		glVertex2f(365.0,70.0);

		glVertex2f(365.0,25.0);
		glVertex2f(385.0,70.0);
		glEnd();
	glPopMatrix();
	glutSwapBuffers();
}

void drawhuman1()
{
	glPushMatrix();
		glBegin(GL_TRIANGLES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(150.0, 250.0);
		glVertex2f(150.0, 175.0);
		glVertex2f(225.0, 225.0);
		glEnd();

		glBegin(GL_TRIANGLES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(125.0, 100.0);
		glVertex2f(210.0, 125.0);
		glVertex2f(150.0, 175.0);
		glEnd();

		glBegin(GL_LINES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(150.0, 250.0);
		glVertex2f(125.0, 280.0);

		glVertex2f(125.0, 280.0);
		glVertex2f(140.0,295.0);
	
		glVertex2f(225.0,225.0);
		glVertex2f(240.0,185.0);

		glVertex2f(240.0,185.0);
		glVertex2f(225.0,175.0);
		
		glVertex2f(145.0,105.0);
		glVertex2f(165.0,60.0);

		glVertex2f(165.0,60.0);
		glVertex2f(190.0,50.0);

		glVertex2f(190.0,50.0);
		glVertex2f(180.0,40.0);

		glVertex2f(190.0,120.0);
		glVertex2f(225.0,100.0);

		glVertex2f(225.0,100.0);
		glVertex2f(250.0,125.0);

		glVertex2f(250.0,125.0);
		glVertex2f(255.0,120.0);
		glEnd();
	glPopMatrix();
glutSwapBuffers();
}

void drawhuman2()
{
	glPushMatrix();
		glBegin(GL_TRIANGLES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(450.0, 250.0);
		glVertex2f(375.0, 210.0);
		glVertex2f(450.0, 150.0);
		glEnd();

		glBegin(GL_TRIANGLES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(450.0, 150.0);
		glVertex2f(400.0, 75.0);
		glVertex2f(500.0, 75.0);
		glEnd();

		glBegin(GL_LINES);
		glColor3f(1.0,1.0,1.0);
		glVertex2f(415.0, 75.0);
		glVertex2f(435.0, 35.0);

		glVertex2f(435.0, 35.0);
		glVertex2f(425.0,25.0);
	
		glVertex2f(465.0,75.0);
		glVertex2f(490.0,35.0);

		glVertex2f(490.0,35.0);
		glVertex2f(475.0,25.0);
		
		glVertex2f(375.0,210.0);
		glVertex2f(350.0,155.0);

		glVertex2f(385.0,205.0);
		glVertex2f(375.0,150.0);
		glEnd();
	glPopMatrix();
	glutSwapBuffers();
}
		
void display(void)
{
	glClear(GL_COLOR_BUFFER_BIT);
	//glClearColor(1.0, 1.0, 1.0, 1.0);
	if(flag123==0)
	{
		screen();
	}
	else if(flag123==1)
	{
	glMatrixMode(GL_MODELVIEW);
	glPushMatrix();
	mountain();
	drawtree();
	drawhuman2();
        draw_circle(410.0,250.0,20.0);
	drawhuman1();
	draw_circle(200.0,255.0,20.0);
	drawsun(400.0,450.0,25.0);
	drawhouse1();
	drawhouse2();
	drawgrass();
	glPopMatrix();
	glColor3f(0.0,0.0,0.0);
	glutSwapBuffers();
	}
	//glFlush();
}


void update(int value)
{

	glClearColor(1.0, 0.90, 0.50, 0.40);
	glutPostRedisplay();
}
void update1(int value)
{
	glClearColor(1.0, 0.85, 0.45, 0.35);
	glutPostRedisplay();
}
void update2(int value)
{
	glClearColor(1.0, 0.80, 0.40, 0.30);
	glutPostRedisplay();
}
void update3(int value)
{
	glClearColor(1.0, 0.75, 0.35, 0.25);
	glutPostRedisplay();
}
void update4(int value)
{
	glClearColor(1.0, 0.70, 0.30, 0.20);
	glutPostRedisplay();
}
void update5(int value)
{
	glClearColor(1.0, 0.65, 0.25, 0.1);
	glutPostRedisplay();
}
void update6(int value)
{
	glClearColor(1.0, 0.60, 0.20, 0.05);
	glutPostRedisplay();
}
void update7(int value)
{
	glClearColor(1.0, 0.55, 0.15, 0.0);
	glutPostRedisplay();
}
void update8(int value)
{
	glClearColor(1.0, 0.50, 0.10, 0.0);
	glutPostRedisplay();
}
void update9(int value)
{
	glClearColor(1.0, 0.45, 0.05, 0.0);
	glutPostRedisplay();
	
}
void update10(int value)
{
	glClearColor(1.0, 0.40, 0.0, 0.0);
	glutPostRedisplay();
}
void update11(int value)
{
	glClearColor(0.95, 0.95, 0.95, 0.0);
	glutPostRedisplay();
}
void update12(int value)
{
	glClearColor(0.90, 0.90, 0.90, 0.0);
	glutPostRedisplay();
}
void update13(int value)
{
	glClearColor(0.85, 0.85, 0.85, 0.0);
	glutPostRedisplay();
}
void update14(int value)
{
	glClearColor(0.80, 0.80, 0.80, 1.0);

	glutPostRedisplay();
}
void update15(int value)
{
	glClearColor(0.75, 0.75, 0.75, 1.0);
	glutPostRedisplay();
}
void update16(int value)
{
	glClearColor(0.65, 0.65, 0.65, 0.0);

	glutPostRedisplay();
}
void update17(int value)
{
	glClearColor(0.60, 0.60, 0.60, 0.0);
	glutPostRedisplay();
}
void update18(int value)
{
	glClearColor(0.50, 0.50, 0.50, 0.0);
	glutPostRedisplay();
}
void update19(int value)
{
	glClearColor(0.40, 0.40, 0.40, 0.0);
	glutPostRedisplay();
}
void update20(int value)
{
	glClearColor(0.30, 0.30, 0.30, 0.0);
	glutPostRedisplay();
}
void myinit(void)
{
	glClearColor(1.0, 0.90, 0.50, 0.40);
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	gluOrtho2D(0.0,500.0,0.0,500.0);
}

void keypress(unsigned char key,int x,int y)
{
       
	switch (key){
		case 'b':
			glClearColor (0.60, 0.40, 0.20, 1.0);
			break;
 
		case 'g': 
			glClearColor (0.40, 0.65, 0.20, 1.0);
		break;
		case 'p' :flag123=0;
				flag123=1;
			break;
		default:
         break;
	}
   glutPostRedisplay();
}

void updatefinal(int values)
{
	glutTimerFunc(500, update,0);
	glutTimerFunc(800, update1, 0);
	glutTimerFunc(1100, update2, 0);
	glutTimerFunc(1400, update3, 0);
	glutTimerFunc(1700, update4, 0);
	glutTimerFunc(2000, update5, 0);
	glutTimerFunc(2300, update6, 0);
	glutTimerFunc(2600, update7, 0);
	glutTimerFunc(2900, update8, 0);
	glutTimerFunc(3200, update9, 0);
	glutTimerFunc(3400, update10, 0);
	glutTimerFunc(3800, update9,0);
	glutTimerFunc(4100, update7, 0);
	glutTimerFunc(4300, update5, 0);
	glutTimerFunc(4500, update3, 0);
	glutTimerFunc(4700, update1, 0);
	glutTimerFunc(5000, update11, 0);
	glutTimerFunc(5400, update12, 0);
	glutTimerFunc(5700, update13, 0);
	glutTimerFunc(5900, update14, 0);
	glutTimerFunc(6100, update15, 0);
	glutTimerFunc(6400, update16, 0);
	glutTimerFunc(6700, update17, 0);
	glutTimerFunc(7000, update18, 0);
	glutTimerFunc(7300, update19, 0);
	glutTimerFunc(7600, update20, 0);
	glutPostRedisplay();

}


void Hcolor(int option)
{
	switch(option)
	{
	case 3:if(drawhouse2)
		{
		flag4=1;
		}
		break;
	case 4:if(drawhouse2)
		{
		flag4=2;
		}
		break;
	case 5:if(drawhouse2)
		{
		flag4=3;
		}
		break;
	}
}

void Mcolor(int option)
{
	switch(option)
	{
	case 6:if(mountain)
		{
	    	flag5=1;
		}
		break;
	case 7:if(mountain)
		{
	    	flag5=2;
		}
		break;
	case 8:if(mountain)
		{
	    	flag5=3;
		}
		break;
	}
}

void Scolor(int option)
{
	switch(option)
	{
	case 9:if(draw_circle)
		{
		flag6=1;
		}
		break;
	case 10:if(draw_circle)
		{
		flag6=2;
		}
		break;
	}
}

void menu_selected(int values)
{
	switch(values)
	{
		case 1:	exit(0);
			break;
		
	}
}

int main(int argc, char** argv)
{

	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB|GLUT_DEPTH);
	glutInitWindowSize(500, 500);
	glutInitWindowPosition(0,0);myinit();
	glutCreateWindow("Warli Painting");
	glutDisplayFunc(display);
	glutKeyboardFunc(keypress);
	myinit();
	glutTimerFunc(20, updatefinal,0);
	
	
	Submenu1=glutCreateMenu(Hcolor);
	glutAddMenuEntry("red", 3);
	glutAddMenuEntry("green",4);
	glutAddMenuEntry("blue",5);

	
	Submenu2=glutCreateMenu(Mcolor);
	glutAddMenuEntry("green", 6);
	glutAddMenuEntry("brown",7);
	glutAddMenuEntry("blue",8);

	Submenu3=glutCreateMenu(Scolor);
	glutAddMenuEntry("red", 9);
	glutAddMenuEntry("yellow",10);
	
	glutCreateMenu(menu_selected);
	glutAddMenuEntry("Quit", 1);
	glutAddSubMenu("House",Submenu1);
	glutAddSubMenu("Mountain",Submenu2);
	glutAddSubMenu("Sun",Submenu3);
	glutAttachMenu(GLUT_RIGHT_BUTTON);
	
	glutMainLoop();
}

Screenshots of Warli painting of CGV mini-project

Initial Position of Warli painting of CGV mini-project

Initial Position of Warli painting of CGV mini-project

Initial Position with options of Warli painting of CGV mini-project

The Initial Position with options of Warli painting of CGV mini-project

Initial Position with options of Warli painting of CGV mini-project 2

Initial Position with options of Warli painting of CGV mini-project 2

READ  17CS32 Analog and Digital Electronics Module 4 and 5

The project report will be given on request. Download Source Code of Warli Painting Computer Graphics Project in OpenGL – 18CSL67. Subscribe to our YouTube channel for more videos and like the Facebook page for regular updates.

1 thought on “Warli Painting Computer Graphics Project in OpenGL Source Code – 18CSL67”

Leave a Comment

Your email address will not be published. Required fields are marked *

error: Content is protected !!