ATC (Project) Final 11
ATC (Project) Final 11
ATC (Project) Final 11
Main aim of this Mini Project is to illustrate the concepts and usage of Air Traffic
Control in OpenGL. Air traffic control (ATC) is a service provided by ground-based
controllers who direct aircraft on the ground and through controlled airspace. The
primary purpose of ATC systems worldwide is to prevent collisions, organize and expedite
the flow of traffic, and provide information and other support for pilots. To prevent
collisions, ATC enforces traffic separation rules, which ensure each aircraft maintains a
minimum amount of empty space around it at all times. . We have used input devices like
mouse and key board to interact with program. We have added menu which makes the
program more interactive.
ii
CONTENTS
TITLE PAGES
ACKNOWLEDGEMENT i
ABSTRACT ii
CONTENTS iii
LIST OF FIGURES iv
CHAPTER 7 CONCULSION 37
CHAPTER 8 REFERENCES 38
iii
LIST OF FIGURES
iv
AIR TRAFFIC CONTROL 2023-24
CHAPTER 1
INTRODUCTION
interface for OpenGL programs. The interface is designed to be simple yet still meet the
needs of useful OpenGL programs. Removing window system operations from OpenGL
is a sound decision because it allows the OpenGL graphics system to be retargeted to
various Systems including powerful but expensive graphics workstations as well as mass-
production graphics systems like video games, set-top boxes for interactive television,
and PCs.
The GLUT application-programming interface (API) requires very few routines to display a
graphics scene rendered using OpenGL. The GLUT routines also take relatively few parameters.
The term computer graphics includes almost everything on computers that is not text or
sound. Today nearly all computers use some graphics and users expect to control their
computer through icons and pictures rather than just by typing. The term Computer
Graphics has several meanings The representation
and manipulation of pictorial data by a computer. The various technologies used to create
and manipulate such pictorial data The images so produced, and The sub-field of
computer science which studies methods for digitally synthesizing and manipulating
visual content Today computers and computer- generated images touch many aspects of
our daily life.
4. Virtual Reality (VR) and Augmented Reality (AR): Computer graphics plays a vital
role in VR and AR technologies, which immerse users in virtual worlds or overlay
virtual objects onto the real world. Realistic graphics and real-time rendering are crucial
for creating convincing and immersive experiences.
CHAPTER 2
LITERATURE SURVEY
execution of all previously issued OpenGL commands. Construct shapes from geometric
primitives, thereby creating mathematical descriptions of objects. (OpenGL considers
points, lines, polygons, images, and bitmaps to be primitives.) Arrange the objects in
three-dimensional space and select the desired vantage point for viewing the composed
scene. Calculate the color of all the objects. The color might be explicitly assigned by the
application, determined from specified lighting conditions, obtained by pasting texture
onto the objects, or some combination of these three actions. Convert the mathematical
description of objects and their associated color information to pixels on the screen. This
process is called rasterization. OpenGL is a standard specification that defines an API that
is multi-language and multi-platform and that enables the codificationof applications that
output computerized graphics in 2D and 3 The interface consists inmore than 250
different functions, which can be used to draw complex tridimensional scenes with
simple primitives. It consists of many functions that help to create a real-world object
and a particular existence for an object can be given.
Air traffic control (ATC) is a service provided by ground-based controllers who direct
aircraft on the ground and through controlled airspace. The primary purpose of ATC
worldwide is to prevent collisions, organize and expedite the flow of air traffic, and
provide information and other support for pilots. Air traffic controllers monitor the
location of aircraft in their assigned airspace by radar and communicate with the pilots
by radio. To prevent collisions, ATC enforces traffic separation rules, which ensure each
aircraft maintains a minimum amount of empty space around it at all times. It is also
common for ATC to provide services to all private, military, and commercial aircraft
operating within its airspace, not just civilian aircraft. Depending on the type of flight
and the class of airspace, ATC may issues instructions that pilots are required to obey, or
advisories that pilots may, at their discretion, disregard. The pilot in command is the
finally authority for the safe operation of the aircraft and may, in an emergency, deviate
from ATC instructions to extent required to maintain safe operation of their aircraft.
CHAPTER 3
• Header files:
1. GL/glut.h
2. stdio.h
3. math.h
CHAPTER 4
DESIGN
The mini project is designed to how graphics can be used to represent data. It isa
graphics package encoded in Microsoft Visual C++ with OpenGL and the mini
project basically deals with providing the graphical representation of data that a user
provides as statistics to the system.
• The mini project is implemented using ‘C++’ and ‘OpenGL’ built in functions.
• In the beginning the user is asked to enter the statistical data through the windows
command line.
• Once the data is input, the computations are done by program to compute various
co- ordinates etc. and appropriate graph as per users choice is rendered on the display
window.
• The aim of the project is to show how the a space shooter can be implemented
using computer graphics. The various functions used to implement it are attractive.
The dataflow diagram. Which shows the flow of data within the program from the start
to the different functions within the program, where each function will perform its
specified actions for the proper display of the graphics and functionality defined within
the program.
CHAPTER 5
IMPLEMENTATION
• main( ): The control will first enter into this function and in this function
it will create a window and it will initialize the window and then this function
calls display function.
#include <windows.h>
#include<string.h>
#include<stdarg.h>
#include<stdio.h>
#include <glut.h>
bool takeOff=false;
va_start(args, format);
va_end(args); glPushMatrix();
glTranslatef(-2.5, y, 0);
glutStrokeCharacter(GLUT_STROKE_ROMAN, *p);
glPopMatrix();
/runway strip
glPushMatrix();
glRotatef(-65,0,1,0);
glColor3f(1,1,1);
glTranslatef(x1,-
3.5,7.8);
glScaled(1,0.15,0.1);
glutSolidCube(1);
glPopMatrix();
glPushMatrix();
// Main Body
glPushMatrix();
glScalef(.3,0.3,1.5);
if(y1<=15)
glColor3f(1,1.0,0.5);
if(y1>=15)
glColor3f(1,0.3,0.5);
glutSolidSphere(2.0,
5 0,50);
glPopMatrix();
glPushMatrix();
}
glTranslatef(0.0,0.1,-1.8);
glScalef(1.0,1,1.5);
glColor3f(0,0,1);
glutSolidSphere(0.5,25,25);
glPopMatrix();
//Left Fin
glPushMatrix();
glTranslatef(-1.0,0,0);
glScalef(1.5,0.1,0.5);
glColor3f(0,0,0);
glutSolidSphere(1.0,50,50);
glPopMatrix();
// Right Fin
glPushMatrix();
glTranslatef(1.0,0,0);
glScalef(1.5,0.1,0.5);
glColor3f(0,0,0);
glutSolidSphere(1.0,50,50);
glPopMatrix();
glPushMatrix();
glTranslatef(0.8,0,2.4);
glScalef(1.2,0.1,0.5);
glColor3f(0.0,0,0);
glutSolidSphere(0.4,50,50);
glPopMatrix();
glPushMatrix();
glTranslatef(-0.8,0,2.4);
glScalef(1.2,0.1,0.5);
glColor3f(0.0,0,0);
glutSolidSphere(0.4,50,50);
glPopMatrix();
glPushMatrix();
glTranslatef(0,0.5,2.4);
glScalef(0.1,1.1,0.5);
glColor3f(0.0,0,0);
glutSolidSphere(0.4,50,50);
glPopMatrix();
// Blades
glPushMatrix();
glRotatef(x2,0.0,0.0,1.0);
glPushMatrix();
glTranslatef(0,0.0,-3.0);
glScalef(1.5,0.2,0.1);
glColor3f(0.0,0,0);
glutSolidSphere(0.3,50,50);
glPopMatrix();
//blades
glPushMatrix();
glRotatef(90,0.0,0.0,1.0);
glTranslatef(0,0.0,-3.0);
glScalef(1.5,0.2,0.1);
glColor3f(0.0,0,0);
Dept. Of CSE, BGSIT, B G NAGARA Page 16
AIR TRAFFIC CONTROL 2023-24
glutSolidSphere(0.3,50,50);
glPopMatrix();
/* Blased End */
/* Wheels */
//Front
glPushMatrix();
glTranslatef(0.0,-0.8,-1.5);
glRotatef(90,0.0,1,0);
glScaled(0.3,0.3,0.3);
glutSolidTorus(0.18,0.5,25,25);
glColor3f(1,1,1);
glutSolidTorus(0.2,0.1,25,25);
glPopMatrix();
glPushMatrix();
glTranslatef(0.0,-0.4,-1.5);
glRotatef(20,0.0,1,0);
glScaled(0.05,0.3,0.05);
glutSolidSphere(1.0,25,25);
glPopMatrix();
//Rear
glPushMatrix();
glTranslatef(0.3,-0.8,0.7);
glRotatef(90,0.0,1,0);
glScaled(0.3,0.3,0.3);
glColor3f(0,0,0);
glutSolidTorus(0.18,0.5,25,25);
glColor3f(1,1,1);
glutSolidTorus(0.2,0.1,25,25);
glPopMatrix();
glPushMatrix();
glTranslatef(0.3,-0.4,0.7);
glRotatef(20,0.0,1,0);
glScaled(0.05,0.3,0.05);
glutSolidSphere(1.0,25,25);
glPopMatrix();
//rear 2
glPushMatrix();
glTranslatef(-0.3,-0.8,0.7);
glRotatef(90,0.0,1,0);
glScaled(0.3,0.3,0.3);
glColor3f(0,0,0);
glutSolidTorus(0.18,0.5,25,25);
glColor3f(1,1,1);
glutSolidTorus(0.2,0.1,25,25);
glPopMatrix();
glPushMatrix();
glTranslatef(-0.3,-0.4,0.7);
glRotatef(20,0.0,1,0);
glScaled(0.05,0.3,0.05);
glutSolidSphere(1.0,25,25);
glPopMatrix();
glPopMatrix();
// Plane Transition
glPushMatrix();
if(y1<=-2){
glTranslatef(5.5+y1,3,0);
glRotatef(-90,0,1,0);
}
if(takeOff)
if(y1>=15){
glRotatef(140,0,1,0);
if(y1>=15 && y1<=20)
glTranslatef(2+15-y1,-3,-3);
if(y1>=20)
glTranslatef(2+15-y1,-3-20+y1,-3);
drawPlane(y1);
}
glPopMatrix();
glPopMatrix();
void airport(){
//Floor glColor3f(0,1,0);
glBegin(GL_POLYGON);
glVertex3f(-19,-3.5,19);
glVertex3f(-19,-3.5,-19);
glVertex3f(19,-3.5,-19);
glVertex3f(19,-3.5,19);
glEnd();
glPushMatrix();
// runway landing
glPushMatrix();
glColor3f(1,1,1);
glTranslate(3.5);
glScaled(17);
glPushMatrix();
glRotatef(-65,0,1,0);
glColor3f(0.1,0.1,0.1);
glTranslatef(-1,-3.5,7);
glScaled(2.5,0.1,1.5);
glutSolidCube(1);
glPopMatrix();
//parking plane 1
glPushMatrix();
glRotatef(-65,0,1,0);
glTranslatef(3,-2.7,7.4);
glScaled(0.15,0.3,0.15);
drawPlane(16);
glPopMatrix();
glRotatef(-65,0,1,0);
glTranslatef(3,-2.7,7.4);
glScaled(0.15,0.3,0.15);
drawPlane(16);
glPopMatrix();
//parking place 2
glPushMatrix();
glRotatef(-65,0,1,0);
glColor3f(0.1,0.1,0.1);
glTranslatef(3,-3.5,7);
glScaled(2.5,0.1,1.5);
glutSolidCube(1);
glPopMatrix();
//parking plane 2
glPushMatrix();
glRotatef(-65,0,1,0);
glTranslatef(6.5,-2.7,7.4);
glScaled(0.15,0.3,0.15);
drawPlane(16);
glPopMatrix();
//parking place 3
glPushMatrix();
glRotatef(-65,0,1,0);
glColor3f(0.1,0.1,0.1);
glTranslatef(7,-3.5,7);
glScaled(2,0.1,1.5);
glutSolidCube(1);
glPopMatrix();
//parking plane 3
glPushMatrix();
glRotatef(-65,0,1,0);
glTranslatef(10,-2.7,7.4);
glScaled(0.15,0.3,0.15);
drawPlane(16);
glPopMatrix();
// parking building
glPushMatrix();
glRotatef(-65,0,1,0);
glColor3f(0,0.5,0.5);
glTranslatef(4,-3.5,5.5);
glScaled(14,2.2,1);
glutSolidCube(1);
glPushMatrix();
glRotatef(15,0,1,0);
glTranslatef(0,0.3,0);
glScaled(0.9,0.3,1);
glColor3f(0.1,0.1,0.1);
glutSolidCube(1);
glPopMatrix();
glPopMatrix();
strip(-2);
strip(0);
strip(2);
strip(4);
strip(6);
strip(8); strip(10);
// runway Lights
for(float j=-1.3;j<=-0.5;j+=0.8)
{
for(float i=-4.5;i<=1.8;i+=0.9){
glPushMatrix();
glColor3f(1,0,0);
glTranslatef(i,-
3.4,j);
//glScaled(6,0.2,1);
glutSolidSphere(0.05,10,10)
;glPopMatrix();
}
glTranslatef(7,0,-4);
// Building
glPushMatrix();
glTranslatef(-2,-3,-2);
glutSolidCube(1);
glPopMatrix();
//Rotating Dish
glPushMatrix();
glColor3f(0,0,1);
glTranslatef(-2,-2.0,-2);
glRotatef(x2/15,0,1,0);
glScaled(0.1,0.3,1);
glutSolidCube(1);
glPopMatrix();
//dish connector
glPushMatrix();
glColor3f(0,0,1);
glTranslatef(-2,-2.5,-2);
glScaled(0.1,0.9,0.1);
glutSolidCube(1);
glPopMatrix();
glPopMatrix();
//Mountain
glPushMatrix();
glColor3f(0.2,0.2,0.2);
glTranslatef(-3,-3,-15);
glScaled(10,4,1);
glutSolidDodecahedron();
glPopMatrix();
glColor3f(0,0,1);
glTranslatef(-2,-2.5,-2);
glScaled(0.1,0.9,0.1);
glutSolidCube(1);
glPopMatrix();
glPopMatrix();
//Mountain
glPushMatrix();
glColor3f(0.2,0.2,0.2);
glTranslatef(-3,-3,-15);
glScaled(10,4,1);
glutSolidDodecahedron();
glPopMatrix();
}
// Start your Drawing ---Draw pyramidvoid
controller()
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0,0.0,-25.0);
glRotatef(-90,0,1,0)’
animate(yaxis[0],x[0]);
for(int i=0;i<max;i++){
if(yaxis[i]>=-5){
//wait until previous plane reaches safe locationanimate(yaxis[i+1],x[i+1]);
if(yaxis[i+1]>=-2 && yaxis[i+1]<=6.7)
// Rotate until y-axis of plane is less than 6.7
x[i+1]+=3.5;
yaxis[i+1]+=0.1;
yaxis[i+1]+=0.1;
airport();
yaxis[0]+=0.15;
yaxis[0]+=0.06;
else if(yaxis[0]>=6.7 )
yaxis[0]+=0.1;
glFlush();
glutSwapBuffers();
void doInit()
glClearColor(1.0,1.0,1.0,0.0);
glViewport(0,0,640,480);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(30.0f,(GLfloat)640/(GLfloat)480,0.1f,200.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glClearDepth(2.0f);
glEnable(GL_DEPTH_TEST
);
glDepthFunc(GL_LEQUAL)
;
glEnable(GL_COLOR_MATERIAL);
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0f,0.0f,-13.0f);
stroke_output(-2.0, 1.7, "p--> Pyramid Clockwise");
stroke_output(-2.0, 1.0, "P--> Pyramid Anti Clockwise");
GLfloat mat_ambient[]={0.0f,1.0f,2.0f,1.0f};
GLfloat mat_diffuse[]={0.0f,1.5f,.5f,1.0f}; GLfloat
mat_specular[]={5.0f,1.0f,1.0f,1.0f};GLfloat
mat_shininess[]={50.0f};
glMaterialfv(GL_FRONT,GL_AMBIENT,mat_ambient);
glMaterialfv(GL_FRONT,GL_DIFFUSE,mat_diffuse);
glMaterialfv(GL_FRONT,GL_SPECULAR,mat_specular);
glMaterialfv(GL_FRONT,GL_SHININESS,mat_shininess);
light_position[]={0.0f,3.0f,2.0f,0.0f};
glLightfv(GL_LIGHT0,GL_POSITION,light_position);
glLightfv(GL_LIGHT0,GL_DIFFUSE,lightIntensity);
glutIdleFunc(controller);
glFlush();
glutSwapBuffers();
{
case 1:max+=1;
break;
case 2:max-=1;
break;
case 3:takeOff=!takeOff;
break;
case 4:exit(0);
break;
}
glFlush();
glutSwapBuffers();
glutPostRedisplay();
}
if(key=='p')
{
glutIdleFunc(controller);
}
if(key=='f')
{
takeOff=!takeOff;
}
if(key=='a')
{
max+=1;
}
if(key=='r')
{
max-=1;
}
if(key=='q'|| key=='Q')
{
exit(0);
}
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB);
glutInitWindowSize(1000,480);
glutInitWindowPosition(100,100);
glutCreateWindow("Glut Plane");
glutDisplayFunc(display);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glShadeModel(GL_SMOOTH);
glEnable(GL_DEPTH_TEST);
glEnable(GL_NORMALIZE);
glutKeyboardFunc(mykey);
glutCreateMenu(menu);
glutAddMenuEntry("Remove 'r'",2);
glutAddMenuEntry("Takeoff 'f'",3);
glutAddMenuEntry("Quit 'q'",4);
glutAttachMenu(GLUT_LEFT_BUTTON);
glutAttachMenu(GLUT_RIGHT_BUTTON);
doInit();
glutMainLoop();
return 0;
CHAPTER 6
RESULTS
CHAPTER 7
CONCLUSION
CHAPTER 8
REFERENCES
BOOKS
- Feiner hughes
WEBSITES
• www.OpenGL Redbook.com
• www.OpenGL simple examples.
• www.OpenGL programming guide.
• http://www.wikipedia.com
• http://basic4gl.wikispaces.com
• http://www.opengl.org
•http://pyopengl.sourceforge.net/documentation/manual/glut.3GLUT.html
CHAPTER 8
BIBLIOGRAPHY
BOOKS
- Feiner hughes
WEBSITES
• www.OpenGL Redbook.com
• www.OpenGL simple examples.
• www.OpenGL programming guide.
• http://www.wikipedia.com
• http://basic4gl.wikispaces.com
• http://www.opengl.org
•http://pyopengl.sourceforge.net/documentation/manual/glut.3GLUT.html