Sunteți pe pagina 1din 27

TERM PAPER

OF
SUBJECT: - COMPUTER GRAPHICS AND
VISUALIZATION (CAP616)

TOPIC:- Design icon set for a tab


Submitted
To
Lovely Professional University, Phagwara
For the partial fulfillment of the degree of MCA-4th SEM

Submitted To:
Babita Pandey
(Lecturer)

Submitted By:
Name: Ajay Kumar
Roll No: RD1206A19
Reg. No: 11203127
1

ACKNOWLEDGEMENT
It is not until you undertake the project like this one that you realize how
massive the effort it really is, or how much you must rely upon the
Selfless efforts and goodwill of others. There are many who helped us
with this project, and we want to thank them all from the core of our
Hearts.
We owe special words of thanks to our Teacher
Babita Pandey for their
vision, thoughtful counselling and encouragement at every step of the
project. We are also thankful to the teachers of the Department for giving
us the best of knowledge and guidance throughout the project.
And last but not the least, we find no words to acknowledge the Analog clock
application & moral support rendered by our parents in making the effort
a success. All this has become reality because of their blessings and above
all by the grace of god.

Ajay Kumar

INTRODUCTION
Computer graphics are graphics created using computers and the
representation of image data by a computer specifically with help from
specialized graphic hardware and software.
The interaction and understanding of computers and interpretation of data has
been made easier because of computer graphics. Computer graphic
development has had a significant impact on many types of media and has
revolutionized animation, movies and the video game industry.
OpenGL (Open Graphics Library)[2] is a cross-language, multi-platform
application programming interface (API) for rendering 2D and 3D vector
graphics. The API is typically used to interact with a Graphics processing unit
(GPU), to achieve hardware-accelerated rendering.
A computer icon is a pictogram displayed on a computer screen in order to
help user navigate a computer system or mobile device in a similar way traffic
signs are used to help a driver navigate traffic; one of the most notable icon
designers, Susan kare was quoted saying "good icons should be more like road
signs than illustrations, easily comprehensible, and not cluttered with
extraneous detail"

Coding part
#include<Gl/gl.h>
#include<GL/glu.h>
#include<GL/glut.h>
void display()
{
//Z tv

glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
glColor3f(1.0,1.0,1.0);
glVertex2f(0.1,0.1);
glVertex2f(0.1,0.5);
glVertex2f(0.6,0.5);
glVertex2f(0.6,0.1);
glEnd();
//
glBegin(GL_POLYGON);
glColor3f(0.0,1.0,0.0);
glVertex2f(-0.1,0.1);
glVertex2f(-0.1,0.5);
glVertex2f(-0.6,0.5);
glVertex2f(-0.6,0.1);
glEnd();
//A
//glLineWidth(2.0);
glBegin(GL_LINES);
glColor3f(1.0,1.0,0.0);
glVertex2f(-0.5,0.2);
glVertex2f(-0.4,0.4);
glVertex2f(-0.4,0.4);
glVertex2f(-0.3,0.2);
glVertex2f(-0.49,0.25);
glVertex2f(-0.3,0.25);
glEnd();
//UTV
glBegin(GL_POLYGON);

glColor3f(1.0,1.0,1.0);
glVertex2f(-0.1,-0.1);
glVertex2f(-0.1,-0.5);
glVertex2f(-0.6,-0.5);
glVertex2f(-0.6,-0.1);
glEnd();
//STAR PLUS
glBegin(GL_POLYGON);
glColor3f(0.0,0.0,1.0);
glVertex2f(0.1,-0.1);
glVertex2f(0.1,-0.5);
glVertex2f(0.6,-0.5);
glVertex2f(0.6,-0.1);
glEnd();
//Z
glBegin(GL_POLYGON);
glColor3f(0.0,1.0,1.0);
glVertex2f(0.2,0.45);
glVertex2f(0.4,0.45);
glVertex2f(0.2,0.4);
glVertex2f(0.3,0.4);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0,1.0,1.0);
glVertex2f(0.2,0.3);
glVertex2f(0.2,0.25);
glVertex2f(0.4,0.25);
glVertex2f(0.4,0.3);
glVertex2f(0.3,0.3);

glVertex2f(0.4,0.45);
glVertex2f(0.4,0.4);
glVertex2f(0.4,0.45);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0,1.0,1.0);
glVertex2f(0.2,0.45);
glVertex2f(0.4,0.45);
glVertex2f(0.2,0.4);
glVertex2f(0.4,0.4);
glVertex2f(0.4,0.45);
glVertex2f(0.38,0.4);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0,1.0,1.0);
glVertex2f(0.4,0.45);
glVertex2f(0.3,0.3);
glVertex2f(0.2,0.3);
glVertex2f(0.3,0.4);
glVertex2f(0.4,0.4);
glEnd();
// ZeeTv
//Z
glBegin(GL_LINES);
glColor3f(0.0,0.0,1.0);
glVertex2f(0.2,0.2);
glVertex2f(0.25,0.2);
glVertex2f(0.25,0.2);
glVertex2f(0.2,0.15);

glVertex2f(0.2,0.15);
glVertex2f(0.25,0.15);
glEnd();
//E
glBegin(GL_LINES);
glColor3f(0.0,0.0,1.0);
glVertex2f(0.26,0.2);
glVertex2f(0.26,0.15);
glVertex2f(0.26,0.15);
glVertex2f(0.3,0.15);
glVertex2f(0.26,0.2);
glVertex2f(0.3,0.2);
glVertex2f(0.26,0.17);
glVertex2f(0.3,0.17);
glEnd();
//E
glBegin(GL_LINES);
glColor3f(0.0,0.0,1.0);
glVertex2f(0.31,0.2);
glVertex2f(0.31,0.15);
glVertex2f(0.31,0.15);
glVertex2f(0.34,0.15);
glVertex2f(0.31,0.2);
glVertex2f(0.34,0.2);
glVertex2f(0.31,0.17);
glVertex2f(0.34,0.17);
glEnd();
//T
glBegin(GL_LINES);

glColor3f(0.0,0.0,1.0);
glVertex2f(0.36,0.2);
glVertex2f(0.44,0.2);
glVertex2f(0.4,0.2);
glVertex2f(0.4,0.15);
glEnd();
//V
glBegin(GL_LINES);
glColor3f(0.0,0.0,1.0);
glVertex2f(0.45,0.2);
glVertex2f(0.47,0.15);
glVertex2f(0.47,0.15);
glVertex2f(0.5,0.2);
glEnd();
//Star plus
//STAR
glBegin(GL_POLYGON);
glColor3f(1.0,0.0,0.0);
glVertex2f(0.2,-0.25);
glVertex2f(0.22,-0.22);
glVertex2f(0.23,-0.26);
glVertex2f(0.28,-0.27);
glVertex2f(0.24,-0.3);
glVertex2f(0.24,-0.35);
glVertex2f(0.2,-0.31);
glVertex2f(0.15,-0.34);
glVertex2f(0.18,-0.28);
glVertex2f(0.15,-0.25);
glEnd();

glBegin(GL_POLYGON);
glColor3f(1.0,0.0,0.0);
glVertex2f(0.22,-0.22);
glVertex2f(0.15,-0.34);
glVertex2f(0.18,-0.32);
glEnd();
//S
glBegin(GL_LINES);
glColor3f(1.0,1.0,1.0);
glVertex2f(0.19,-0.4);
glVertex2f(0.16,-0.4);
glVertex2f(0.16,-0.4);
glVertex2f(0.16,-0.42);
glVertex2f(0.16,-0.42);
glVertex2f(0.18,-0.43);
glVertex2f(0.18,-0.43);
glVertex2f(0.18,-0.45);
glVertex2f(0.18,-0.45);
glVertex2f(0.15,-0.45);
glEnd();
//T
glBegin(GL_LINES);
glColor3f(1.0,1.0,1.0);
glVertex2f(0.2,-0.4);
glVertex2f(0.25,-0.4);
glVertex2f(0.23,-0.4);
glVertex2f(0.23,-0.45);
glEnd();
//A

glBegin(GL_LINES);
glColor3f(1.0,1.0,1.0);
glVertex2f(0.28,-0.4);
glVertex2f(0.25,-0.45);
glVertex2f(0.28,-0.4);
glVertex2f(0.3,-0.45);
glVertex2f(0.26,-0.43);
glVertex2f(0.29,-0.43);
glEnd();
//R
glBegin(GL_LINES);
glColor3f(1.0,1.0,1.0);
glVertex2f(0.31,-0.4);
glVertex2f(0.31,-0.45);
glVertex2f(0.31,-0.4);
glVertex2f(0.34,-0.4);
glVertex2f(0.34,-0.4);
glVertex2f(0.33,-0.43);
glVertex2f(0.33,-0.43);
glVertex2f(0.31,-0.43);
glVertex2f(0.33,-0.43);
glVertex2f(0.34,-0.45);
glEnd();
//P
glBegin(GL_LINES);
glColor3f(1.0,1.0,1.0);
glVertex2f(0.4,-0.4);
glVertex2f(0.4,-0.45);
glVertex2f(0.4,-0.4);

10

glVertex2f(0.42,-0.4);
glVertex2f(0.42,-0.4);
glVertex2f(0.42,-0.42);
glVertex2f(0.42,-0.42);
glVertex2f(0.4,-0.42);
glEnd();
//L
glBegin(GL_LINES);
glColor3f(1.0,1.0,1.0);
glVertex2f(0.45,-0.4);
glVertex2f(0.45,-0.45);
glVertex2f(0.45,-0.45);
glVertex2f(0.48,-0.45);
glEnd();
//U
glBegin(GL_LINES);
glColor3f(1.0,1.0,1.0);
glVertex2f(0.49,-0.4);
glVertex2f(0.49,-0.45);
glVertex2f(0.49,-0.45);
glVertex2f(0.52,-0.45);
glVertex2f(0.52,-0.45);
glVertex2f(0.52,-0.4);
glEnd();
//S
glBegin(GL_LINES);
glColor3f(1.0,1.0,1.0);
glVertex2f(0.56,-0.4);
glVertex2f(0.54,-0.4);

11

glVertex2f(0.54,-0.4);
glVertex2f(0.54,-0.42);
glVertex2f(0.54,-0.42);
glVertex2f(0.56,-0.43);
glVertex2f(0.56,-0.43);
glVertex2f(0.56,-0.45);
glVertex2f(0.56,-0.45);
glVertex2f(0.53,-0.45);
glEnd();
//UTV
//U
glBegin(GL_POLYGON);
glColor3f(0.0,0.0,0.0);
glVertex2f(-0.55,-0.25);
glVertex2f(-0.51,-0.25);
glVertex2f(-0.51,-0.35);
glVertex2f(-0.55,-0.4);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0,0.0,0.0);
glVertex2f(-0.45,-0.25);
glVertex2f(-0.42,-0.25);
glVertex2f(-0.42,-0.4);
glVertex2f(-0.45,-0.35);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0,0.0,0.0);
glVertex2f(-0.51,-0.35);
glVertex2f(-0.45,-0.35);

12

glVertex2f(-0.55,-0.4);
glVertex2f(-0.42,-0.4);
glVertex2f(-0.45,-0.35);
glVertex2f(-0.42,-0.35);
glEnd();
//T
glBegin(GL_POLYGON);
glColor3f(0.0,0.0,0.0);
glVertex2f(-0.38,-0.3);
glVertex2f(-0.34,-0.3);
glVertex2f(-0.34,-0.4);
glVertex2f(-0.38,-0.4);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0,0.0,0.0);
glVertex2f(-0.42,-0.25);
glVertex2f(-0.3,-0.25);
glVertex2f(-0.42,-0.29);
glVertex2f(-0.3,-0.29);
glVertex2f(-0.3,-0.25);
glVertex2f(-0.3,-0.29);
glEnd();
//V
glBegin(GL_POLYGON);
glColor3f(0.0,0.0,0.0);
glVertex2f(-0.3,-0.25);
glVertex2f(-0.3,-0.28);
glVertex2f(-0.25,-0.4);
glEnd();

13

glBegin(GL_POLYGON);
glColor3f(0.0,0.0,0.0);
glVertex2f(-0.25,-0.35);
glVertex2f(-0.17,-0.25);
glVertex2f(-0.14,-0.25);
glVertex2f(-0.25,-0.4);
glVertex2f(-0.3,-0.25);
glVertex2f(-0.25,-0.35);
glVertex2f(-0.25,-0.4);
glEnd();
glFlush();
}
void disp1()
{
//STAR
glBegin(GL_POLYGON);
glColor3f(0.0,1.0,0.0);
glVertex2f(0.3,-0.15);
glVertex2f(0.32,-0.12);
glVertex2f(0.33,-0.16);
glVertex2f(0.38,-0.17);
glVertex2f(0.34,-0.2);
glVertex2f(0.34,-0.25);
glVertex2f(0.3,-0.21);
glVertex2f(0.25,-0.24);
glVertex2f(0.28,-0.18);
glVertex2f(0.25,-0.15);
glEnd();
//S

14

glLineWidth(5.0);
glBegin(GL_LINES);
glColor3f(1.0,1.0,1.0);
glVertex2f(0.19,-0.4);
glVertex2f(0.16,-0.4);
glVertex2f(0.16,-0.4);
glVertex2f(0.16,-0.42);
glVertex2f(0.16,-0.42);
glVertex2f(0.18,-0.43);
glVertex2f(0.18,-0.43);
glVertex2f(0.18,-0.45);
glVertex2f(0.18,-0.45);
glVertex2f(0.15,-0.45);
glEnd();
//T
glBegin(GL_LINES);
glColor3f(1.0,1.0,1.0);
glVertex2f(0.2,-0.4);
glVertex2f(0.25,-0.4);
glVertex2f(0.23,-0.4);
glVertex2f(0.23,-0.45);
glEnd();
//A
glBegin(GL_LINES);
glColor3f(1.0,1.0,1.0);
glVertex2f(0.28,-0.4);
glVertex2f(0.25,-0.45);
glVertex2f(0.28,-0.4);
glVertex2f(0.3,-0.45);

15

glVertex2f(0.26,-0.43);
glVertex2f(0.29,-0.43);
glEnd();
//R
glBegin(GL_LINES);
glColor3f(1.0,1.0,1.0);
glVertex2f(0.31,-0.4);
glVertex2f(0.31,-0.45);
glVertex2f(0.31,-0.4);
glVertex2f(0.34,-0.4);
glVertex2f(0.34,-0.4);
glVertex2f(0.33,-0.43);
glVertex2f(0.33,-0.43);
glVertex2f(0.31,-0.43);
glVertex2f(0.33,-0.43);
glVertex2f(0.34,-0.45);
glEnd();
//P
glBegin(GL_LINES);
glColor3f(1.0,1.0,1.0);
glVertex2f(0.4,-0.4);
glVertex2f(0.4,-0.45);
glVertex2f(0.4,-0.4);
glVertex2f(0.42,-0.4);
glVertex2f(0.42,-0.4);
glVertex2f(0.42,-0.42);
glVertex2f(0.42,-0.42);
glVertex2f(0.4,-0.42);
glEnd();

16

//L
glBegin(GL_LINES);
glColor3f(1.0,1.0,1.0);
glVertex2f(0.45,-0.4);
glVertex2f(0.45,-0.45);
glVertex2f(0.45,-0.45);
glVertex2f(0.48,-0.45);
glEnd();
//U
glBegin(GL_LINES);
glColor3f(1.0,1.0,1.0);
glVertex2f(0.49,-0.4);
glVertex2f(0.49,-0.45);
glVertex2f(0.49,-0.45);
glVertex2f(0.52,-0.45);
glVertex2f(0.52,-0.45);
glVertex2f(0.52,-0.4);
glEnd();
//S
glBegin(GL_LINES);
glColor3f(1.0,1.0,1.0);
glVertex2f(0.56,-0.4);
glVertex2f(0.54,-0.4);
glVertex2f(0.54,-0.4);
glVertex2f(0.54,-0.42);
glVertex2f(0.54,-0.42);
glVertex2f(0.56,-0.43);
glVertex2f(0.56,-0.43);
glVertex2f(0.56,-0.45);

17

glVertex2f(0.56,-0.45);
glVertex2f(0.53,-0.45);
glEnd();

glFlush();
}

void disp2()
{

//UTV
//U
glBegin(GL_POLYGON);
glColor3f(1.0,0.0,1.0);
glVertex2f(-0.55,-0.35);
glVertex2f(-0.51,-0.35);
glVertex2f(-0.51,-0.45);
glVertex2f(-0.55,-0.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0,0.0,1.0);
glVertex2f(-0.45,-0.35);
glVertex2f(-0.42,-0.35);
glVertex2f(-0.42,-0.5);
glVertex2f(-0.45,-0.45);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0,0.0,1.0);
glVertex2f(-0.51,-0.45);

18

glVertex2f(-0.45,-0.45);
glVertex2f(-0.55,-0.5);
glVertex2f(-0.42,-0.5);
glVertex2f(-0.45,-0.45);
glVertex2f(-0.42,-0.45);
glEnd();
//T
glBegin(GL_POLYGON);
glColor3f(1.0,0.0,1.0);
glVertex2f(-0.38,-0.4);
glVertex2f(-0.34,-0.4);
glVertex2f(-0.34,-0.5);
glVertex2f(-0.38,-0.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0,0.0,1.0);
glVertex2f(-0.42,-0.35);
glVertex2f(-0.3,-0.35);
glVertex2f(-0.42,-0.39);
glVertex2f(-0.3,-0.39);
glVertex2f(-0.3,-0.35);
glVertex2f(-0.3,-0.39);
glEnd();
//V
glBegin(GL_POLYGON);
glColor3f(1.0,0.0,1.0);
glVertex2f(-0.3,-0.35);
glVertex2f(-0.3,-0.38);
glVertex2f(-0.25,-0.5);

19

glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0,0.0,1.0);
glVertex2f(-0.25,-0.45);
glVertex2f(-0.17,-0.35);
glVertex2f(-0.14,-0.35);
glVertex2f(-0.25,-0.5);
glVertex2f(-0.3,-0.35);
glVertex2f(-0.25,-0.45);
glVertex2f(-0.25,-0.5);
glEnd();
glFlush();
}
voiddisp()
{
//Z
/*glBegin(GL_POLYGON);
glColor3f(0.0,0.0,1.0);
glVertex2f(0.25,0.50);
glVertex2f(0.45,0.50);
glVertex2f(0.25,0.45);
glVertex2f(0.35,0.45);
glEnd();*/
glBegin(GL_POLYGON);
glColor3f(0.0,0.0,1.0);
glVertex2f(0.30,0.30);
glVertex2f(0.30,0.25);
glVertex2f(0.50,0.25);
glVertex2f(0.50,0.30);

20

glVertex2f(0.40,0.30);
glVertex2f(0.50,0.45);
glVertex2f(0.50,0.40);
glVertex2f(0.50,0.45);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0,0.0,1.0);
glVertex2f(0.3,0.45);
glVertex2f(0.5,0.45);
glVertex2f(0.3,0.4);
glVertex2f(0.5,0.4);
glVertex2f(0.5,0.45);
glVertex2f(0.43,0.4);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0,0.0,1.0);
glVertex2f(0.5,0.45);
glVertex2f(0.4,0.3);
glVertex2f(0.3,0.3);
glVertex2f(0.4,0.4);
glVertex2f(0.5,0.4);
glEnd();
// ZeeTv
//Z
glLineWidth(5.0);
glBegin(GL_LINES);
glColor3f(1.0,0.0,1.0);
glVertex2f(0.2,0.2);
glVertex2f(0.25,0.2);

21

glVertex2f(0.25,0.2);
glVertex2f(0.2,0.15);
glVertex2f(0.2,0.15);
glVertex2f(0.25,0.15);
glEnd();
//E
glBegin(GL_LINES);
glColor3f(1.0,0.0,1.0);
glVertex2f(0.26,0.2);
glVertex2f(0.26,0.15);
glVertex2f(0.26,0.15);
glVertex2f(0.3,0.15);
glVertex2f(0.26,0.2);
glVertex2f(0.3,0.2);
glVertex2f(0.26,0.17);
glVertex2f(0.3,0.17);
glEnd();
//E
glBegin(GL_LINES);
glColor3f(1.0,0.0,1.0);
glVertex2f(0.31,0.2);
glVertex2f(0.31,0.15);
glVertex2f(0.31,0.15);
glVertex2f(0.34,0.15);
glVertex2f(0.31,0.2);
glVertex2f(0.34,0.2);
glVertex2f(0.31,0.17);
glVertex2f(0.34,0.17);
glEnd();

22

//T
glBegin(GL_LINES);
glColor3f(1.0,0.0,1.0);
glVertex2f(0.36,0.2);
glVertex2f(0.44,0.2);
glVertex2f(0.4,0.2);
glVertex2f(0.4,0.15);
glEnd();
//V
glBegin(GL_LINES);
glColor3f(1.0,0.0,1.0);
glVertex2f(0.45,0.2);
glVertex2f(0.47,0.15);
glVertex2f(0.47,0.15);
glVertex2f(0.5,0.2);
glEnd();
glFlush();
}
void disp3()
{
//A
glLineWidth(7.0);
glBegin(GL_LINES);
glColor3f(0.0,1.0,1.0);
glVertex2f(-0.5,0.2);
glVertex2f(-0.4,0.4);
glVertex2f(-0.4,0.4);
glVertex2f(-0.3,0.2);
glVertex2f(-0.49,0.25);

23

glVertex2f(-0.3,0.25);
glEnd();
glFlush();
}
voidprocessPassiveMotionMouse(intx,int y)
{ if(x>600 && y<300)
{ glutDisplayFunc(display);
glutDisplayFunc(disp);
} else if(x>700 && y>400)
{ glutDisplayFunc(display);
glutDisplayFunc(disp1);
} else if(x>400 && y<500)
{ glutDisplayFunc(display);
glutDisplayFunc(disp3);
} else if(x<500 && y>500)
{ glutDisplayFunc(display);
glutDisplayFunc(disp2);
}
else
{ glLineWidth(1.0);
glutDisplayFunc(display);
} glutPostRedisplay();
}
void processPassiveMotionMouse1(intx,int y)
{ if(x>600 && y>300)
{
//glColor3f(1.0,0.0,0.0);
glutDisplayFunc(display);
//glColor3f(1.0,0.0,0.0);

24

glutDisplayFunc(disp1);
} else

glLineWidth(1.0);
glutDisplayFunc(display);
} glutPostRedisplay();
}
voidTimerFunc()
{ float f=0.0;
f+=1;
if(f==9.0)
f-=8;
glutPostRedisplay();
} int main(intargc,char **argv)
{ glutInit(&argc,argv);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutInitWindowSize(1000,1000);
glutInitWindowPosition(150,150);
glutCreateWindow("displaying");
glutIdleFunc(TimerFunc);
glutDisplayFunc(display);
//glutMotionFunc(processActiveMotionMouse);
glutPassiveMotionFunc(processPassiveMotionMouse);
//glutPassiveMotionFunc(processPassiveMotionMouse1);
glutMainLoop();
return 0; }

25

screen short-

26

27

S-ar putea să vă placă și