#include <stdio.h>
#include <GL/glut.h>
#include <math.h>
GLfloat a = 0, b = 0, c = 0, d = 0, e = 0;
int flag = 0, i = 0;
char start[100] = "PRESS ‘S’ TO START";
char exi[40] = "PRESS ‘Q’ TO QUIT";
char college[100] = "SAHYADRI COLLEGE OF ENGINEERING AND MANAGEMENT";
char dept[100] = "DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING";
char project[100] = "A Mini Project On:- Airplane TakeOff simulation";
char name1[50] = "By: Gladson Regan Dsouza 4SF17CS057";
char name2[50] = "Jeethen Crasta 4SF17CS063";
char inst[50] = "Hold 'A' to move the plane";
void runway();
void display();
void display2();
void display3();
void grass();
void treesSet1();
void treesSet2();
void treesSet3();
void mudRoad();
void building();
void mountain();
void houses();
void mudRoad()
{
//road
glColor3f(0.5f, 0.35f, 0.05f);
glBegin(GL_POLYGON);
glVertex2f(0.0, 379.0);
glVertex2f(0.0, 454.0);
glVertex2f(1920.0, 454.0);
glVertex2f(1920.0, 379.0);
glEnd();
//grass
glColor3f(0.0, 1.0, 0.0);
glBegin(GL_POLYGON);
glVertex2f(0.0, 454.0);
glVertex2f(0.0, 549.0);
glVertex2f(1920.0, 549.0);
glVertex2f(1920.0, 454.0);
glEnd();
// house
glColor3f(0.4f, 0.0f, 0.5f);
glBegin(GL_POLYGON);
glVertex2f(1101.0, 509.0);
glVertex2f(1101.0, 621.0);
glVertex2f(1160.0, 549.0);
glVertex2f(1160.0, 475.0);
glEnd();
glColor3f(1.0f, 0.5f, 0.0f);
glBegin(GL_POLYGON);
glVertex2f(1160.0, 475.0);
glVertex2f(1160.0, 549.0);
glVertex2f(1313.0, 549.0);
glVertex2f(1313.0, 475.0);
glEnd();
glColor3f(0.2f, 0.2f, 0.1f);
glBegin(GL_POLYGON);
glVertex2f(1224.0, 475.0);
glVertex2f(1224.0, 521.0);
glVertex2f(1248.0, 521.0);
glVertex2f(1248.0, 475.0);
glEnd();
glColor3f(0.0f, 0.0f, 0.6f);
glBegin(GL_POLYGON);
glVertex2f(1155.0, 543.0);
glVertex2f(1090.0, 625.0);
glVertex2f(1269.0, 625.0);
glVertex2f(1336.0, 543.0);
glEnd();
}
void sky()
{
glColor3f(0.0f, 0.5f, 1.0f);
glBegin(GL_POLYGON);
glVertex2f(0.0, 0.0);
glVertex2f(0.0, 960.0);
glVertex2f(1920.0, 960.0);
glVertex2f(1920.0, 0.0);
glEnd();
}
void building()
{
//building
glColor3f(0.8, 0.8, 0.8);
glBegin(GL_POLYGON);
glVertex2f(420.0, 466.0);
glVertex2f(420.0, 863.0);
glVertex2f(696.0, 863.0);
glVertex2f(696.0, 466.0);
glEnd();
// door
glColor3f(0.4, 0.4, 0.4);
glBegin(GL_POLYGON);
glVertex2f(536.0, 466.0);
glVertex2f(536.0, 522.0);
glVertex2f(572.0, 522.0);
glVertex2f(572.0, 466.0);
glEnd();
// window
glColor3f(0.6, 0.6, 0.6);
glBegin(GL_POLYGON);
glVertex2f(465.0, 575.0);
glVertex2f(465.0, 616.0);
glVertex2f(506.0, 616.0);
glVertex2f(506.0, 575.0);
glEnd();
glColor3f(0.6, 0.6, 0.6);
glBegin(GL_POLYGON);
glVertex2f(465.0, 769.0);
glVertex2f(465.0, 817.0);
glVertex2f(515.0, 817.0);
glVertex2f(515.0, 769.0);
glEnd();
glColor3f(0.6, 0.6, 0.6);
glBegin(GL_POLYGON);
glVertex2f(602.0, 679.0);
glVertex2f(602.0, 733.0);
glVertex2f(653.0, 733.0);
glVertex2f(653.0, 679.0);
glEnd();
}
void grass()
{
//this function has grass and houses below mud road
glColor3f(0.0, 1.0, 0.0);
glBegin(GL_POLYGON);
glVertex2f(0.0, 0.0);
glVertex2f(0.0, 379.0);
glVertex2f(1920.0, 379.0);
glVertex2f(1920.0, 0.0);
glEnd();
}
void houses()
{
//house 1
glColor3f(0.4f, 0.0f, 0.5f);
glBegin(GL_POLYGON);
glVertex2f(541.0, 295.0);
glVertex2f(541.0, 407.0);
glVertex2f(600.0, 335.0);
glVertex2f(600.0, 261.0);
glEnd();
glColor3f(1.0f, 0.5f, 0.0f);
glBegin(GL_POLYGON);
glVertex2f(600.0, 261.0);
glVertex2f(600.0, 335.0);
glVertex2f(753.0, 335.0);
glVertex2f(753.0, 261.0);
glEnd();
glColor3f(0.2f, 0.2f, 0.1f);
glBegin(GL_POLYGON);
glVertex2f(664.0, 261.0);
glVertex2f(664.0, 307.0);
glVertex2f(688.0, 307.0);
glVertex2f(688.0, 261.0);
glEnd();
glColor3f(0.0f, 0.0f, 0.6f);
glBegin(GL_POLYGON);
glVertex2f(595.0, 329.0);
glVertex2f(530.0, 411.0);
glVertex2f(709.0, 411.0);
glVertex2f(776.0, 329.0);
glEnd();
// house2
glColor3f(1.0f, 0.5f, 0.0f);
glBegin(GL_POLYGON);
glVertex2f(1437.0, 283.0);
glVertex2f(1437.0, 395.0);
glVertex2f(1496.0, 323.0);
glVertex2f(1496.0, 249.0);
glEnd();
glColor3f(0.4f, 0.0f, 0.5f);
glBegin(GL_POLYGON);
glVertex2f(1496.0, 249.0);
glVertex2f(1496.0, 323.0);
glVertex2f(1649.0, 323.0);
glVertex2f(1649.0, 249.0);
glEnd();
glColor3f(0.1f, 0.1f, 0.1f);
glBegin(GL_POLYGON);
glVertex2f(1560.0, 249.0);
glVertex2f(1560.0, 295.0);
glVertex2f(1584.0, 295.0);
glVertex2f(1584.0, 249.0);
glEnd();
glColor3f(0.0f, 0.0f, 0.6);
glBegin(GL_POLYGON);
glVertex2f(1491.0, 317.0);
glVertex2f(1426.0, 399.0);
glVertex2f(1605.0, 399.0);
glVertex2f(1672.0, 317.0);
glEnd();
}
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
if (flag == 0)
{
// glClear(GL_COLOR_BUFFER_BIT);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glColor3f(0.0, 1.0, 0.0);
//college name
glRasterPos3f(640, 735, 0);
for (i = 0; college[i] != '