You are on page 1of 32

VISVESVARAYA TECHNOLOGY UNIVERSITY

JNANA SANGAMA, BELAGAVI-590018, KARNATAKA

Mini Project Report


on

“CLIENT AND SERVER ARCHITECTURE”


Submitted in partial fulfilment of the requirements for the Degree of

BACHELOR OF ENGINEERING
In
COMPUTER SCIENCE AND ENGINEERING

Submitted By
MAMATHA G [1JV20CS006]
MEGANA [1JV20CS007]
POORNIMA S [1JV21CS400]

Under the Guidance of


Asst. Prof. UMADEVI B E
Assistant Professor
Dept. of Computer Science and Engineering
JVIT, Bidadi – 562109

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


JNANA VIKAS INSTITUTE OF TECHNOLOGY
Vidya Soudha, Padmashree G.D. Goyalgi Campus, Bangalore-Mysore Highway

BIDADI, BANGALORE – 562109


JNANA VIKAS INSTITUTE OF TECHNOLOGY
BIDADI- 562109
(Affiliated to Visvesvaraya Technological University, Belagavi, Approved by AICTE, New Delhi)

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

CERTIFICATE
Certified that the Mini Project work entitled “CLIENT AND SERVER
ARCHITECTURE” carried out by MAMATHA G [1JV20CS006], MEGANA
[1JV20CS007], POORNIMA S [1JV21CS400] are bonafide students of Jnana Vikas
Institute of Technology in partial fulfillment for the award of the degree of Bachelor of
Engineering in Computer Science and Engineering of the Visvesvaraya Technological
University, Belagavi during the year 2022-23. It is certified that all corrections/suggestions
indicated for Internal Assessment have been incorporated in the report deposited in the
department library. The project report has been approved as it satisfies the academic
requirement in respect of project work prescribed for the said degree.

Prof. UMADEVI B E Prof. NIVEDITHA S Dr. AV SEETHA GIRISHA


Assistant Professor Head of the Department
Principal
Department of CSE Department of CSE
JVIT, Bidadi
JVIT, Bidadi JVIT, Bidadi

Name of the Examiners Signature with Date

1. ________________ _________________

2. ________________ _________________
JNANAVIKAS INSTITUTE OF TECHNOLOGY
BIDADI-562109
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

DECLARATION
We, MAMATHA G [1JV20CS006], MEGANA [1JV20CS007], POORNIMA S
[1JV21CS400] students of 6th semester B.E in Computer Science And Engineering,
Jnana Vikas Institute of Technology, Bidadi, hereby declare that the Mini Project work
entitled “CLIENT AND SERVER ARCHITECTURE” has been carried out by us and
submitted in partial fulfillment of the course requirements for the award of degree of Bachelor
of Engineering, from Visvesvaraya Technological University during 2022- 2023 is a record
of an original work done by us under the guidance of Prof. UMADEVI B E, Assistant Professor
in Department of Computer Science and Engineering, JVIT, Bidadi. The results
embodied in this work has not submitted to any other University or Institute for the award of
any degree.

MAMATHA G
USN: 1JV20CS006
Department of Computer Science and Engineering,
Jnana Vikas Institute of Technology
Bengaluru-562109 Signature of the Student

MEGANA
USN: 1JV20CS007
Department of Computer Science and Engineering,
Jnana Vikas Institute of Technology
Bengaluru-562109 Signature of the Student

POORNIMA S
USN: 1JV21CS400
Department of Computer Science and Engineering,
Jnana Vikas Institute of Technology
Bengaluru-562109 Signature of the Student
ACKNOWLEDGEMENT

A Project work is a job of great enormity and it cannot accomplish by an individual all by
them. Eventually I am grateful to a number of individuals whose professional guidance,
assistance and encouragement have made it a pleasant endeavor to undertake this seminar
work.

I have great pleasure in expressing my deep sense of gratitude to founder Sir C.M
Lingappa, Chairman for having provided us with a great infrastructure and well- furnished
labs.

I take this opportunity to express my profound gratitude to Dr. A V SEETHA


GIRISHA, Principal for his constant support and encouragement.

I would like to express my heart full thanks to Prof. NIVEDITHA S, Head of the
Department, Computer Science and Engineering who has guided me in all aspects.

I would like to extend my thanks to my guide Asst. Prof. UMADEVI B E, who has
guided me in all aspects. I am grateful for her unfailing encouragement and suggestion,
given to me in course of my project works.

I would like to mention special thanks to all my Teaching Faculties of Department of


Computer Science and Engineering, JVIT, Bidadi for their valuable support and
guidance.

I would like to thank to my Family and Friends for their unforgettable support and
encouragement.

MAMATHA G [1JV20CS006]
MEGANA [1JV20CS007]
POORNIMA S [1JV21CS400]
i
ABSTRACT
Client-server architecture is an architecture of a computer network in which many
clients (remote processors) request and receive service from a centralized server (host
computer). Client computers provide an interface to allow a computer user to request services
of the server and to display the results the server returns. Servers wait for requests to arrive
from clients and then respond to them. Ideally, a server provides a standardized transparent
interface to clients so that clients need not be aware of the specifics of the system (i.e., the
hardware and software) that is providing the service. Clients are often situated at workstations
or on personal computers, while servers are located elsewhere on the network, usually on
more powerful machines. This computing model is especially effective when clients and the
server each have distinct tasks that they routinely perform. In hospital data processing, for
example, a client computer can be running an application program for entering patient
information while the server computer is running another program that manages the database
in which the information is permanently stored. Many clients can access the server’s
information simultaneously, and, at the same time, a client computer can perform other tasks,
such as sending e-mail. Because both client and server computers are considered intelligent
devices, the client-server model is completely different from the old “mainframe” model, in
which a centralized mainframe computer performed all the tasks for its associated “dumb”
terminals

Computer graphics started with the display of data on hardcopy plotters and Cathode
Ray Tube (CRT) screens soon after the Introduction of computers themselves. It has grown to
include the Creation, Storage and Manipulation of Models and Images of objects. These
models come from a diverse and expanding set of fields, and include physical, mathematical,
engineering, architectural and even conceptual structures, natural phenomenon and so on.
Computer graphics today is largely interactive: the user controls the contents, structure, and
appearance of objects and of their displayed images by using input devices, such as a
keyboard, mouse, or touch-sensitive panel on the screen. Because of the close relationship
between the input devices and the display, the handling of such devices is included in the
study of computer graphics.
ii
TABLE OF CONTENTS

DETAILS Page No.


ACKNOWLEDGEMENT i
ABSTRACT ii
TABLE OF CONTENTS iii
LIST OF FIGURES iv

Chapter 1 INTRODUCTION 1
1.1 Introduction to Computer Graphics 1
1.2 Uses of Computer Graphics 2
1.3 Advantages 2
1.4 Header Files 2

Chapter 2 LITERATURE SURVEY 4


2.1 Animation 7

Chapter 3 SYSTEM REQIUREMENT 8


3.1 Hardware Requirements 8
3.2 Software Requirements 8

Chapter 4 METHODOLOGY 9
4.1 Introduction 9
4.2 Design Preparations 9
4.3 Determine Development Tools 9

Chapter 5 IMPLEMENTATION 10
5.1 Functions 10
5.2 Design 11
5.3 Proposed System 11

Chapter 6 SOURCE CODE 12

Chapter 7 RESULT AND TESTING 19


7.1 Overview of 2D client and server Architecture 19

Chapter 8 CONCLUSION AND FUTURE SCOPE 22


8.1 Conclusion 22
8.2 Future Enhancements 22

REFERENCES 23

iii
LIST OF FIGURES

Figure No. Name of the Figure Page No.

5.2.1 Under implementation chapter explains the Data Flow


Diagram 11
7.1.1 Overview 19
7.1.2 Options for number of clients and servers 19
7.1.3 Handshaking Process 20
7.1.4 Data Uploading 20
7.1.5 Data Downloading 21
7.1.6 Data uploaded and downloaded in all the clients and server 21

iv
CLIENT AND SERVER ARCHITECTURE 2022-23

CHAPTER 1
INTRODUCTION
1.1 INTRODUCTION TO COMPUTER GRAPHICS
Computer graphics started with the display of data on hardcopy plotters and Cathode
Ray Tube (CRT) screens soon after the Introduction of computers themselves. It has grown to
include the Creation, Storage and Manipulation of Models and Images of objects. These
models come from a diverse and expanding set of fields, and include physical, mathematical,
engineering, architectural and even conceptual structures, natural phenomenon and so on.
Computer graphics today is largely interactive: the user controls the contents, structure, and
appearance of objects and of their displayed images by using input devices, such as a
keyboard, mouse, or touch-sensitive panel on the screen. Because of the close relationship
between the input devices and the display, the handling of such devices is included in the
study of computer graphics.

1.2 USES OF COMPUTER GRAPHICS


Computer graphics is used in many different areas of industry, business, government,
education, entertainment etc.

 User Interfaces: Word-processing, spreadsheet and desktop-publishing programs are typical


applications of such user-interface techniques.

 Interactive Plotting in Business, Science and Technology: The common use of


graphics is to create 2D and 3D graphs of mathematical, physical and economic
functions, histograms, and bar and pie charts.

 Computer Aided Drafting and Design (CAD): In CAD, interactive graphics is used
to design components and systems of mechanical, electrical and electronic devices
including structures such as buildings, automobile bodies, aero planes, ship hulls etc.

 Simulation and Animation for Scientific Visualization and Entertainment:


Computer-produced animated movies are becoming increasing popular for scientific
and engineering visualization. Cartoon characters will increasingly be modeled in the
computer as 3D shape descriptions whose movements are controlled by computer
commands.

Dept. of CSE, JVIT Page 1


CLIENT AND SERVER ARCHITECTURE 2022-23

 2D Graphics: These editors are used to draw 2D pictures (line, rectangle, circle and
ellipse) alter those with operations like cut, copy and paste. These may also support
features like translation, rotation etc.

 3D Graphics: These editors are used to draw 3D pictures (line, rectangle, circle and
ellipse). These may also support features like translation, rotation etc.

ABOUT THE PROJECT:


This project implements the movement of light source on the surfaces of the different objects.

1.3 ADVANTAGES

 Scientific visualization

 Information visualization

 Computer vision

 Image processing

 Computational geometry

 Computational topology

 Applied mathematics

1.4 HEADER FILES


Most of our applications will be designed to access OpenGL directly through functions
in three libraries. Functions in the main GL library have names that begin with the letters gl
and are stored in a library usually referred as GL. The second is the OpenGL Utility Library
(GLU). This library uses only GL functions but contains code for creating common objects
and simplifying viewing.

To interface with the window system and to get input from external devices into our
programs, we need at least one library. For the X window system, this library is called GLX,
for windows, it is wall etc.

GLUT will use GLX and X libraries.

#include<GL/glut.h> or #include<GLUT/glut.h>

Dept. of CSE, JVIT Page 2


CLIENT AND SERVER ARCHITECTURE 2022-23

GLUT is the OpenGL Utility Toolkit, a window system independent toolkit for writing
OpenGL programs. It implements a simple windowing application programming interface
(API) for OpenGL. GLUT makes it considerably easier to learn about and explore OpenGL
programming. GLUT provides a portable API so you can write a single OpenGL program
that works across all PC and workstation OS platforms.

GLUT is designed for constructing small to medium sized OpenGL programs. While
GLUT is well-suited to learning OpenGL and developing simple OpenGL applications,
GLUT is not a full-featured toolkit so large applications requiring sophisticated user
interfaces are better off using native window system toolkits. GLUT is simple, easy, and
small.

The GLUT library has C, C++ (same as C), FORTRAN, and ADA programming
bindings. The GLUT source code distribution is portable to nearly all OpenGL
implementations and platforms. The current version is 3.7.

Additional releases of the library are not anticipated. GLUT is not open source.

Dept. of CSE, JVIT Page 3


CLIENT AND SERVER ARCHITECTURE 2022-23

CHAPTER 2
LITERATURE SURVEY
1. Structuring of 2D MODELS for Educational Purposes: A. Mcgettrick, R. Boyle, R.
Ibbett, J. Lloyd, G. Lovegrove:
Nowadays 2D animation shares many of these same principles and methods. However,
instead of using physical celluloids or a multiplane camera, they are often simulated with
the help of computers. Often modern 2D animations are 9 still drawn by hand but digital
softwares speed up the process (Higginbotham n.d.). Computers can calculate and
simulate in-between frames of movement with ease, reducing the production time and
cost remarkably. 2D characters can also be rigged for a quicker and cheaper way to
produce 2D character animations. Moreover, hand-drawn animations can also use
computer technology to enhance the visuality of the animation. Klaus by Spanish SPA
Studios is an example of modern hand-drawn animation that uses digital technology for
volumetric lighting and texturing (Sarto 2019). Volumetric lighting is a technique often
used in 3D graphics to scatter light in a way that it appears almost as if it has volume.
These gave the movie an innovative look, appearing almost 3D-like while maintaining a
hand-crafted feeling. These animation can be used for learning and understanding
purposes as we are using 2D animations to learn client and server relationship or client
and server architecture as animations are known as good source of learning.

2. Computer graphics with OpenGL, James D Foley, Andries Van Dam, Steven K
Feiner, John F Huges:
You can control modes independently of each other; that is, setting one mode doesn't
affect whether other modes are set. Primitives are specified, modes are set, and other
OpenGL operations are described by issuing commands in the form of function calls.
Primitives are defined by a group of one or more vertices. A vertex defines a point, an
endpoint of a line, or a corner of a polygon where two edges meet. Data is associated
with a vertex, and each vertex and its associated data are processed independently, in
order, and in the same way. The type of clipping depends on which primitive the group
of vertices represents. Commands are always processed in the order in which they are
received, although there may be an indeterminate delay before a command takes effect.
This means that each primitive is drawn completely before any subsequent command
takes effect. It also means that state-querying commands return data that's consistent with
complete execution of all previously issued OpenGL commands. Rasterization produces
Dept. of CSE, JVIT Page 4
CLIENT AND SERVER ARCHITECTURE 2022-23

a series of frame buffer addresses and associated values using a two-dimensional


description of a point, line segment, or polygon. Each fragment so produced is fed into
the last stage, per-fragment operations, which performs the final operations on the data
before it's stored as pixels in the frame buffer. These operations include conditional
updates to the frame buffer based on incoming and previously stored z-value s (for z-
buffering) and blending of incoming pixel colors with stored colors, as well as masking
and other logical operations on pixel values.All elements of OpenGL state, including the
contents of the texture memory and even of the frame buffer, can be obtained by an
OpenGL application.

3. Interactive Computer Graphics, concepts and applications, Cengage Learning,


Kelvin Sung, Peter Shirley, Steven Baer.
OpenGL is an interface to graphics hardware. The GL stands for Graphics Library. It
provides commands for specifying geometric objects in two or three dimensions, and for
controlling how these objects are drawn on the display. Objects, in this case, are points,
lines, polygons, images, and bitmaps. Mesa is a free implementation of the OpenGL
specification. Mesa is the implementation of OpenGL on Lectura that we will use. It is in
~cs433/Fall00/Mesa-3.2.1/. The Mesa distribution contains many demo programs. They
are in the subdirectories demos, xdemos, samples, and book. In order to execute these
demos, you must set your LD_LIBRARY_PATH environment variable using the
following command: setenv LD_LIBRARY_PATH /home/cs433/Fall00/Mesa-3.2.1/lib
This tells the computer where to look for the Mesa shared libraries that are needed by the
demo programs. OpenGL does not provide commands for performing windowing tasks
or for obtaining user input. These commands are provided by GLUT (the OpenGL Utility
Toolkit). GLUT provides commands to create windows, subwindows, and menus; and to
handle input from a variety of devices via a callback mechanism. Documentation is
available in pdf or postscript form.Both OpenGL and GLUT work with the C or C++
programming languages.It is possible that an OpenGL library came with your compiler
(e.g. Microsoft Visual C++) in which case you only need to get GLUT. You can use
Mesa (I think) but it probably isn't worth the trouble. I used GLUT with Microsoft's
OpenGL library without any problems.Whatever your system, it should be possible to set
up the required libraries so that you will be able to do all the assignments on your home
machine. HOWEVER, you should make sure that your programs compile and run
correctly on Lectura because that's where I will execute them.

Dept. of CSE, JVIT Page 5


CLIENT AND SERVER ARCHITECTURE 2022-23

4. RGB and HSV colour spaces in digital images:


A colour space is a specific implementation of a colour model i.e., colour model is a way
of describing and specifying a colour. The term is often used loosely to refer to both a
colour space system and the colour space on which it is based. There are many RGB
colour spaces. When converted from one colour space to another, any colour that are
outside the destination space are "out of Gamut" colours since they can't be represented
accurately# by the new space. It can check in order to see which colour will be either
clipped off or re-mapped into the smaller colour space. Whether colours are clipped or
remapped will depend on the rendering intent—which is a term for the mathematical
algorithm used to convert from one colour space to another. RGB is easy to implement
but non–linear with visual perception. It is device dependent and specification of colours
is semi–intuitive. RGB is very common, being used in virtually every computer system
as well as television, video etc. RGB is a colour model that uses the three primary (red,
green, blue) additive colours, which can be mixed to make all other colours. RGB builds
its model on different colours of light added together, where the mixture of all three
colour produces white light.

HSV: Hue Saturation Value is based on the artist concepts of Tint, Shade, and Tone
respectively. The HSV colour space, like RGB, is a device-dependent colour space, meaning
the actual colour you see on your monitor depends on what kind of monitor you are using,
and what its settings are. The terms Hue, Saturation and Value are defined as:

 Hue: This is the colour itself, which results from the combination of primary colours. All
shades (except for the grey levels). The term “colour” is often used instead of “Hue”.
The RGB colours are “primary colours”.

 Saturation in HSV: It is that quality of colour by which we distinguish a strong colour


from a weak one; the degree of departure of a colour sensation from that of a white or
grey; the intensity of a distinctive hue; colour intensity.

 Value: It is that quality by which we distinguish a light colour from a dark one. This
value describes the luminosity, the luminous intensity. It is the amount of light emitted
by a colour.

Dept. of CSE, JVIT Page 6


CLIENT AND SERVER ARCHITECTURE 2022-23

2.1 ANIMATION
One of the exciting things you can do on a graphics computer is draw pictures that
move. Hence animation is clearly an important part of computer graphics. In a movie theatre,
motion is achieved by taking a sequence of pictures and projecting them at 24 frames per
second on the screen. Each frame is moved in position behind the lens, the shutter is opened
and the frame is displayed. The shutter is momentarily closed while the frame is advanced to
the next frame, then the frame is displayed and so on. Although 24 different frames are
watched each second, one’s brain blends them all into a smooth animation. The key reason
why motion picture projection works is that each frame is complete when it is displayed. But
in computer animation, the time it takes for your system to clear the screen and to draw a
typical frame. The results are increasingly poor depending upon how close to 1/24 th second
the system takes to clear and draw.

Most OpenGL implementations provide double-buffering-hardware or software that


supplies 2 complete colour buffers. One is displayed while the other is being drawn. When
the drawing of a frame is complete, the 2 buffers are swapped, so the one that was being
viewed is now used for drawing and vice versa. With double-buffering, each frame is shown
only when the drawing is complete: the viewer never sees a partially drawn frame.

motion = redraw + swap

Usually, it is easy to redraw the entire buffer from scratch for each frame than to figure
out which parts require redrawing. This is especially true with applications like 3D flight
simulator where a tiny change in the flight’s orientation changes the position if everything
outside the window. In most animations, the objects are simply redrawn with different
transformations – the viewpoint of a viewer moves or an object is rotated slightly. If
significant re-computation is required for non-drawing operations, then the attainable frame
rate often slows down.

Dept. of CSE, JVIT Page 7


CLIENT AND SERVER ARCHITECTURE 2022-23

CHAPTER 3
SYSTEM REQUIREMENTS

System requirements are intended to communicate in precise way, the functions that the
system must provide. To reduce ambiguity, they may be written in a structured form of
natural language supplemented by tables and system models.

3.1 HARDWARE REQUIREMENTS


The physical components required are:

 Processor : Core i5

 Memory : 8GB RAM

 Storage : 40GB Hard Disk Drive

3.2 SOFTWARE REQUIREMENTS


The software used in building this program are as specified:-

 Operating system: Windows 11

 Tools : Dev C++

 Graphics Library: glut.h

 OpenGL : Version 2.0

Dept. of CSE, JVIT Page 8


CLIENT AND SERVER ARCHITECTURE 2022-23

CHAPTER 4
METHODOLOGY

4.1 INTRODUCTION
This chapter introduces a brief description of the system and approaches overall
framework used in building the system from defining the requirements.

Also, it includes a brief description of the software and hardware components that were used.

4.2 DESIGN PREPARATIONS


The design preparation is a phase before the actual development, they include the
determination of the development tools and determination of the technique used to develop
the application.

4.3 DETERMINE DEVELOPMENT TOOLS


2D Client and Server Architecture has been developed by Dev C++, OpenGL,
FreeGLUT. OpenGL (Open Graphics Library) is a cross-language, cross-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. Applications use it extensively in the fields of computer-aided design
(CAD), virtual reality, scientific visualization, information visualization, flight simulation,
and video games. FreeGLUT is an open-source alternative to the OpenGL Utility Toolkit
(GLUT) library. GLUT (and hence FreeGLUT) allows the user to create and manage
windows containing OpenGL contexts on a wide range of platforms and also read the mouse,
keyboard and joystick functions. FreeGLUT is intended to be a full replacement for GLUT,
and has only a few differences.

Dept. of CSE, JVIT Page 9


CLIENT AND SERVER ARCHITECTURE 2022-23

CHAPTER 5
IMPLEMENTATION

5.1 FUNCTIONS

 file_gen is used to check whether high score file already exists. If it does not, it will
create. If it does, it will read data from existing file.

 render_header to display the player's name along with a running timer. The timer gets
its values from the clock class, which maintains the time elapsed since the game started
in hour, minutes and seconds.

 hiscore_check to determine the position of the player in the high scores list. If he
completes the game in a time lesser than the top 10 players, it implements an insertion
sort to insert the player's name and time into the existing high score list.

 write_file is used to write a text file of the current player class. The player class
contains details of the player name and the time he took to complete the game. All these
details, along with the preexisting records of the high scores are arranged in ascending
order of time and are written into a text file.

 sub is the display function for the sub window created to display the high scores. This
window is activated when the user chooses the option "high scores" from the menu
obtained on right click of the mouse.

MOUSE EVENTS:

When mouse event occurs, the ASCII code for the corresponding coordinates that
generate the event and the location of mouse are returned. Mouse callback function is

glutMouseFunc(mouse);
void mouse (int btn, int state, int x, int y) {
if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN)
begin = x;
}

MENU ENTRY:

GLUT provides one additional feature, pop_up menus, which we can use with the
mouse to create sophisticated interactive application glutCreateMenu (); glutAddMenuEntry
(); glutAttachMenu (GLUT_RIGHT_BUTTON);

Dept. of CSE, JVIT Page 10


CLIENT AND SERVER ARCHITECTURE 2022-23

5.2 DESIGN
The flow chart describes how the path travels.

Fig 5.2.1: Under Implementation Chapter explains the Data Flow Diagram.

This includes the flow from application program to handling different events like pixel

event, Motion event and the texture memory.

5.3 PROPOSED SYSTEM


To achieve three dimensional effects, open GL software is proposed. It is software
which provides a graphical interface. It is a interface between application program and
graphics hardware.

The advantages are:

 Open GL is designed as a streamlined.


 It’s a hardware independent interface i.e it can be implemented on many different
hardware platforms.
 With openGL we can draw a small set of geometric primitives such as points, lines and
polygons etc.
 It provides double buffering which is vital in providing transformations.
 It is event driven software.
 It provides call back function.

Dept. of CSE, JVIT Page 11


CLIENT AND SERVER ARCHITECTURE 2022-23

CHAPTER 6
SOURCE CODE
#include<stdio.h>
#include<GL/glut.h>
#include<string.h>
#include<stdlib.h>
#define monitor 1
#define upbox 2
#define boxbuses 3
#define fi 4
#define keys 5
float x=-18,y=34;
int i,flag=0,w=0,q=5,r=0,s=0,u=0;
float tr=0.0,t=0.0,t2=0.0,t3=0.0,t4=0.0,t1=0.0,t5=0.0;
float tr1=0.0;
float tr2=0.0;
float tr3=0.0;
float tr4=0.0;
float tr5=0.0;
void animated();
void anim();
void textures(){
char *ptr="CTRL pr'ss";
int len=strlen(ptr);
glColor3f(1.0,0.0,0.0);
glRasterPos3f(-32.0,-3.0,0.0);
for(int i=0;i<len;i++)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18,ptr[i]);
char *ptr1="CTRL pr'ss";
int len1=strlen(ptr1);
glColor3f(1.0,0.0,0.0);
glRasterPos3f(23.5,-3.0,00.0);
for(i=0;i<len1;i++)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18,ptr1[i]);
char *ptr2="DATA pr'ss";
int len2=strlen(ptr2);
glColor3f(1.0,0.0,0.0);
glRasterPos3f(23.5,-38,00.0);
for(i=0;i<len2;i++)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18,ptr2[i]);
char *ptr3="DATA pr'ss1";
int len3=strlen(ptr3);
glColor3f(1.0,0.0,0.0);
glRasterPos3f(-32.0,-38,0.0);
for(i=0;i<len3;i++)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18,ptr3[i]);
char *ptr4="SERVER";
int len4=strlen(ptr4);

Dept. of CSE, JVIT Page 12


CLIENT AND SERVER ARCHITECTURE 2022-23
glColor3f(1.0,0.0,0.0);
glRasterPos3f(27,40,0.0);
for(i=0;i<len4;i++)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18,ptr4[i]);
glFlush();
}
void ctrline() {
glLineWidth(1.5);
glBegin(GL_LINES);
glVertex3f(-22,34.0,10.0);
glVertex3f(-20,34.0,10.0);
glEnd();
}
void file() {
glNewList(fi,GL_COMPILE_AND_EXECUTE);
glBegin(GL_POLYGON);
glColor3f(1.0,1.0,1.0);
glVertex2f(-17.5,31.5);
glVertex2f(-17.5,34.5);
glVertex2f(-16.0,34.5);
glVertex2f(-16.0,31.5);
glEnd();
glBegin(GL_LINES);
glColor3f(0.0,0.0,0.0);
glVertex2f(-16.3,32);
glVertex2f(-17.3,32);
glEnd();
glBegin(GL_LINES);
glColor3f(0.0,0.0,0.0);
glVertex2f(-16.3,33);
glVertex2f(-17.2,33);
glEnd();
glBegin(GL_LINES);
glColor3f(0.0,0.0,0.0);
glVertex2f(-16.3,34);
glVertex2f(-17.3,34);
glEnd();
glEndList();
}
void disp() {
glBegin(GL_POLYGON);
glColor3f(0.0,0.0,0.1);
glVertex3f(-27.0,15.0,0.0);
glVertex3f(-19.0,15.0,0.0);
glVertex3f(-19.0,40.0,0.0);
glVertex3f(-27.0,40.0,0.0);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.3,0.5,0.4);

Dept. of CSE, JVIT Page 13


CLIENT AND SERVER ARCHITECTURE 2022-23
glVertex3f(23.0,-5.0,5.0);
glVertex3f(33.0,-5.0,5.0);
glVertex3f(33.0,0.0,5.0);
glVertex3f(23.0,0.0,5.0);
glEnd();
glEndList();
glPushMatrix();
glScalef(0.0,0.5,0.0);
glCallList(2);
glPopMatrix();
glPushMatrix();
glTranslatef(-55.0,0.0,0.0);
glCallList(2);
glPopMatrix();
glPushMatrix();
glTranslatef(-55.0,-35.0,0.0);
glCallList(2);
glPopMatrix();
glPushMatrix();
glTranslatef(0.0,-35.0,0.0);
glCallList(2);
glPopMatrix();
glNewList(boxbuses,GL_COMPILE_AND_EXECUTE);
glEnable(GL_BLEND);
glColor4f(0.6,0.7,0.8,0.5);
glBegin(GL_QUAD_STRIP);
glVertex2f(-22.0,-1.0);
glVertex2f(-22.0,-5.0);
glVertex2f(23.0,-1.0);
glVertex2f(23.0,-5.0);
glEnd();
glDisable(GL_BLEND);
glEndList();
glPushMatrix();
glTranslatef(0.0,-35.0,0.0);
glCallList(3);
glPopMatrix();
}
void display() {
glClear(GL_COLOR_BUFFER_BIT/*|GL_DEPTH_BUFFER_BIT*/ );
glPushMatrix();
glColor3f(1.0,1.0,0.0);
glTranslatef(0.0+tr,0.0,10.0);
ctrline();
glPopMatrix();
glPushMatrix();
glColor3f(0.0,1.0,0.0);
glTranslatef(47.0-tr1,0.0,10.0);
ctrline();

Dept. of CSE, JVIT Page 14


CLIENT AND SERVER ARCHITECTURE 2022-23
glPopMatrix();
glPushMatrix();
glColor3f(1.0,0.0,1.0);
glTranslatef(-3.0+tr2,-15.0,10.0);
file();
glPopMatrix();
glPushMatrix();
glTranslatef(-5.0+tr2,-15.0,0.0);
glCallList(fi);
glPopMatrix();
glPushMatrix();
glTranslatef(-7.0+tr2,-15.0,0.0);
glCallList(fi);
glPopMatrix();
glPushMatrix();
glTranslatef(-9.0+tr2,-15.0,0.0);
glCallList(fi);
glPopMatrix();
glLineWidth(.1);
if(flag==1) {
glPushMatrix();
glTranslatef(-5.0+t,-36.5,0.0);
glColor3f(1.0,1.0,1.0);
ctrline();
glPopMatrix();
glPushMatrix();
glTranslatef(41.0-t1,-71,0.0);
glCallList(fi);
glPopMatrix();
glPushMatrix();
if(flag==1 && r<5)r++;
glTranslatef(r,r,0);
char *ptr7="RETR";
int len7=strlen(ptr7);
glColor3f(1.0,0.0,0.0);
glRasterPos3f(-18,0,0.0);
for(int i=0;i<len7;i++)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12,ptr7[i]);
glPopMatrix();
}
if(flag==2) {
glPushMatrix();
glTranslatef(-6.0+t2,-36.5,0.0);
glColor3f(1.0,1.0,1.0);
ctrline();
glPopMatrix();
glPushMatrix();
glTranslatef(-5+t3,-71,0.0);
glCallList(fi);

Dept. of CSE, JVIT Page 15


CLIENT AND SERVER ARCHITECTURE 2022-23
glPopMatrix();
glPushMatrix();
if(flag==2 && s<5) s++;
glTranslatef(s,s,0);
char *ptr7="STR";
int len7=strlen(ptr7);
glColor3f(1.0,0.0,0.0);
glRasterPos3f(-18,0,0.0);
for(i=0;i<len7;i++)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12,ptr7[i]);
glPopMatrix();
}
if(flag==3) {
glPushMatrix();
glTranslatef(-4.0+t4,-36.5,0.0);
glColor3f(1.0,1.0,1.0);
ctrline();
glPopMatrix();
glPushMatrix();
glTranslatef(41.0-t5,-71,0.0);
glCallList(fi);
glPopMatrix();
glPushMatrix();
if(flag==3 && u<5) u++;
glTranslatef(u,u,0);
char *ptr8="LIST";
int len8=strlen(ptr8);
glColor3f(1.0,0.0,0.0);
glRasterPos3f(-18,0,0.0);
for(int i=0;i<len8;i++)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12,ptr8[i]);
glPopMatrix();
}
disp();
textures();
if(tr1>=48) {
char *ptr6="DATA";
int len6=strlen(ptr6);
glColor3f(1.0,0.0,0.0);
glRasterPos3f(-46,32,0.0);
for(int i=0;i<len6;i++)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12,ptr6[i]);
}
if(tr2>=48){
char *ptr7="DATA SENT";
int len7=strlen(ptr7);
glColor3f(1.0,0.0,0.0);
glRasterPos3f(-46,32,0.0);
for(int i=0;i<len7;i++)

Dept. of CSE, JVIT Page 16


CLIENT AND SERVER ARCHITECTURE 2022-23
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12,ptr7[i]);
}
glPushMatrix();
if(w<5) w++;
glTranslatef(w,w,0);
char *ptr5="COMMANDS";
int len5=strlen(ptr5);
glColor3f(1.0,0.0,0.0);
glRasterPos3f(-18,34,0.0);
for(int i=0;i<len5;i++)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12,ptr5[i]);
glPopMatrix();
glPushMatrix();
if(tr>=43 && w>=5 && q>2)q--;
glTranslatef(q,q,0);
char *ptr6="RESPONSE";
int len6=strlen(ptr6);
glColor3f(1.0,0.0,0.0);
glRasterPos3f(10,27,0.0);
for(i=0;i<len6;i++)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12,ptr6[i]);
glPopMatrix();
glutSwapBuffers();
glFlush();
}
void init(){
glClearColor(0.4,0.2,0.1,0.0);
glOrtho(-50,50,-50,50,-50,50);
}
void animate() {
if(tr<48)
tr+=0.2;
else if(tr>=48 && tr1<48)
tr1+=0.2;
else if(tr1>=48 && tr2<48)
tr2+=0.1;
else if(tr2>=48 && tr3<48)
tr3+=0.1;
glutPostRedisplay();
}
void anim(){
if(t<53)
t+=0.2;
else if(t>=53 && t1<53)
t1+=0.2;
else if(t2<53)
t2+=0.2;
else if(t2>=53 && t3<53)
t3+=0.2;

Dept. of CSE, JVIT Page 17


CLIENT AND SERVER ARCHITECTURE 2022-23
else if(t4<53)
t4+=0.2;
else if(t4>=53 && t5<53)
t5+=0.2;
glutPostRedisplay();
}
void mymenu(int id){
switch(id) {
case 1: glutIdleFunc(animate);
break;
case 2:flag=1;
glutIdleFunc(anim);
break;
case 3: flag=2;
glutIdleFunc(anim);
break;
case 4: flag=3;
glutIdleFunc(anim);
break;
case 5:exit(0);
}
}
int main(int argc,char **argv) {
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB/*|GLUT_DEPTH*/);
glutInitWindowSize(1000,1000);
glutInitWindowPosition(0,0);
glutCreateWindow("server");
glutDisplayFunc(display);
glutCreateMenu(mymenu);
glutAddMenuEntry("START",1);
glutAddMenuEntry("START 1:RETRIVE",2);
glutAddMenuEntry("START 2:STORE",3);
glutAddMenuEntry("START 3:LIST",4);
glutAddMenuEntry("EXIT",5);
glutAttachMenu(GLUT_RIGHT_BUTTON);
glBlendFunc(GL_SRC_ALPHA,GL_DST_ALPHA);
init();
glutMainLoop();
return 0;
}

Dept. of CSE, JVIT Page 18


CLIENT AND SERVER ARCHITECTURE 2022-23

CHAPTER 7
RESULT AND TESTING

7.1 OVERVIEW OF 2D CLIENT AND SERVER ARCHITECTURE:

Fig 7.1.1 Overview.

Fig 7.1.2 Options for number of clients and servers.

Dept. of CSE, JVIT Page 19


CLIENT AND SERVER ARCHITECTURE 2022-23

Fig 7.1.3 Handshaking Process.

Fig 7.1.4 Data Uploading.

Dept. of CSE, JVIT Page 20


CLIENT AND SERVER ARCHITECTURE 2022-23

Fig 7.1.5 Data Downloaded.

Fig 7.1.6 Data uploaded and downloaded in all the clients and server.

Dept. of CSE, JVIT Page 21


CLIENT AND SERVER ARCHITECTURE 2022-23

CHAPTER 8
CONCLUSION AND FUTURE SCOPE

8.1 CONCLUSION
The 2D Client Server Architecture has been tested under Windows XP and has been
found to provide ease of use and manipulation to the user. The 2D Client Server Architecture
created for the Windows XP operating system can be used to draw lines, boxes, circles,
ellipses, and polygons. It has a very simple and aesthetic user interface. We found designing
and developing this 2D Client Server Architecture as a very interesting and learning
experience. It helped us to learn about computer graphics, design of Graphical User
Interfaces, interface to the user, user interaction handling and screen management. The
graphics editor provides all and more than the features that have been detailed in the
university syllabus.

8.2 FUTURE ENHANCEMENTS


These are the features that are planned to be supported in the future

 Support for multiple canvases

 Support for pattern filling

 Support for 3d transformations

 Support for transparency of layers

Dept. of CSE, JVIT Page 22


CLIENT AND SERVER ARCHITECTURE 2022-23

REFERENCES

[1] A. Mcgettrick, R. Boyle, R. Ibbett, J. Lloyd, G. Lovegrove Structuring 2D models for


Educational purposes: a Top-Down Approach with Shader-Based OpenGL 6th ed.
Addison Wesley.

[2] James D Foley, Andries Van Dam, Steven K Feiner, John F Huges Computer graphics
with OpenGL: pearson education.

[3] Kelvin Sung, Peter Shirley, Steven Baer: Interactive Computer Graphics, concepts and
applications, Cengage Learning.

[4] OpenGL programming guide, the official guide to learning OpenGL version 2.1,6
thedition, Pearson Publications, by Dave Shreiner, Mason woo, Jackie Neider, Tom
Davis.!

[5] http://www.cs.uvm.edu/~xwu/kdd/Slides/Kmeans-ICDM06.pdf!

[6] http://disp.ee.ntu.edu.tw/meeting/%E6%98%B1%E7%BF%94/Segmentation%20tutorial.
pdf!

Dept. of CSE, JVIT Page 23

You might also like