├── img ├── stellite.png ├── data-transmit.png ├── smart-village.png ├── 2D-House-Project.JPG └── Chess-Board-Project.JPG ├── Box ├── obj │ └── Debug │ │ └── main.o ├── bin │ └── Debug │ │ └── Box.exe ├── Box.layout ├── main.cpp └── Box.cbp ├── CircleDraw ├── obj │ └── Debug │ │ └── main.o ├── bin │ └── Debug │ │ └── CircleDraw.exe ├── CircleDraw.layout ├── CircleDraw.cbp └── main.cpp ├── Basic-Shape ├── obj │ └── Debug │ │ └── main.o ├── bin │ └── Debug │ │ └── Basic-Shape.exe ├── Basic-Shape.layout ├── Basic-Shape.cbp └── main.cpp ├── House-Project ├── obj │ └── Debug │ │ └── main.o ├── bin │ └── Debug │ │ └── House-Project.exe ├── House-Project.layout ├── House-Project.cbp └── main.cpp ├── Moving_Object ├── obj │ └── Debug │ │ └── main.o ├── bin │ └── Debug │ │ └── moving_object.exe ├── Moving_Object.layout ├── Moving_Object.cbp └── main.cpp ├── Bresenham-Algorithm ├── obj │ └── Debug │ │ └── main.o ├── bin │ └── Debug │ │ └── Bresenham-Algorithm.exe ├── Bresenham-Algorithm.layout ├── Bresenham-Algorithm.cbp ├── main.cpp └── Bresenham-Algorithm.depend ├── Chess-Board-Project ├── obj │ └── Debug │ │ └── main.o ├── bin │ └── Debug │ │ └── Chess-Board-Project.exe ├── Chess-Board-Project.layout ├── Chess-Board-Project.cbp ├── main.cpp └── Chess-Board-Project.depend ├── Line-Drawing-Algorithm ├── obj │ └── Debug │ │ └── main.o ├── bin │ └── Debug │ │ └── Line-Drawing-Algorithm.exe ├── Line-Drawing-Algorithm.layout ├── Line-Drawing-Algorithm.cbp ├── main.cpp └── Line-Drawing-Algorithm.depend ├── Smart-Village-Project ├── obj │ └── Debug │ │ └── main.o ├── bin │ └── Debug │ │ └── Smart-Village.exe ├── Smart-Village.layout ├── Smart-Village.cbp ├── Smart-Village.depend └── main.cpp ├── Statelite-Station-Project ├── obj │ └── Debug │ │ └── main.o ├── bin │ └── Debug │ │ └── Statelite-Station.exe ├── Statelite-Station.layout ├── Statelite-Station.cbp ├── Statelite-Station.depend └── main.cpp ├── README.md └── LICENSE /img/stellite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/img/stellite.png -------------------------------------------------------------------------------- /Box/obj/Debug/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/Box/obj/Debug/main.o -------------------------------------------------------------------------------- /Box/bin/Debug/Box.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/Box/bin/Debug/Box.exe -------------------------------------------------------------------------------- /img/data-transmit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/img/data-transmit.png -------------------------------------------------------------------------------- /img/smart-village.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/img/smart-village.png -------------------------------------------------------------------------------- /img/2D-House-Project.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/img/2D-House-Project.JPG -------------------------------------------------------------------------------- /CircleDraw/obj/Debug/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/CircleDraw/obj/Debug/main.o -------------------------------------------------------------------------------- /img/Chess-Board-Project.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/img/Chess-Board-Project.JPG -------------------------------------------------------------------------------- /Basic-Shape/obj/Debug/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/Basic-Shape/obj/Debug/main.o -------------------------------------------------------------------------------- /House-Project/obj/Debug/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/House-Project/obj/Debug/main.o -------------------------------------------------------------------------------- /Moving_Object/obj/Debug/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/Moving_Object/obj/Debug/main.o -------------------------------------------------------------------------------- /CircleDraw/bin/Debug/CircleDraw.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/CircleDraw/bin/Debug/CircleDraw.exe -------------------------------------------------------------------------------- /Basic-Shape/bin/Debug/Basic-Shape.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/Basic-Shape/bin/Debug/Basic-Shape.exe -------------------------------------------------------------------------------- /Bresenham-Algorithm/obj/Debug/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/Bresenham-Algorithm/obj/Debug/main.o -------------------------------------------------------------------------------- /Chess-Board-Project/obj/Debug/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/Chess-Board-Project/obj/Debug/main.o -------------------------------------------------------------------------------- /Line-Drawing-Algorithm/obj/Debug/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/Line-Drawing-Algorithm/obj/Debug/main.o -------------------------------------------------------------------------------- /Smart-Village-Project/obj/Debug/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/Smart-Village-Project/obj/Debug/main.o -------------------------------------------------------------------------------- /House-Project/bin/Debug/House-Project.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/House-Project/bin/Debug/House-Project.exe -------------------------------------------------------------------------------- /Moving_Object/bin/Debug/moving_object.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/Moving_Object/bin/Debug/moving_object.exe -------------------------------------------------------------------------------- /Statelite-Station-Project/obj/Debug/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/Statelite-Station-Project/obj/Debug/main.o -------------------------------------------------------------------------------- /Smart-Village-Project/bin/Debug/Smart-Village.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/Smart-Village-Project/bin/Debug/Smart-Village.exe -------------------------------------------------------------------------------- /Bresenham-Algorithm/bin/Debug/Bresenham-Algorithm.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/Bresenham-Algorithm/bin/Debug/Bresenham-Algorithm.exe -------------------------------------------------------------------------------- /Chess-Board-Project/bin/Debug/Chess-Board-Project.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/Chess-Board-Project/bin/Debug/Chess-Board-Project.exe -------------------------------------------------------------------------------- /Statelite-Station-Project/bin/Debug/Statelite-Station.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/Statelite-Station-Project/bin/Debug/Statelite-Station.exe -------------------------------------------------------------------------------- /Line-Drawing-Algorithm/bin/Debug/Line-Drawing-Algorithm.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruhulaminparvez/OpenGL/HEAD/Line-Drawing-Algorithm/bin/Debug/Line-Drawing-Algorithm.exe -------------------------------------------------------------------------------- /Box/Box.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Basic-Shape/Basic-Shape.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CircleDraw/CircleDraw.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /House-Project/House-Project.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Moving_Object/Moving_Object.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Smart-Village-Project/Smart-Village.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Bresenham-Algorithm/Bresenham-Algorithm.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chess-Board-Project/Chess-Board-Project.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Line-Drawing-Algorithm/Line-Drawing-Algorithm.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Statelite-Station-Project/Statelite-Station.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenGL 2 | I will use this repo to put all my OpenGL projects here 🗳🍣 3 | 4 | ## Projects List: 5 | - [House Project](#house-preview) 6 | - [Chess Board Project](#chess-board-preview) 7 | - [Smart Village Project](#smart-village-preview) 8 | - [Statellite-Station Project](#statellite-station-preview) 9 | 10 | #### House Preview 11 | 12 | 13 | #### Chess Board Preview 14 | 15 | 16 | #### Smart Village Preview 17 | 18 | 19 | #### Statellite Station Preview 20 | 21 | ##### Statellite Station 22 | 23 | 24 | ##### Data Transmission 25 | 26 | 27 | ## Bugs 28 | > if there any known bugs found please let me know. Please enjoy and feel free to share your opinion, constructive criticism, or comments about my work. Email: 👉 ruhulaminparvez007@gmail.com 😊 Thank you! 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Ruhul Amin Parvez 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Box/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void display(void) 4 | { 5 | /* clear all pixels */ 6 | glClear (GL_COLOR_BUFFER_BIT); 7 | /* draw white polygon (rectangle) with corners at 8 | * (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0) 9 | */ 10 | glColor3f (1.0, 1.0, 1.0); 11 | 12 | 13 | glBegin(GL_QUADS); //Begin quadrilateral coordinates 14 | 15 | //Trapezoid 16 | glVertex3f(0.40f, 0.20f, 0.0f); 17 | glVertex3f(0.80f, 0.20f, 0.0f); 18 | glVertex3f(0.80f, 0.60f, 0.0f); 19 | glVertex3f(0.40f, 0.60f, 0.0f); 20 | 21 | glEnd(); //End quadrilateral coordinates 22 | 23 | glFlush (); 24 | } 25 | void init (void) 26 | { 27 | /* select clearing (background) color */ 28 | glClearColor (0.0, 0.0, 0.0, 0.0); 29 | /* initialize viewing values */ 30 | glMatrixMode(GL_PROJECTION); 31 | glLoadIdentity(); 32 | glOrtho(0.0, 1.0, 0.0, 1.0, -10.0, 10.0); 33 | } 34 | /* 35 | * Declare initial window size, position, and display mode 36 | * (single buffer and RGBA). Open window with "hello" 37 | * in its title bar. Call initialization routines. 38 | * Register callback function to display graphics. 39 | * Enter main loop and process events. 40 | */ 41 | int main(int argc, char** argv) 42 | { 43 | glutInit(&argc, argv); 44 | glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); 45 | glutInitWindowSize (600, 600); 46 | glutInitWindowPosition (100, 100); 47 | glutCreateWindow ("hello"); 48 | init (); 49 | glutDisplayFunc(display); 50 | glutMainLoop(); 51 | return 0; /* ISO C requires main to return int. */ 52 | } 53 | -------------------------------------------------------------------------------- /Box/Box.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 51 | 52 | -------------------------------------------------------------------------------- /CircleDraw/CircleDraw.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 51 | 52 | -------------------------------------------------------------------------------- /Basic-Shape/Basic-Shape.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 51 | 52 | -------------------------------------------------------------------------------- /House-Project/House-Project.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 51 | 52 | -------------------------------------------------------------------------------- /Moving_Object/Moving_Object.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 51 | 52 | -------------------------------------------------------------------------------- /Smart-Village-Project/Smart-Village.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 51 | 52 | -------------------------------------------------------------------------------- /Statelite-Station-Project/Statelite-Station.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 51 | 52 | -------------------------------------------------------------------------------- /Bresenham-Algorithm/Bresenham-Algorithm.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 51 | 52 | -------------------------------------------------------------------------------- /Chess-Board-Project/Chess-Board-Project.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 51 | 52 | -------------------------------------------------------------------------------- /Line-Drawing-Algorithm/Line-Drawing-Algorithm.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 51 | 52 | -------------------------------------------------------------------------------- /Basic-Shape/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void display(void) 4 | { 5 | /* clear all pixels */ 6 | glClear (GL_COLOR_BUFFER_BIT); 7 | /* draw white polygon (rectangle) with corners at 8 | * (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0) 9 | */ 10 | glColor3f (1.0, 1.0, 1.0); 11 | 12 | 13 | glBegin(GL_QUADS); //Begin quadrilateral coordinates 14 | 15 | //Trapezoid 16 | glVertex3f(0.05f, 0.05f, 0.0f); 17 | glVertex3f(0.35f, 0.05f, 0.0f); 18 | glVertex3f(0.40f, 0.35f, 0.0f); 19 | glVertex3f(0.00f, 0.35f, 0.0f); 20 | 21 | glEnd(); //End quadrilateral coordinates 22 | 23 | glBegin(GL_TRIANGLES); //Begin triangle coordinates 24 | 25 | //Triangle 26 | glVertex3f(0.30f, 0.65f, 0.0f); 27 | glVertex3f(0.60f, 0.65f, 0.0f); 28 | glVertex3f(0.45, 0.85f, 0.0f); 29 | 30 | glEnd();//End triangle coordinates 31 | /* don't wait! 32 | * start processing buffered OpenGL routines 33 | */ 34 | glFlush (); 35 | } 36 | void init (void) 37 | { 38 | /* select clearing (background) color */ 39 | glClearColor (0.0, 0.0, 0.0, 0.0); 40 | /* initialize viewing values */ 41 | glMatrixMode(GL_PROJECTION); 42 | glLoadIdentity(); 43 | glOrtho(0.0, 1.0, 0.0, 1.0, -10.0, 10.0); 44 | } 45 | /* 46 | * Declare initial window size, position, and display mode 47 | * (single buffer and RGBA). Open window with "hello" 48 | * in its title bar. Call initialization routines. 49 | * Register callback function to display graphics. 50 | * Enter main loop and process events. 51 | */ 52 | int main(int argc, char** argv) 53 | { 54 | glutInit(&argc, argv); 55 | glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); 56 | glutInitWindowSize (600, 600); 57 | glutInitWindowPosition (100, 100); 58 | glutCreateWindow ("hello"); 59 | init (); 60 | glutDisplayFunc(display); 61 | glutMainLoop(); 62 | return 0; /* ISO C requires main to return int. */ 63 | } 64 | -------------------------------------------------------------------------------- /Bresenham-Algorithm/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | float x1,y1,x2,y2,m,i,j,p; 5 | int dx,dy; 6 | void display(void) 7 | { 8 | glClear (GL_COLOR_BUFFER_BIT); 9 | 10 | glColor3f (1.0, 0.0, 0.0); 11 | glBegin(GL_POINTS); 12 | 13 | p=(2*dy)-dx; 14 | 15 | for(i=x1, j=y1; iy2; ) 16 | { 17 | if(p>=0) 18 | { 19 | i=i+1; 20 | j=j+1; 21 | 22 | printf("\tValue of X1 : %0.2f && Value of Y1: %0.2f\n",i,j); 23 | glVertex3f ((i), (j), 0.0); 24 | p=p+(2*dy)-(2*dx); 25 | } 26 | else if(p<0) 27 | { 28 | i=i+1; 29 | if(i>x2) 30 | { 31 | break; 32 | } 33 | printf("\tValue of X1 : %0.2f && Value of Y1: %0.2f\n",i,j); 34 | glVertex3f (i,j, 0.0); 35 | p=p+(2*dy); 36 | 37 | } 38 | } 39 | glEnd(); 40 | 41 | glFlush (); 42 | } 43 | void init (void) 44 | { 45 | 46 | glClearColor (1.0, 1.0, 1.0, 1.0); 47 | 48 | glMatrixMode(GL_PROJECTION); 49 | glLoadIdentity(); 50 | glOrtho(0.0, 400, 0.0, 400.0,-400.0,400.0); 51 | } 52 | 53 | 54 | int main(int argc, char** argv) 55 | { 56 | printf("Enter first point X1: "); 57 | scanf("%f",&x1); 58 | printf("Enter first point Y1: "); 59 | scanf("%f",&y1); 60 | 61 | printf("Enter End point X2: "); 62 | scanf("%f",&x2); 63 | printf("Enter End point Y1: "); 64 | scanf("%f",&y2); 65 | dx=x2-x1; 66 | dy=y2-y1; 67 | printf("Show dx: %d\n",dx); 68 | printf("Show dy: %d\n",dy); 69 | 70 | glutInit(&argc, argv); 71 | glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); 72 | glutInitWindowSize (800, 700); 73 | glutInitWindowPosition (500, 100); 74 | glutCreateWindow ("Bresenham Line Drawing Algorithm (Task-3)"); 75 | init (); 76 | glutDisplayFunc(display); 77 | glutMainLoop(); 78 | return 0; 79 | } 80 | 81 | -------------------------------------------------------------------------------- /Chess-Board-Project/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void init(void) 5 | { 6 | glClearColor(1.0, 1.0, 1.0, 0.0); 7 | glColor3f(0.0f, 0.0f, 0.0f); 8 | glPointSize(4.0); 9 | glMatrixMode(GL_PROJECTION); 10 | glLoadIdentity(); 11 | gluOrtho2D(0.0, 640.0, 0.0, 480.0); 12 | } 13 | 14 | int x = 50, y = 50; 15 | bool isBlack = true; 16 | 17 | void whiteBox(int x, int y) 18 | { 19 | glBegin(GL_LINE_LOOP); 20 | glVertex2i(x, y); 21 | glVertex2i(x, y + 50); 22 | glVertex2i(x + 50, y + 50); 23 | glVertex2i(x + 50, y); 24 | glEnd(); 25 | } 26 | 27 | void blackBox(int x, int y) 28 | { 29 | glBegin(GL_POLYGON); 30 | glVertex2i(x, y); 31 | glVertex2i(x, y + 50); 32 | glVertex2i(x + 50, y + 50); 33 | glVertex2i(x + 50, y); 34 | glEnd(); 35 | } 36 | 37 | void myDisplay(void) 38 | { 39 | glClear(GL_COLOR_BUFFER_BIT); 40 | glColor3f(0.0, 0.0, 0.0); 41 | glPointSize(1.0); 42 | 43 | for (int i = 0; i < 8; i++) 44 | { 45 | if (i % 2 == 0) 46 | { 47 | isBlack = true; 48 | } 49 | else 50 | { 51 | isBlack = false; 52 | } 53 | 54 | for (int j = 0; j < 8; j++) 55 | { 56 | if (isBlack) 57 | { 58 | blackBox(x, y); 59 | isBlack = false; 60 | } 61 | else 62 | { 63 | whiteBox(x, y); 64 | isBlack = true; 65 | } 66 | x += 50; 67 | } 68 | y += 50; 69 | x = 50; 70 | } 71 | 72 | blackBox(100, 100); 73 | whiteBox(150, 100); 74 | glFlush(); 75 | } 76 | 77 | 78 | int main(int argc, char* argv[]) 79 | { 80 | glutInit(&argc, argv); // Initalise GLUT 81 | glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB); // Set display mode 82 | 83 | glutInitWindowPosition(80, 100); // Set window position 84 | glutInitWindowSize(900, 700); // Set window size 85 | glutCreateWindow("Chess Board Project"); // Create display window 86 | 87 | init(); // Execute initialisation procedure 88 | glutDisplayFunc(myDisplay);// Send graphics to display window 89 | glutMainLoop(); // Display everything and wait 90 | 91 | return 0; 92 | } 93 | 94 | -------------------------------------------------------------------------------- /Line-Drawing-Algorithm/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | float x1,y1,x2,y2,m,i,j; 5 | float dx,dy; 6 | void display(void) 7 | { 8 | 9 | glClear (GL_COLOR_BUFFER_BIT); 10 | 11 | glEnd(); 12 | 13 | glColor3f (1.0, 0.0, 0.0); 14 | glBegin(GL_POINTS); 15 | 16 | 17 | if(m>0 && m<=1) 18 | { 19 | while(x1<=x2 && y1<=y2) 20 | { 21 | x1=x1+1; 22 | y1=y1+m; 23 | glVertex3f(x1/100,y1/100,0.0); 24 | printf("%f %f",x1,y1); 25 | 26 | } 27 | } 28 | else if(m>1) 29 | { 30 | while(x1<=x2 && y1<=y2) 31 | { 32 | x1=x1+(1/m); 33 | y1=y1+1; 34 | glVertex3f(x1/100,y1/100,0.0); 35 | printf("%f %f",x1,y1); 36 | } 37 | } 38 | 39 | else if(m>-1 && m<=0) 40 | { 41 | while(x1>=x2 && y1>=y2) 42 | { 43 | x1=x1-1; 44 | y1=y1-m; 45 | glVertex3f(x1/100,y1/100,0.0); 46 | printf("%f %f",x1,y1); 47 | } 48 | } 49 | else if(m<-1) 50 | 51 | { 52 | 53 | while(x1>=x2 && y1>=y2) 54 | { 55 | x1=x1-(1/m); 56 | y1=y1-1; 57 | glVertex3f(x1/100,y1/100,0.0); 58 | printf("%f %f",x1,y1); 59 | } 60 | } 61 | 62 | glEnd(); 63 | 64 | glFlush (); 65 | } 66 | void init (void) 67 | { 68 | glClearColor (1.0, 1.0, 1.0, 0.0); 69 | 70 | glMatrixMode(GL_PROJECTION); 71 | glLoadIdentity(); 72 | glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0); 73 | } 74 | 75 | int main(int argc, char** argv) 76 | { 77 | 78 | printf("Enter value of X1 :"); 79 | scanf("%f",&x1); 80 | printf("Enter value of y1 :"); 81 | scanf("%f",&y1); 82 | printf("Enter value of X2 :"); 83 | scanf("%f",&x2); 84 | printf("Enter value of Y2 :"); 85 | scanf("%f",&y2); 86 | dx=x2-x1; 87 | dy=y2-y1; 88 | m=dy/dx; 89 | 90 | 91 | glutInit(&argc, argv); 92 | glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); 93 | glutInitWindowSize (500, 500); 94 | glutInitWindowPosition (100, 100); 95 | glutCreateWindow ("Line Draw Algorithm"); 96 | init (); 97 | glutDisplayFunc(display); 98 | glutMainLoop(); 99 | return 0; 100 | } 101 | -------------------------------------------------------------------------------- /House-Project/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void init(void) 5 | { 6 | glClearColor(1.0, 1.0, 1.0, 0.0); // Set display window colour to white 7 | 8 | glMatrixMode(GL_PROJECTION); // Set projection parameters 9 | gluOrtho2D(0.0, 400.0, 0.0, 400.0); 10 | } 11 | 12 | void drawShapes(void) 13 | { 14 | glClear(GL_COLOR_BUFFER_BIT); // Clear display window 15 | 16 | //Set colour to black 17 | glColor3f(0.0, 0.0, 0.0); 18 | //Adjust the point size 19 | glPointSize(5.0); 20 | 21 | //Set colour to red 22 | glColor3f(1.0, 0.0, 0.0); 23 | 24 | // Draw an outlined triangle 25 | glBegin(GL_TRIANGLES); 26 | 27 | glColor3f(0.0, 0.0, 1.0); 28 | glVertex2i(100, 200); 29 | glVertex2i(300, 200); 30 | glVertex2i(200, 300); 31 | 32 | glEnd(); 33 | 34 | glBegin(GL_POLYGON); 35 | 36 | glColor3f(1.0, 0.0, 0.0); 37 | glVertex2i(100, 0); 38 | glVertex2i(300, 0); 39 | glVertex2i(300, 200); 40 | glVertex2i(100, 200); 41 | 42 | glEnd(); 43 | 44 | glBegin(GL_POLYGON); 45 | 46 | glColor3f(0.0, 1.0, 0.0); 47 | glVertex2i(175, 0); 48 | glVertex2i(225, 0); 49 | glVertex2i(225, 150); 50 | glVertex2i(175, 150); 51 | 52 | glEnd(); 53 | 54 | glBegin(GL_POLYGON); 55 | 56 | glColor3f(1.0, 1.0, 1.0); 57 | glVertex2i(125, 50); 58 | glVertex2i(150, 50); 59 | glVertex2i(150, 125); 60 | glVertex2i(125, 125); 61 | 62 | glEnd(); 63 | 64 | glBegin(GL_POLYGON); 65 | 66 | glColor3f(1.0, 1.0, 1.0); 67 | glVertex2i(250, 50); 68 | glVertex2i(275, 50); 69 | glVertex2i(275, 125); 70 | glVertex2i(250, 125); 71 | 72 | glEnd(); 73 | 74 | glFlush(); // Process all OpenGL routines 75 | } 76 | 77 | int main(int argc, char* argv[]) 78 | { 79 | glutInit(&argc, argv); // Initalise GLUT 80 | glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB); // Set display mode 81 | 82 | glutInitWindowPosition(50, 100); // Set window position 83 | glutInitWindowSize(800, 600); // Set window size 84 | glutCreateWindow("House Making Project"); // Create display window 85 | 86 | init(); // Execute initialisation procedure 87 | glutDisplayFunc(drawShapes); // Send graphics to display window 88 | glutMainLoop(); // Display everything and wait 89 | 90 | return 0; 91 | } 92 | 93 | 94 | -------------------------------------------------------------------------------- /Moving_Object/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #ifdef __APPLE__ 7 | #include 8 | #include 9 | #else 10 | #include 11 | #endif 12 | 13 | using namespace std; 14 | 15 | float ballX = -0.3f; 16 | float ballY = 0.0f; 17 | float ballZ = -1.0f; 18 | 19 | static int flag=1; 20 | 21 | void drawBall(void) { 22 | 23 | glColor3f(0.0, 0.0, 1.0); 24 | glTranslatef(ballX,ballY,ballZ); 25 | glutSolidSphere (0.1, 10, 10); 26 | 27 | } 28 | 29 | void keyPress(int key, int x, int y) 30 | { 31 | if(key==GLUT_KEY_RIGHT) 32 | ballX -= 0.05f; 33 | if(key==GLUT_KEY_LEFT) 34 | ballX += 0.05f; 35 | 36 | glutPostRedisplay(); 37 | } 38 | 39 | void initRendering() 40 | { 41 | glEnable(GL_DEPTH_TEST); 42 | } 43 | 44 | 45 | void handleResize(int w, int h) { 46 | 47 | glViewport(0, 0, w, h); 48 | 49 | glMatrixMode(GL_PROJECTION); 50 | 51 | 52 | glLoadIdentity(); 53 | gluPerspective(45.0, 54 | (double)w / (double)h, 55 | 1.0, 56 | 200.0); 57 | } 58 | 59 | void drawScene() 60 | { 61 | glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 62 | 63 | glMatrixMode(GL_MODELVIEW); 64 | 65 | glLoadIdentity(); 66 | drawBall(); 67 | 68 | 69 | glutSwapBuffers(); 70 | } 71 | 72 | 73 | void update(int value) { 74 | if(flag) 75 | { 76 | ballX += 0.001f; 77 | if(ballX>0.3) 78 | { 79 | flag=0; 80 | 81 | } 82 | } 83 | if (!flag) 84 | { 85 | ballX -= 0.001f; 86 | if(ballX<-0.3) 87 | { 88 | flag=1; 89 | 90 | } 91 | } 92 | 93 | glutPostRedisplay(); 94 | 95 | 96 | glutTimerFunc(25, update, 0); 97 | } 98 | 99 | int main(int argc,char** argv) 100 | { 101 | glutInit(&argc,argv); 102 | 103 | glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB|GLUT_DEPTH); 104 | 105 | glutInitWindowSize(600,600); 106 | 107 | glutCreateWindow("Moving Object"); 108 | 109 | initRendering(); 110 | 111 | glutDisplayFunc(drawScene); 112 | 113 | glutSpecialFunc(keyPress); 114 | glutReshapeFunc(handleResize); 115 | 116 | 117 | glutTimerFunc(25, update, 0); 118 | 119 | glutMainLoop(); 120 | 121 | return(0); 122 | } 123 | -------------------------------------------------------------------------------- /CircleDraw/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | float x=0,y,p,xc,yc; 6 | int r; 7 | 8 | void circleDraw(void) 9 | { 10 | glClear (GL_COLOR_BUFFER_BIT); 11 | 12 | 13 | glBegin(GL_POINTS); 14 | 15 | printf("Starting point(x,y) : %0.2f , %0.2f \n",x,y); 16 | 17 | p=1-r; 18 | printf("Initial Decision Parameter: %0.2f \n",p); 19 | printf("\n"); 20 | 21 | while((x 4 | 5 | 6 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\windows.h 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winresrc.h 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winuser.h 45 | 46 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winnt.h 47 | 48 | 49 | 50 | 51 | 52 | 53 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winerror.h 54 | 55 | 1250308680 c:\program files (x86)\codeblocks\mingw\include\string.h 56 | <_mingw.h> 57 | 58 | 59 | 1250308674 c:\program files (x86)\codeblocks\mingw\include\_mingw.h 60 | 61 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\basetsd.h 62 | 63 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\pshpack4.h 64 | 65 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\poppack.h 66 | 67 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winver.h 68 | 69 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\dde.h 70 | 71 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\dlgs.h 72 | 73 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\commctrl.h 74 | 75 | 76 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\prsht.h 77 | 78 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\windef.h 79 | 80 | 81 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\wincon.h 82 | 83 | 1228530730 c:\program files (x86)\codeblocks\mingw\include\winbase.h 84 | 85 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\wingdi.h 86 | 87 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winnls.h 88 | 89 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winnetwk.h 90 | 91 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winreg.h 92 | 93 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winsvc.h 94 | 95 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\cderr.h 96 | 97 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\ddeml.h 98 | 99 | 1228530716 c:\program files (x86)\codeblocks\mingw\include\imm.h 100 | 101 | 1228530720 c:\program files (x86)\codeblocks\mingw\include\lzexpand.h 102 | 103 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\mmsystem.h 104 | 105 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\nb30.h 106 | 107 | 1228530726 c:\program files (x86)\codeblocks\mingw\include\rpc.h 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 1228530726 c:\program files (x86)\codeblocks\mingw\include\rpcdce.h 116 | 117 | 118 | 119 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\basetyps.h 120 | 121 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcdcep.h 122 | 123 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcnsi.h 124 | 125 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcnterr.h 126 | 127 | 1250308676 c:\program files (x86)\codeblocks\mingw\include\excpt.h 128 | <_mingw.h> 129 | 130 | 131 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\shellapi.h 132 | 133 | 134 | 135 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\pshpack2.h 136 | 137 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winperf.h 138 | 139 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\commdlg.h 140 | 141 | 142 | 143 | 1228530730 c:\program files (x86)\codeblocks\mingw\include\unknwn.h 144 | 145 | 146 | 147 | 148 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\objfwd.h 149 | 150 | 151 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\wtypes.h 152 | 153 | 154 | 155 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcndr.h 156 | 157 | 158 | 159 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcnsip.h 160 | 161 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winspool.h 162 | 163 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winsock2.h 164 | 165 | 166 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winsock.h 167 | 168 | 169 | 170 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\mswsock.h 171 | 172 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\ole2.h 173 | 174 | 175 | 176 | 177 | 178 | 179 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\objbase.h 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 1250308680 c:\program files (x86)\codeblocks\mingw\include\stdlib.h 190 | <_mingw.h> 191 | 192 | 193 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\objidl.h 194 | 195 | 196 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\cguid.h 197 | 198 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\olectlid.h 199 | 200 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\oleauto.h 201 | 202 | 203 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\oaidl.h 204 | 205 | 206 | 207 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\oleidl.h 208 | 209 | 210 | 1453865572 c:\program files (x86)\codeblocks\mingw\include\gl\glut.h 211 | 212 | 213 | 214 | 215 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\gl\gl.h 216 | 217 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\gl\glu.h 218 | 219 | 220 | 221 | -------------------------------------------------------------------------------- /Bresenham-Algorithm/Bresenham-Algorithm.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1626368109 source:c:\users\dcl\documents\opengl\bresenham-algorithm\main.cpp 3 | 4 | 5 | 6 | 7 | 1250308680 c:\program files (x86)\codeblocks\mingw\include\stdio.h 8 | <_mingw.h> 9 | 10 | 11 | 12 | 13 | 1250308674 c:\program files (x86)\codeblocks\mingw\include\_mingw.h 14 | 15 | 1250308682 c:\program files (x86)\codeblocks\mingw\include\sys\types.h 16 | <_mingw.h> 17 | 18 | 19 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\gl\gl.h 20 | 21 | 1626342068 c:\program files (x86)\codeblocks\mingw\include\gl\glut.h 22 | 23 | 24 | 25 | 26 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\windows.h 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winresrc.h 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winuser.h 65 | 66 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winnt.h 67 | 68 | 69 | 70 | 71 | 72 | 73 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winerror.h 74 | 75 | 1250308680 c:\program files (x86)\codeblocks\mingw\include\string.h 76 | <_mingw.h> 77 | 78 | 79 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\basetsd.h 80 | 81 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\pshpack4.h 82 | 83 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\poppack.h 84 | 85 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winver.h 86 | 87 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\dde.h 88 | 89 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\dlgs.h 90 | 91 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\commctrl.h 92 | 93 | 94 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\prsht.h 95 | 96 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\windef.h 97 | 98 | 99 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\wincon.h 100 | 101 | 1228530730 c:\program files (x86)\codeblocks\mingw\include\winbase.h 102 | 103 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\wingdi.h 104 | 105 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winnls.h 106 | 107 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winnetwk.h 108 | 109 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winreg.h 110 | 111 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winsvc.h 112 | 113 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\cderr.h 114 | 115 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\ddeml.h 116 | 117 | 1228530716 c:\program files (x86)\codeblocks\mingw\include\imm.h 118 | 119 | 1228530720 c:\program files (x86)\codeblocks\mingw\include\lzexpand.h 120 | 121 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\mmsystem.h 122 | 123 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\nb30.h 124 | 125 | 1228530726 c:\program files (x86)\codeblocks\mingw\include\rpc.h 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 1228530726 c:\program files (x86)\codeblocks\mingw\include\rpcdce.h 134 | 135 | 136 | 137 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\basetyps.h 138 | 139 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcdcep.h 140 | 141 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcnsi.h 142 | 143 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcnterr.h 144 | 145 | 1250308676 c:\program files (x86)\codeblocks\mingw\include\excpt.h 146 | <_mingw.h> 147 | 148 | 149 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\shellapi.h 150 | 151 | 152 | 153 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\pshpack2.h 154 | 155 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winperf.h 156 | 157 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\commdlg.h 158 | 159 | 160 | 161 | 1228530730 c:\program files (x86)\codeblocks\mingw\include\unknwn.h 162 | 163 | 164 | 165 | 166 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\objfwd.h 167 | 168 | 169 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\wtypes.h 170 | 171 | 172 | 173 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcndr.h 174 | 175 | 176 | 177 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcnsip.h 178 | 179 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winspool.h 180 | 181 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winsock2.h 182 | 183 | 184 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winsock.h 185 | 186 | 187 | 188 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\mswsock.h 189 | 190 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\ole2.h 191 | 192 | 193 | 194 | 195 | 196 | 197 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\objbase.h 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 1250308680 c:\program files (x86)\codeblocks\mingw\include\stdlib.h 208 | <_mingw.h> 209 | 210 | 211 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\objidl.h 212 | 213 | 214 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\cguid.h 215 | 216 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\olectlid.h 217 | 218 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\oleauto.h 219 | 220 | 221 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\oaidl.h 222 | 223 | 224 | 225 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\oleidl.h 226 | 227 | 228 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\gl\glu.h 229 | 230 | 231 | 232 | -------------------------------------------------------------------------------- /Line-Drawing-Algorithm/Line-Drawing-Algorithm.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1626296223 source:c:\users\dcl\documents\opengl\line-drawing-algorithm\main.cpp 3 | 4 | 5 | 6 | 7 | 1250308680 c:\program files (x86)\codeblocks\mingw\include\stdio.h 8 | <_mingw.h> 9 | 10 | 11 | 12 | 13 | 1250308674 c:\program files (x86)\codeblocks\mingw\include\_mingw.h 14 | 15 | 1250308682 c:\program files (x86)\codeblocks\mingw\include\sys\types.h 16 | <_mingw.h> 17 | 18 | 19 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\gl\gl.h 20 | 21 | 1453865572 c:\program files (x86)\codeblocks\mingw\include\gl\glut.h 22 | 23 | 24 | 25 | 26 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\windows.h 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winresrc.h 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winuser.h 65 | 66 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winnt.h 67 | 68 | 69 | 70 | 71 | 72 | 73 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winerror.h 74 | 75 | 1250308680 c:\program files (x86)\codeblocks\mingw\include\string.h 76 | <_mingw.h> 77 | 78 | 79 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\basetsd.h 80 | 81 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\pshpack4.h 82 | 83 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\poppack.h 84 | 85 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winver.h 86 | 87 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\dde.h 88 | 89 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\dlgs.h 90 | 91 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\commctrl.h 92 | 93 | 94 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\prsht.h 95 | 96 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\windef.h 97 | 98 | 99 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\wincon.h 100 | 101 | 1228530730 c:\program files (x86)\codeblocks\mingw\include\winbase.h 102 | 103 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\wingdi.h 104 | 105 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winnls.h 106 | 107 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winnetwk.h 108 | 109 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winreg.h 110 | 111 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winsvc.h 112 | 113 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\cderr.h 114 | 115 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\ddeml.h 116 | 117 | 1228530716 c:\program files (x86)\codeblocks\mingw\include\imm.h 118 | 119 | 1228530720 c:\program files (x86)\codeblocks\mingw\include\lzexpand.h 120 | 121 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\mmsystem.h 122 | 123 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\nb30.h 124 | 125 | 1228530726 c:\program files (x86)\codeblocks\mingw\include\rpc.h 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 1228530726 c:\program files (x86)\codeblocks\mingw\include\rpcdce.h 134 | 135 | 136 | 137 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\basetyps.h 138 | 139 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcdcep.h 140 | 141 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcnsi.h 142 | 143 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcnterr.h 144 | 145 | 1250308676 c:\program files (x86)\codeblocks\mingw\include\excpt.h 146 | <_mingw.h> 147 | 148 | 149 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\shellapi.h 150 | 151 | 152 | 153 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\pshpack2.h 154 | 155 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winperf.h 156 | 157 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\commdlg.h 158 | 159 | 160 | 161 | 1228530730 c:\program files (x86)\codeblocks\mingw\include\unknwn.h 162 | 163 | 164 | 165 | 166 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\objfwd.h 167 | 168 | 169 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\wtypes.h 170 | 171 | 172 | 173 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcndr.h 174 | 175 | 176 | 177 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcnsip.h 178 | 179 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winspool.h 180 | 181 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winsock2.h 182 | 183 | 184 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winsock.h 185 | 186 | 187 | 188 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\mswsock.h 189 | 190 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\ole2.h 191 | 192 | 193 | 194 | 195 | 196 | 197 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\objbase.h 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 1250308680 c:\program files (x86)\codeblocks\mingw\include\stdlib.h 208 | <_mingw.h> 209 | 210 | 211 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\objidl.h 212 | 213 | 214 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\cguid.h 215 | 216 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\olectlid.h 217 | 218 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\oleauto.h 219 | 220 | 221 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\oaidl.h 222 | 223 | 224 | 225 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\oleidl.h 226 | 227 | 228 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\gl\glu.h 229 | 230 | 231 | 232 | -------------------------------------------------------------------------------- /Smart-Village-Project/Smart-Village.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1629532052 source:c:\users\dcl\documents\opengl\smart-village\main.cpp 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\windows.h 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winresrc.h 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winuser.h 49 | 50 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winnt.h 51 | 52 | 53 | 54 | 55 | 56 | 57 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winerror.h 58 | 59 | 1250308680 c:\program files (x86)\codeblocks\mingw\include\string.h 60 | <_mingw.h> 61 | 62 | 63 | 1250308674 c:\program files (x86)\codeblocks\mingw\include\_mingw.h 64 | 65 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\basetsd.h 66 | 67 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\pshpack4.h 68 | 69 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\poppack.h 70 | 71 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winver.h 72 | 73 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\dde.h 74 | 75 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\dlgs.h 76 | 77 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\commctrl.h 78 | 79 | 80 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\prsht.h 81 | 82 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\windef.h 83 | 84 | 85 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\wincon.h 86 | 87 | 1228530730 c:\program files (x86)\codeblocks\mingw\include\winbase.h 88 | 89 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\wingdi.h 90 | 91 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winnls.h 92 | 93 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winnetwk.h 94 | 95 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winreg.h 96 | 97 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winsvc.h 98 | 99 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\cderr.h 100 | 101 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\ddeml.h 102 | 103 | 1228530716 c:\program files (x86)\codeblocks\mingw\include\imm.h 104 | 105 | 1228530720 c:\program files (x86)\codeblocks\mingw\include\lzexpand.h 106 | 107 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\mmsystem.h 108 | 109 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\nb30.h 110 | 111 | 1228530726 c:\program files (x86)\codeblocks\mingw\include\rpc.h 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 1228530726 c:\program files (x86)\codeblocks\mingw\include\rpcdce.h 120 | 121 | 122 | 123 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\basetyps.h 124 | 125 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcdcep.h 126 | 127 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcnsi.h 128 | 129 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcnterr.h 130 | 131 | 1250308676 c:\program files (x86)\codeblocks\mingw\include\excpt.h 132 | <_mingw.h> 133 | 134 | 135 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\shellapi.h 136 | 137 | 138 | 139 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\pshpack2.h 140 | 141 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winperf.h 142 | 143 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\commdlg.h 144 | 145 | 146 | 147 | 1228530730 c:\program files (x86)\codeblocks\mingw\include\unknwn.h 148 | 149 | 150 | 151 | 152 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\objfwd.h 153 | 154 | 155 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\wtypes.h 156 | 157 | 158 | 159 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcndr.h 160 | 161 | 162 | 163 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcnsip.h 164 | 165 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winspool.h 166 | 167 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winsock2.h 168 | 169 | 170 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winsock.h 171 | 172 | 173 | 174 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\mswsock.h 175 | 176 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\ole2.h 177 | 178 | 179 | 180 | 181 | 182 | 183 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\objbase.h 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 1250308680 c:\program files (x86)\codeblocks\mingw\include\stdlib.h 194 | <_mingw.h> 195 | 196 | 197 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\objidl.h 198 | 199 | 200 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\cguid.h 201 | 202 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\olectlid.h 203 | 204 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\oleauto.h 205 | 206 | 207 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\oaidl.h 208 | 209 | 210 | 211 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\oleidl.h 212 | 213 | 214 | 1626342068 c:\program files (x86)\codeblocks\mingw\include\gl\glut.h 215 | 216 | 217 | 218 | 219 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\gl\gl.h 220 | 221 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\gl\glu.h 222 | 223 | 224 | 225 | 1250308678 c:\program files (x86)\codeblocks\mingw\include\math.h 226 | <_mingw.h> 227 | 228 | 1250308680 c:\program files (x86)\codeblocks\mingw\include\stdio.h 229 | <_mingw.h> 230 | 231 | 232 | 233 | 234 | 1250308682 c:\program files (x86)\codeblocks\mingw\include\sys\types.h 235 | <_mingw.h> 236 | 237 | 238 | -------------------------------------------------------------------------------- /Statelite-Station-Project/Statelite-Station.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1629016659 source:c:\users\dcl\documents\opengl\statelite-station\main.cpp 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\windows.h 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winresrc.h 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winuser.h 49 | 50 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winnt.h 51 | 52 | 53 | 54 | 55 | 56 | 57 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winerror.h 58 | 59 | 1250308680 c:\program files (x86)\codeblocks\mingw\include\string.h 60 | <_mingw.h> 61 | 62 | 63 | 1250308674 c:\program files (x86)\codeblocks\mingw\include\_mingw.h 64 | 65 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\basetsd.h 66 | 67 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\pshpack4.h 68 | 69 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\poppack.h 70 | 71 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winver.h 72 | 73 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\dde.h 74 | 75 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\dlgs.h 76 | 77 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\commctrl.h 78 | 79 | 80 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\prsht.h 81 | 82 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\windef.h 83 | 84 | 85 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\wincon.h 86 | 87 | 1228530730 c:\program files (x86)\codeblocks\mingw\include\winbase.h 88 | 89 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\wingdi.h 90 | 91 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winnls.h 92 | 93 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winnetwk.h 94 | 95 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winreg.h 96 | 97 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winsvc.h 98 | 99 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\cderr.h 100 | 101 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\ddeml.h 102 | 103 | 1228530716 c:\program files (x86)\codeblocks\mingw\include\imm.h 104 | 105 | 1228530720 c:\program files (x86)\codeblocks\mingw\include\lzexpand.h 106 | 107 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\mmsystem.h 108 | 109 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\nb30.h 110 | 111 | 1228530726 c:\program files (x86)\codeblocks\mingw\include\rpc.h 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 1228530726 c:\program files (x86)\codeblocks\mingw\include\rpcdce.h 120 | 121 | 122 | 123 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\basetyps.h 124 | 125 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcdcep.h 126 | 127 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcnsi.h 128 | 129 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcnterr.h 130 | 131 | 1250308676 c:\program files (x86)\codeblocks\mingw\include\excpt.h 132 | <_mingw.h> 133 | 134 | 135 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\shellapi.h 136 | 137 | 138 | 139 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\pshpack2.h 140 | 141 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winperf.h 142 | 143 | 1228530714 c:\program files (x86)\codeblocks\mingw\include\commdlg.h 144 | 145 | 146 | 147 | 1228530730 c:\program files (x86)\codeblocks\mingw\include\unknwn.h 148 | 149 | 150 | 151 | 152 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\objfwd.h 153 | 154 | 155 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\wtypes.h 156 | 157 | 158 | 159 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcndr.h 160 | 161 | 162 | 163 | 1228530728 c:\program files (x86)\codeblocks\mingw\include\rpcnsip.h 164 | 165 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winspool.h 166 | 167 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\winsock2.h 168 | 169 | 170 | 1228530732 c:\program files (x86)\codeblocks\mingw\include\winsock.h 171 | 172 | 173 | 174 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\mswsock.h 175 | 176 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\ole2.h 177 | 178 | 179 | 180 | 181 | 182 | 183 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\objbase.h 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 1250308680 c:\program files (x86)\codeblocks\mingw\include\stdlib.h 194 | <_mingw.h> 195 | 196 | 197 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\objidl.h 198 | 199 | 200 | 1228530712 c:\program files (x86)\codeblocks\mingw\include\cguid.h 201 | 202 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\olectlid.h 203 | 204 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\oleauto.h 205 | 206 | 207 | 1228530722 c:\program files (x86)\codeblocks\mingw\include\oaidl.h 208 | 209 | 210 | 211 | 1228530724 c:\program files (x86)\codeblocks\mingw\include\oleidl.h 212 | 213 | 214 | 1250308680 c:\program files (x86)\codeblocks\mingw\include\stdio.h 215 | <_mingw.h> 216 | 217 | 218 | 219 | 220 | 1250308682 c:\program files (x86)\codeblocks\mingw\include\sys\types.h 221 | <_mingw.h> 222 | 223 | 224 | 1626342068 c:\program files (x86)\codeblocks\mingw\include\gl\glut.h 225 | 226 | 227 | 228 | 229 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\gl\gl.h 230 | 231 | 1228530734 c:\program files (x86)\codeblocks\mingw\include\gl\glu.h 232 | 233 | 234 | 235 | 1250308678 c:\program files (x86)\codeblocks\mingw\include\math.h 236 | <_mingw.h> 237 | 238 | -------------------------------------------------------------------------------- /Statelite-Station-Project/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | static double x=0.0; 8 | static double move=-60; 9 | static float rx[100]= {0}, ry[100]= {0}; 10 | 11 | //control waves 12 | static double w1=0,w2=0,w3=0; 13 | static bool transmit=false; 14 | 15 | void *font; 16 | void *currentfont; 17 | 18 | void setFont(void *font) 19 | { 20 | currentfont=font; 21 | } 22 | 23 | void drawstring(float x,float y,float z,char *string) 24 | { 25 | char *c; 26 | glRasterPos3f(x,y,z); 27 | for(c=string; *c!='\0'; c++) 28 | { 29 | glColor3f(0.0,1.0,1.0); 30 | glutBitmapCharacter(currentfont,*c); 31 | } 32 | } 33 | 34 | void 35 | stroke_output(GLfloat x, GLfloat y, char *format,...) 36 | { 37 | va_list args; 38 | char buffer[200], *p; 39 | va_start(args, format); 40 | vsprintf(buffer, format, args); 41 | va_end(args); 42 | glPushMatrix(); 43 | glTranslatef(-3.0, y, 2); 44 | glScaled(0.002, 0.003, 0.003); 45 | for (p = buffer; *p; p++) 46 | glutStrokeCharacter(GLUT_STROKE_ROMAN, *p); 47 | glPopMatrix(); 48 | } 49 | void satellite() 50 | { 51 | 52 | glRotatef(60,1,0,0); 53 | 54 | //body 55 | glPushMatrix(); 56 | glColor3f(0.2,0.2,0.2); 57 | glScaled(1,0.6,1); 58 | glTranslatef(3.0,0,0.0); 59 | glutSolidCube(0.4); 60 | glPopMatrix(); 61 | 62 | //Solar Panels 63 | 64 | glPushMatrix(); 65 | glColor3f(0.3,0.3,0.3); 66 | glTranslatef(3,0,0.0); 67 | glScaled(3.7,0.0,1); 68 | glutSolidCube(0.4); 69 | glPopMatrix(); 70 | glPushMatrix(); 71 | glColor3f(0.2,0.1,0.1); 72 | glTranslatef(3.0,0,-0.4); 73 | glScaled(0.5,0.5,0.5); 74 | glutSolidSphere(0.3,50,50); 75 | glPopMatrix(); 76 | 77 | glPushMatrix(); 78 | glColor3f(0.2,0.2,0.1); 79 | glTranslatef(3.0,0,0.4); 80 | glScaled(0.4,0.4,0.3); 81 | glutSolidTorus(0.3,0.2,20,20); 82 | glPopMatrix(); 83 | 84 | } 85 | 86 | // Second Screen 87 | 88 | void sat2(double ang) 89 | { 90 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 91 | glLoadIdentity(); 92 | glTranslatef(0.0f,0.0f,-13.0f); 93 | glRotatef(ang,0.0f,1.0f,0.0f); 94 | 95 | //earth 96 | 97 | glPushMatrix(); 98 | glColor3f(0.066, 0.200, 0.933); 99 | glutSolidSphere(2.0,50,50); 100 | glPopMatrix(); 101 | 102 | satellite(); 103 | 104 | glFlush(); 105 | glutSwapBuffers(); 106 | } 107 | 108 | void building(float x1,float y1,float z1) 109 | { 110 | 111 | //Main Structure 112 | glPushMatrix(); 113 | glColor3f(0.180, 0.435, 0.105); 114 | glTranslatef(x1,y1,z1); 115 | glScaled(0.5,1.5,0.5); 116 | glutSolidCube(2); 117 | glPopMatrix(); 118 | 119 | //Dish on top 120 | glPushMatrix(); 121 | glColor3f(1,1,0); 122 | glTranslatef(x1,y1+1.8,z1); 123 | glRotatef(60,1,0,0); 124 | glScaled(0.5,1.5,0.5); 125 | glutSolidCone(0.5,1,20,20); 126 | glPopMatrix(); 127 | 128 | //windows 129 | glPushMatrix(); 130 | glColor3f(0.243, 0.937, 0.698); 131 | glTranslatef(x1-0.2,y1+0.7,z1); 132 | glScaled(0.5,0.5,0.5); 133 | //glutSolidCube(.3); 134 | for(float j=-3; j<1.5; j+=.8) 135 | { 136 | for(float i=0; i<1; i+=0.8) 137 | { 138 | glPushMatrix(); 139 | glTranslatef(i,j,1); 140 | glutSolidCube(0.4); 141 | glPopMatrix(); 142 | } 143 | } 144 | glPopMatrix(); 145 | 146 | } 147 | 148 | void waves() 149 | { 150 | 151 | glPushMatrix(); 152 | glTranslatef(0,1,0); 153 | glScaled(0.05,0.5,0.1); 154 | glutSolidCube(0.5); 155 | glPopMatrix(); 156 | glPushMatrix(); 157 | glRotatef(-8,0,0,1); 158 | glTranslatef(0.01,1,0); 159 | glScaled(0.05,0.5,0.1); 160 | glutSolidCube(0.5); 161 | glPopMatrix(); 162 | 163 | glPushMatrix(); 164 | glRotatef(8,0,0,1); 165 | glTranslatef(-0.01,1,0); 166 | glScaled(0.05,0.6,0.1); 167 | glutSolidCube(0.5); 168 | glPopMatrix(); 169 | 170 | } 171 | 172 | void sat1() 173 | { 174 | 175 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 176 | glLoadIdentity(); 177 | glTranslatef(0.0f,0.0f,-13.0f); 178 | //glRotatef(x,0.0f,1.0f,0.0f); 179 | 180 | //Moon 181 | glPushMatrix(); 182 | glColor3f(1,1,1); 183 | glTranslatef(-3.8,2.8,0); 184 | glScaled(0.5,0.5,0.1); 185 | glutSolidSphere(0.6,50,50); 186 | glPopMatrix(); 187 | 188 | //Earth 189 | glPushMatrix(); 190 | glColor3f(0.039, 0.698, 0.098); 191 | glTranslatef(0,-12,0); 192 | glutSolidSphere(10.0,50,50); 193 | glPopMatrix(); 194 | 195 | //Building Center 196 | glPushMatrix(); 197 | glColor3f(0.1, 0.6, 0.8); 198 | glRotatef(10,1,0,0); 199 | building(1.2,-1.2,3.2); 200 | glPopMatrix(); 201 | 202 | //Building left 203 | glPushMatrix(); 204 | glColor3f(0.121, 0.698, 0.196); 205 | glRotatef(5,0,0,1); 206 | building(-3.8,-1.2,0); 207 | glPopMatrix(); 208 | 209 | //signal 210 | glPushMatrix(); 211 | glColor3f(0,0,1); 212 | 213 | if(transmit) 214 | { 215 | glRotatef(-25,0,0,1); 216 | glTranslatef(-1.25,-1.6+w1,0); 217 | } 218 | else glTranslatef(1,20,3.3); 219 | waves(); 220 | 221 | glPopMatrix(); 222 | 223 | //Main Dish 224 | //Tower 225 | glPushMatrix(); 226 | glColor3f(1,1,1); 227 | glTranslatef(-1,-2,4); 228 | glRotatef(270,1,0,0); 229 | glScaled(1.0,1,2.0); 230 | glutWireCone(0.5,1,4,10); 231 | glPopMatrix(); 232 | 233 | //Dish 234 | glPushMatrix(); 235 | glColor3f(1,1,1); 236 | glTranslatef(-1.08,0.2,3); 237 | glRotatef(60,1,0,0); 238 | glScaled(0.7,1.3,0.7); 239 | glutSolidCone(0.4,0.5,20,20); 240 | glPopMatrix(); 241 | 242 | //Building right 243 | glPushMatrix(); 244 | glColor3f(0.894, 0.035, 0.027); 245 | glRotatef(-5,0,0,1); 246 | building(3.8,-1.2,0); 247 | glPopMatrix(); 248 | 249 | //Saltellite 250 | 251 | glPushMatrix(); 252 | glTranslatef(-3,3.0,0); 253 | satellite(); 254 | glPopMatrix(); 255 | 256 | //Ack to right building 257 | glPushMatrix(); 258 | if(transmit) 259 | { 260 | glRotatef(50,0,0,1); 261 | glTranslatef(2.8,3.2-w2,0); 262 | } 263 | else glTranslatef(1,20,3.3); 264 | waves(); 265 | 266 | glPopMatrix(); 267 | 268 | //Ack to Left building 269 | glPushMatrix(); 270 | if(transmit) 271 | { 272 | glRotatef(-50,0,0,1); 273 | glTranslatef(-2.8,3.2-w2,0); 274 | } 275 | else glTranslatef(1,20,3.3); 276 | waves(); 277 | 278 | glPopMatrix(); 279 | 280 | //Ack to Center building 281 | glPushMatrix(); 282 | if(transmit) 283 | { 284 | glRotatef(23,0,0,1); 285 | glTranslatef(1,3.2-w3,3.3); 286 | } 287 | else glTranslatef(1,20,3.3); 288 | waves(); 289 | 290 | glPopMatrix(); 291 | 292 | //stars 293 | glPointSize(1); 294 | for(int j=0; j<100; j++) 295 | { 296 | for(int i=0; i<100; i++) 297 | { 298 | rx[j]=rand()/500; 299 | ry[i]=rand()/500; 300 | 301 | glBegin(GL_POINTS); 302 | glColor3f(0,2,2); 303 | glVertex3f(-6+rx[j],ry[i],-5); 304 | glEnd(); 305 | 306 | } 307 | } 308 | 309 | glPushMatrix(); 310 | 311 | glTranslatef(0.0,0.0,-2.0); 312 | setFont(GLUT_BITMAP_TIMES_ROMAN_24); 313 | glColor3f(1,1,1); 314 | drawstring(1,3.7,-1.0,"SATELITE"); 315 | setFont(GLUT_BITMAP_TIMES_ROMAN_24); 316 | glColor3f(1,1,1); 317 | drawstring(-4.4,.5,-1.0,"RECEIVER"); 318 | setFont(GLUT_BITMAP_TIMES_ROMAN_24); 319 | glColor3f(1,1,0); 320 | drawstring(0,-2,7,"RECEIVER"); 321 | setFont(GLUT_BITMAP_TIMES_ROMAN_24); 322 | glColor3f(1,1,1); 323 | drawstring(-1.5,-1,-1.0,"TRANSMITTER"); 324 | setFont(GLUT_BITMAP_TIMES_ROMAN_24); 325 | glColor3f(1,1,1); 326 | drawstring(3.2,1,3,"RECEIVER"); 327 | glPopMatrix(); 328 | 329 | glFlush(); 330 | glutSwapBuffers(); 331 | 332 | } 333 | // Third Screen 334 | 335 | void sat3(double ang) 336 | { 337 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 338 | glLoadIdentity(); 339 | glTranslatef(0.0f,0.0f,-13.0f); 340 | glRotatef(ang,0.0f,1.0f,0.0f); 341 | 342 | //earth 343 | glPushMatrix(); 344 | glColor3f(0.3,0.9,1); 345 | 346 | glutSolidSphere(2.0,50,50); 347 | glPopMatrix(); 348 | 349 | satellite(); 350 | 351 | glFlush(); 352 | glutSwapBuffers(); 353 | } 354 | void e() 355 | { 356 | 357 | x-=0.07; 358 | sat2(x); 359 | 360 | } 361 | 362 | void s() 363 | { 364 | 365 | x-=0.07; 366 | sat2(x); 367 | 368 | } 369 | 370 | void S() 371 | { 372 | x += .07; 373 | if(transmit) 374 | { 375 | if(w1<=4.2) 376 | w1+=0.01; 377 | 378 | if(w1>=2.5 && w2<=6.9) 379 | w2+=0.01; 380 | 381 | if(w1>=2.5 && w3<=5) 382 | w3+=0.01; 383 | } 384 | 385 | sat1(); 386 | 387 | } 388 | 389 | void doInit() 390 | { 391 | 392 | /* Background and foreground color */ 393 | glClearColor(0.0,0.0,0.0,0); 394 | glViewport(0,0,640,480); 395 | /* Select the projection matrix and reset it then 396 | setup our view perspective */ 397 | 398 | glMatrixMode(GL_PROJECTION); 399 | glLoadIdentity(); 400 | gluPerspective(30.0f,(GLfloat)640/(GLfloat)480,0.1f,200.0f); 401 | 402 | /* Select the modelview matrix, which we alter with rotatef() */ 403 | glMatrixMode(GL_MODELVIEW); 404 | glLoadIdentity(); 405 | glClearDepth(2.0f); 406 | glEnable(GL_DEPTH_TEST); 407 | 408 | glEnable( GL_COLOR_MATERIAL ); 409 | 410 | glDepthFunc(GL_LEQUAL); 411 | } 412 | 413 | void display() 414 | { 415 | 416 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 417 | glLoadIdentity(); 418 | glTranslatef(0.0f,0.0f,-12.0f); 419 | stroke_output(-2.0, 1.7, "Press S--> Start"); 420 | stroke_output(-2.0, 0.9, "Press T--> Transmit"); 421 | stroke_output(-2.0, 0.0, "Press Q--> Quit"); 422 | stroke_output(-2.0,-1.0, "InfO:"); 423 | stroke_output(-2.0,-1.5, "DHIMAN SARKER (173-15-10396)"); 424 | stroke_output(-2.0,-2.0, "ZAHID HOSSAIN (173-15-10397)"); 425 | stroke_output(-2.0,-2.5, "RUHUL AMIN PARVEZ (173-15-10419)"); 426 | 427 | GLfloat mat_ambient[]= {0.0f,1.0f,2.0f,1.0f}; 428 | GLfloat mat_diffuse[]= {0.0f,1.5f,.5f,1.0f}; 429 | GLfloat mat_specular[]= {5.0f,1.0f,1.0f,1.0f}; 430 | GLfloat mat_shininess[]= {50.0f}; 431 | glMaterialfv(GL_FRONT,GL_AMBIENT,mat_ambient); 432 | glMaterialfv(GL_FRONT,GL_DIFFUSE,mat_diffuse); 433 | glMaterialfv(GL_FRONT,GL_SPECULAR,mat_specular); 434 | glMaterialfv(GL_FRONT,GL_SHININESS,mat_shininess); 435 | 436 | GLfloat lightIntensity[]= {1.7f,1.7f,1.7f,1.0f}; 437 | GLfloat light_position3[]= {0.0f,8.0f,10.0f,0.0f}; 438 | glLightfv(GL_LIGHT0,GL_POSITION,light_position3); 439 | glLightfv(GL_LIGHT0,GL_DIFFUSE,lightIntensity); 440 | 441 | GLfloat lightIntensity1[]= {1.7f,1.7f,1.7f,1.0f}; 442 | GLfloat light_position31[]= {-2.0f,8.0f,10.0f,0.0f}; 443 | glLightfv(GL_LIGHT1,GL_POSITION,light_position31); 444 | glLightfv(GL_LIGHT1,GL_DIFFUSE,lightIntensity1); 445 | 446 | glEnable(GL_COLOR_MATERIAL); 447 | 448 | glFlush(); 449 | 450 | glutSwapBuffers(); 451 | 452 | } 453 | 454 | void menu(int id) 455 | { 456 | switch(id) 457 | { 458 | case 1: 459 | glutIdleFunc(S); 460 | break; 461 | case 2: 462 | glutIdleFunc(s); 463 | break; 464 | 465 | case 5: 466 | exit(0); 467 | break; 468 | } 469 | glFlush(); 470 | glutSwapBuffers(); 471 | glutPostRedisplay(); 472 | } 473 | 474 | void mykey(unsigned char key,int x,int y) 475 | { 476 | if(key=='s') 477 | { 478 | glutIdleFunc(s); 479 | } 480 | 481 | if(key=='S') 482 | { 483 | glutIdleFunc(S); 484 | } 485 | 486 | if(key=='e') 487 | { 488 | glutIdleFunc(e); 489 | } 490 | if(key=='t') 491 | 492 | { 493 | transmit=!transmit; 494 | if(!transmit) 495 | { 496 | w1=0; 497 | w2=0; 498 | w3=0; 499 | 500 | } 501 | glutIdleFunc(S); 502 | } 503 | 504 | if(key=='q'||key=='Q') 505 | { 506 | exit(0); 507 | } 508 | 509 | } 510 | int main(int argc, char *argv[]) 511 | { 512 | glutInit(&argc, argv); 513 | glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB); 514 | glutInitWindowSize(1000,600); 515 | glutInitWindowPosition(0,0); 516 | glutCreateWindow("Working of a Satellite"); 517 | glutDisplayFunc(display); 518 | glEnable(GL_LIGHTING); 519 | glEnable(GL_LIGHT0); 520 | glEnable(GL_LIGHT1); 521 | glShadeModel(GL_SMOOTH); 522 | glEnable(GL_DEPTH_TEST); 523 | glEnable(GL_NORMALIZE); 524 | glutKeyboardFunc(mykey); 525 | glutCreateMenu(menu); 526 | glutAddMenuEntry("Pyramid 's'",1); 527 | glutAddMenuEntry("Reverse Pyramid 'S'",2); 528 | glutAddMenuEntry("Quit 'q'",5); 529 | glutAttachMenu(GLUT_RIGHT_BUTTON); 530 | doInit(); 531 | glutMainLoop(); 532 | return 0; 533 | } 534 | -------------------------------------------------------------------------------- /Smart-Village-Project/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #define PI 3.1416 8 | 9 | 10 | GLint i, j, k; 11 | GLfloat sun_spin=0, sun_x=0, sun_y=0; 12 | GLfloat ax=0,bx=0,cx=0,dx=0,str=500.0,mn=500.0; 13 | GLfloat sr=0.0,sg=0.749,sb=1.0; 14 | GLfloat spin = 0.0; 15 | 16 | void init(void) 17 | { 18 | glClearColor(.40, .110, 1.0, 0.0); 19 | glMatrixMode(GL_PROJECTION); 20 | gluOrtho2D(0.0, 1000.0, 0.0, 500.0); 21 | } 22 | 23 | 24 | ///============================================================================================================/// 25 | 26 | ///=================/// 27 | ///*** All_Model ***/// 28 | ///=================/// 29 | 30 | 31 | 32 | ///*** Circle_Model***/// 33 | void circle(GLdouble rad) 34 | { 35 | GLint points = 50; 36 | GLdouble delTheta = (2.0 * PI) / (GLdouble)points; 37 | GLdouble theta = 0.0; 38 | 39 | glBegin(GL_POLYGON); 40 | { 41 | for( i = 0; i <=50; i++, theta += delTheta ) 42 | { 43 | glVertex2f(rad * cos(theta),rad * sin(theta)); 44 | } 45 | } 46 | glEnd(); 47 | } 48 | /// *** Sun_Model **/// 49 | void Sun_Model(){ 50 | glPushMatrix(); 51 | glTranslatef(500,0,0); 52 | circle(30); 53 | glPopMatrix(); 54 | 55 | } 56 | void Moving_Sun_Model(){ 57 | glPushMatrix(); 58 | glRotatef(-sun_spin, 0,0,-.009); 59 | Sun_Model(); 60 | glPopMatrix(); 61 | 62 | } 63 | ///*** Cloud_Model***/// 64 | void cloud_model_one(){ 65 | 66 | glColor3f(1.25, 0.924, 0.930); 67 | 68 | ///Top_Left 69 | 70 | glPushMatrix(); 71 | glTranslatef(320,210,0); 72 | circle(15); 73 | glPopMatrix(); 74 | 75 | ///Top 76 | 77 | glPushMatrix(); 78 | glTranslatef(340, 225, 0); 79 | circle(16); 80 | glPopMatrix(); 81 | 82 | ///Right 83 | 84 | glPushMatrix(); 85 | glTranslatef(360,210,0); 86 | circle(16); 87 | glPopMatrix(); 88 | 89 | 90 | ///middle_Fill 91 | glPushMatrix(); 92 | glTranslatef(355,210,0); 93 | circle(16); 94 | glPopMatrix(); 95 | 96 | glPushMatrix(); 97 | glTranslatef(350,210,0); 98 | circle(16); 99 | glPopMatrix(); 100 | 101 | glPushMatrix(); 102 | glTranslatef(345,204,0); 103 | circle(10); 104 | glPopMatrix(); 105 | 106 | glPushMatrix(); 107 | glTranslatef(340,204,0); 108 | circle(10); 109 | glPopMatrix(); 110 | 111 | glPushMatrix(); 112 | glTranslatef(335,204,0); 113 | circle(10); 114 | glPopMatrix(); 115 | 116 | glPushMatrix(); 117 | glTranslatef(330,204,0); 118 | circle(10); 119 | glPopMatrix(); 120 | 121 | glPushMatrix(); 122 | glTranslatef(325,204,0); 123 | circle(10); 124 | glPopMatrix(); 125 | 126 | glPushMatrix(); 127 | glTranslatef(320,204,0); 128 | circle(10); 129 | glPopMatrix(); 130 | 131 | glPushMatrix(); 132 | glTranslatef(315,204,0); 133 | circle(10); 134 | glPopMatrix(); 135 | 136 | glPushMatrix(); 137 | glTranslatef(310,204,0); 138 | circle(10); 139 | glPopMatrix(); 140 | 141 | glPushMatrix(); 142 | glTranslatef(305,204,0); 143 | circle(10); 144 | glPopMatrix(); 145 | 146 | ///****Fill End**** 147 | 148 | } 149 | 150 | void cloud_model_Two(){ 151 | glColor3f(1.25, 0.924, 0.930); 152 | 153 | ///Left_Part 154 | glPushMatrix(); 155 | glTranslatef(305,205,0); 156 | circle(10); 157 | glPopMatrix(); 158 | 159 | ///Top 160 | 161 | glPushMatrix(); 162 | glTranslatef(320,210,0); 163 | circle(15); 164 | glPopMatrix(); 165 | 166 | ///Right_Part 167 | glPushMatrix(); 168 | glTranslatef(334,207,0); 169 | circle(10); 170 | glPopMatrix(); 171 | 172 | ///Bottom_Part 173 | glPushMatrix(); 174 | glTranslatef(320,207,0); 175 | circle(10); 176 | glPopMatrix(); 177 | 178 | 179 | 180 | } 181 | 182 | void cloud_model_Three(){ 183 | glColor3f(1.25, 0.924, 0.930); 184 | 185 | ///Left_Part 186 | glPushMatrix(); 187 | glTranslatef(300,200,0); 188 | circle(15); 189 | glPopMatrix(); 190 | 191 | ///Top_Left 192 | 193 | glPushMatrix(); 194 | glTranslatef(320,210,0); 195 | circle(15); 196 | glPopMatrix(); 197 | 198 | ///Top 199 | glPushMatrix(); 200 | glTranslatef(340,220,0); 201 | circle(16); 202 | glPopMatrix(); 203 | 204 | ///Top_Right 205 | glPushMatrix(); 206 | glTranslatef(360,210,0); 207 | circle(15); 208 | glPopMatrix(); 209 | 210 | ///Right_Part 211 | glPushMatrix(); 212 | glTranslatef(380,200,0); 213 | circle(15); 214 | glPopMatrix(); 215 | 216 | ///Bottom_Right 217 | glPushMatrix(); 218 | glTranslatef(360,190,0); 219 | circle(20); 220 | glPopMatrix(); 221 | 222 | ///Bottom_Left 223 | glPushMatrix(); 224 | glTranslatef(320,190,0); 225 | circle(20); 226 | glPopMatrix(); 227 | 228 | ///Bottom 229 | glPushMatrix(); 230 | glTranslatef(340,190,0); 231 | circle(20); 232 | glPopMatrix(); 233 | 234 | 235 | 236 | 237 | ///****Fill End**** 238 | 239 | } 240 | ///*** Hill_Model***/// 241 | void hill_big(){ 242 | 243 | ///Hill 244 | glBegin(GL_POLYGON); 245 | glColor3f(0.38, 0.41, 0.36); 246 | glVertex2i(70, 70); 247 | glVertex2i(200, 225); 248 | glVertex2i(330, 70); 249 | 250 | glEnd(); 251 | 252 | ///Hill_Snow 253 | glBegin(GL_POLYGON); 254 | glColor3f(1.25, 0.924, 0.930); 255 | 256 | glVertex2i(200, 225); 257 | glVertex2i(230, 190); 258 | glVertex2i(220, 180); 259 | glVertex2i(200, 190); 260 | glVertex2i(190, 180); 261 | glVertex2i(170, 190); 262 | 263 | glEnd(); 264 | 265 | } 266 | void hill_small(){ 267 | ///Hill_Small 268 | glBegin(GL_POLYGON); 269 | glColor3f(0.11, 0.23, 0.36); 270 | glVertex2i(250, 100); 271 | glVertex2i(310, 175); 272 | glVertex2i(370, 100); 273 | 274 | glEnd(); 275 | 276 | ///Hill_Small_Snow 277 | glBegin(GL_POLYGON); 278 | glColor3f(1.25, 0.924, 0.930); 279 | glVertex2i(290, 150); 280 | glVertex2i(310, 175); 281 | glVertex2i(330, 150); 282 | glVertex2i(325, 140); 283 | glVertex2i(310, 150); 284 | glVertex2i(300, 140); 285 | 286 | 287 | glEnd(); 288 | } 289 | ///*** Tilla_Model ***/// 290 | void Tilla_One_Model(){ 291 | ///Tilla 292 | glBegin(GL_POLYGON); 293 | glColor3f(0.1, 1.293, 0.0); 294 | glVertex2i(125, 70); 295 | glVertex2i(150, 80); 296 | glVertex2i(160, 90); 297 | glVertex2i(170, 90); 298 | glVertex2i(180, 100); 299 | glVertex2i(190, 105); 300 | glVertex2i(200, 108); 301 | glVertex2i(300, 110); 302 | glVertex2i(300, 70); 303 | 304 | glEnd(); 305 | 306 | } 307 | 308 | void Tilla_Two_Model(){ 309 | 310 | glColor3f(0.1, 1.293, 0.0); 311 | /// Left_Part 312 | glPushMatrix(); 313 | glTranslatef(430,90,0); 314 | circle(30); 315 | glPopMatrix(); 316 | 317 | glPushMatrix(); 318 | glTranslatef(420,87,0); 319 | circle(30); 320 | glPopMatrix(); 321 | 322 | glPushMatrix(); 323 | glTranslatef(410,80,0); 324 | circle(30); 325 | glPopMatrix(); 326 | 327 | glPushMatrix(); 328 | glTranslatef(400,80,0); 329 | circle(30); 330 | glPopMatrix(); 331 | 332 | glPushMatrix(); 333 | glTranslatef(390,70,0); 334 | circle(30); 335 | glPopMatrix(); 336 | 337 | ///Right_Part 338 | glPushMatrix(); 339 | glTranslatef(445,80,0); 340 | circle(30); 341 | glPopMatrix(); 342 | 343 | glPushMatrix(); 344 | glTranslatef(455,75,0); 345 | circle(30); 346 | glPopMatrix(); 347 | 348 | glPushMatrix(); 349 | glTranslatef(465,70,0); 350 | circle(30); 351 | glPopMatrix(); 352 | 353 | glPushMatrix(); 354 | glTranslatef(470,65,0); 355 | circle(30); 356 | glPopMatrix(); 357 | 358 | glPushMatrix(); 359 | glTranslatef(480,60,0); 360 | circle(30); 361 | glPopMatrix(); 362 | 363 | glPushMatrix(); 364 | glTranslatef(485,55,0); 365 | circle(20); 366 | glPopMatrix(); 367 | 368 | 369 | 370 | } 371 | ///*** House_Model ***/// 372 | void house(){ 373 | ///House_Roof 374 | glBegin(GL_POLYGON); 375 | glColor3f(.990, 0.0, 0.0); 376 | glVertex2i(285, 105); 377 | glVertex2i(285, 130); 378 | glVertex2i(380, 115); 379 | glVertex2i(380, 105); 380 | 381 | glEnd(); 382 | 383 | ///House_Roof_Shadow 384 | glBegin(GL_POLYGON); 385 | glColor3f(.890, 0.0, 0.0); 386 | glVertex2i(285, 105); 387 | glVertex2i(285, 120); 388 | glVertex2i(380, 105); 389 | glVertex2i(380, 105); 390 | 391 | glEnd(); 392 | 393 | ///House_Fence 394 | glBegin(GL_POLYGON); 395 | glColor3f(.555, 1.0, 1.0); 396 | glVertex2i(290, 70); 397 | glVertex2i(290, 104); 398 | glVertex2i(375, 104); 399 | glVertex2i(375, 70); 400 | 401 | glEnd(); 402 | 403 | ///House_Fence_Shadow 404 | glBegin(GL_POLYGON); 405 | glColor3f(.555, 0.924, 0.930); 406 | glVertex2i(310, 70); 407 | glVertex2i(350, 104); 408 | glVertex2i(375, 104); 409 | glVertex2i(375, 70); 410 | 411 | glEnd(); 412 | 413 | ///House_Door 414 | glBegin(GL_POLYGON); 415 | glColor3f(0.38, 0.41, 0.36); 416 | glVertex2i(330, 70); 417 | glVertex2i(330, 100); 418 | glVertex2i(350, 100); 419 | glVertex2i(350, 70); 420 | 421 | glEnd(); 422 | 423 | ///House_Window1 424 | glBegin(GL_POLYGON); 425 | glColor3f(0.38, 0.21, 0.26); 426 | glVertex2i(295, 75); 427 | glVertex2i(295, 90); 428 | glVertex2i(310, 90); 429 | glVertex2i(310, 75); 430 | 431 | glEnd(); 432 | 433 | ///House_Window2 434 | glBegin(GL_POLYGON); 435 | glColor3f(0.38, 0.21, 0.26); 436 | glVertex2i(312, 75); 437 | glVertex2i(312, 90); 438 | glVertex2i(327, 90); 439 | glVertex2i(327, 75); 440 | 441 | glEnd(); 442 | 443 | ///House_Window3 444 | glBegin(GL_POLYGON); 445 | glColor3f(0.38, 0.21, 0.26); 446 | glVertex2i(355, 75); 447 | glVertex2i(355, 90); 448 | glVertex2i(370, 90); 449 | glVertex2i(370, 75); 450 | 451 | glEnd(); 452 | 453 | ///House_Small_Roof 454 | glBegin(GL_POLYGON); 455 | glColor3f(1.0, 0.0, 0.0); 456 | glVertex2i(250, 90); 457 | glVertex2i(257, 104); 458 | glVertex2i(290, 104); 459 | glVertex2i(290, 90); 460 | 461 | glEnd(); 462 | 463 | ///House_Small_Fence 464 | glBegin(GL_POLYGON); 465 | glColor3f(.555, .724, .930); 466 | glVertex2i(255, 70); 467 | glVertex2i(255, 90); 468 | glVertex2i(290, 90); 469 | glVertex2i(290, 70); 470 | 471 | glEnd(); 472 | 473 | ///House_Small_Door 474 | glBegin(GL_POLYGON); 475 | glColor3f(0.11, 0.23, 0.36); 476 | glVertex2i(260, 70); 477 | glVertex2i(260, 80); 478 | glVertex2i(285, 80); 479 | glVertex2i(285, 70); 480 | 481 | glEnd(); 482 | 483 | 484 | } 485 | ///*** Field_Model ***/// 486 | void field(){ 487 | ///Field 488 | glBegin(GL_POLYGON); 489 | glColor3f(0.533, 1.293, 0.0); 490 | glVertex2i(0, 50); 491 | glVertex2i(0, 70); 492 | glVertex2i(1000, 70); 493 | glVertex2i(1000, 50); 494 | 495 | glEnd(); 496 | 497 | 498 | ///Field_Shadow 499 | glBegin(GL_POLYGON); 500 | glColor3f(0.1, 1.293, 0.0); 501 | glVertex2i(0, 0); 502 | glVertex2i(0, 50); 503 | glVertex2i(1000, 50); 504 | glVertex2i(1000, 0); 505 | 506 | glEnd(); 507 | 508 | 509 | } 510 | ///*** Tree_Model ***/// 511 | void Tree_Model_One(){ 512 | 513 | 514 | glPushMatrix(); 515 | glTranslatef(110,110,0); 516 | circle(15); 517 | glPopMatrix(); 518 | 519 | glPushMatrix(); 520 | glTranslatef(110,100,0); 521 | circle(15); 522 | glPopMatrix(); 523 | 524 | glBegin(GL_POLYGON); 525 | glColor3f(0.38, 0.21, 0.26); 526 | glVertex2f(109, 70); 527 | glVertex2f(109, 90); 528 | glVertex2f(111, 90); 529 | glVertex2f(111, 70); 530 | 531 | glEnd(); 532 | 533 | } 534 | void Tree_Model_Two(){ 535 | 536 | glPushMatrix(); 537 | glTranslatef(130,130,0); 538 | circle(5); 539 | glPopMatrix(); 540 | 541 | glPushMatrix(); 542 | glTranslatef(125,126,0); 543 | circle(5); 544 | glPopMatrix(); 545 | 546 | glPushMatrix(); 547 | glTranslatef(135,126,0); 548 | circle(5); 549 | glPopMatrix(); 550 | 551 | glPushMatrix(); 552 | glTranslatef(130,125,0); 553 | circle(5); 554 | glPopMatrix(); 555 | 556 | glBegin(GL_POLYGON); 557 | glColor3f(0.38, 0.21, 0.26); 558 | glVertex2f(129, 110); 559 | glVertex2f(129, 124); 560 | glVertex2f(131, 124); 561 | glVertex2f(131, 110); 562 | 563 | glEnd(); 564 | } 565 | 566 | void Tree_Model_Three(){ 567 | 568 | 569 | glBegin(GL_POLYGON); 570 | 571 | glVertex2f(125, 123); 572 | glVertex2f(133, 145); 573 | glVertex2f(141, 123); 574 | 575 | glEnd(); 576 | 577 | glBegin(GL_POLYGON); 578 | glColor3f(0.38, 0.21, 0.26); 579 | glVertex2f(132, 110); 580 | glVertex2f(132, 124); 581 | glVertex2f(134, 124); 582 | glVertex2f(134, 110); 583 | 584 | glEnd(); 585 | } 586 | 587 | /// *** Windmill_Stand_Model ***/// 588 | void Windmill_Stand_Model(){ 589 | 590 | glColor3f(0.38, 0.41, 0.36); 591 | glBegin(GL_POLYGON); 592 | glVertex2i(375, 100); 593 | glVertex2i(380, 240); 594 | glVertex2i(384, 240); 595 | glVertex2i(390, 100); 596 | glEnd(); 597 | } 598 | 599 | ///*** Windmill_Blades_Model ***/// 600 | 601 | void Windmill_Blade(){ 602 | 603 | ///Blade_One 604 | glPushMatrix(); 605 | glRotatef(spin,0,0,90); 606 | glBegin(GL_POLYGON); 607 | glVertex2i(-5, 0); 608 | glVertex2i(-85, -36); 609 | glVertex2i(-83, -37); 610 | glVertex2i(-3, -8); 611 | glEnd(); 612 | glPopMatrix(); 613 | 614 | ///Blade_Two 615 | glPushMatrix(); 616 | glRotatef(spin,0,0,90); 617 | glBegin(GL_POLYGON); 618 | glVertex2i(0, 5); 619 | glVertex2i(45, 70); 620 | glVertex2i(50, 73); 621 | glVertex2i(5, 0); 622 | glEnd(); 623 | glPopMatrix(); 624 | 625 | ///Blade_Three 626 | glPushMatrix(); 627 | glRotatef(spin,0,0,90); 628 | glBegin(GL_POLYGON); 629 | glVertex2i(68, -78); 630 | glVertex2i(0,0); 631 | glVertex2i(5, 5); 632 | glVertex2i(70, -77); 633 | glEnd(); 634 | glPopMatrix(); 635 | 636 | } 637 | ///*** Windmill_Final_Model ***/// 638 | void Windmill(){ 639 | 640 | 641 | 642 | ///Windmill_Stand 643 | glColor3f(0.38, 0.41, 0.36); 644 | glPushMatrix(); 645 | Windmill_Stand_Model(); 646 | glPopMatrix(); 647 | 648 | ///Windmill_Motor 649 | glColor3f(0.11, 0.23, 0.36); 650 | glPushMatrix(); 651 | glTranslatef(380,250,0); 652 | circle(10); 653 | glPopMatrix(); 654 | 655 | ///Windmill_Rotary_Blades 656 | glColor3f(0.11, 0.23, 0.36); 657 | glPushMatrix(); 658 | glTranslatef(380,251,0); 659 | Windmill_Blade(); 660 | glPopMatrix(); 661 | 662 | 663 | 664 | 665 | } 666 | 667 | 668 | ///Model_End 669 | ///=======================================================================================================/// 670 | 671 | 672 | ///=================/// 673 | ///*** Object ***/// 674 | ///=================/// 675 | 676 | ///*** Sun ***/// 677 | void Sun(){ 678 | glColor3f(1, 1, 0); 679 | glPushMatrix(); 680 | Moving_Sun_Model(); 681 | glPopMatrix(); 682 | } 683 | ///*** Cloud_One_Model_One ***/// 684 | void cloud_one(){ 685 | glPushMatrix(); 686 | glTranslatef(cx,-40,0); 687 | cloud_model_one(); 688 | glPopMatrix(); 689 | 690 | } 691 | 692 | ///*** Cloud_Two_Model_one ***/// 693 | 694 | void cloud_two(){ 695 | glPushMatrix(); 696 | glTranslatef(bx+100,150,0); 697 | cloud_model_one(); 698 | glPopMatrix(); 699 | 700 | } 701 | 702 | ///*** Cloud_Three_Model_Two ***/// 703 | 704 | void cloud_three(){ 705 | glPushMatrix(); 706 | glTranslatef(ax-80,80,0); 707 | cloud_model_Two(); 708 | glPopMatrix(); 709 | 710 | } 711 | ///*** Cloud_Four_Model_Two ***/// 712 | 713 | void cloud_four(){ 714 | glPushMatrix(); 715 | glTranslatef(dx+300,125,0); 716 | cloud_model_Two(); 717 | glPopMatrix(); 718 | 719 | } 720 | ///*** Cloud_Five_Model_Three ***/// 721 | void cloud_five(){ 722 | 723 | glPushMatrix(); 724 | glTranslatef(ax+-300,170,0); 725 | cloud_model_Three(); 726 | glPopMatrix(); 727 | } 728 | ///*** Cloud_Six_Model_Three ***/// 729 | void cloud_six(){ 730 | 731 | glPushMatrix(); 732 | glTranslatef(cx+-500,20,0); 733 | cloud_model_Three(); 734 | glPopMatrix(); 735 | } 736 | 737 | ///*** House_One ***/// 738 | void house_one(){ 739 | glPushMatrix(); 740 | glTranslatef(0,0,0); 741 | house(); 742 | glPopMatrix(); 743 | } 744 | ///*** House_Two ***/// 745 | void house_two(){ 746 | glPushMatrix(); 747 | glTranslatef(450,0,0); 748 | house(); 749 | glPopMatrix(); 750 | } 751 | ///*** House_Two ***/// 752 | void house_three(){ 753 | glPushMatrix(); 754 | glTranslatef(320, 37,0); 755 | house(); 756 | glPopMatrix(); 757 | } 758 | ///*** Hill_big_One ***/// 759 | void Hill_Big_One(){ 760 | glPushMatrix(); 761 | glTranslatef(0,0,0); 762 | hill_big(); 763 | glPopMatrix(); 764 | } 765 | ///*** Hill_big_Two ***/// 766 | void Hill_Big_Two(){ 767 | glPushMatrix(); 768 | glTranslatef(550,-20,0); 769 | hill_big(); 770 | glPopMatrix(); 771 | } 772 | ///*** Hill_Small_One ***/// 773 | void Hill_Small_One(){ 774 | glPushMatrix(); 775 | glTranslatef(0,0,0); 776 | hill_small(); 777 | glPopMatrix(); 778 | 779 | } 780 | /// *** Tilla_One_Model_One ***/// 781 | 782 | void Tilla_One(){ 783 | 784 | glPushMatrix(); 785 | glTranslatef(0,0,0); 786 | Tilla_One_Model(); 787 | glPopMatrix(); 788 | 789 | } 790 | /// *** Tilla_Two_Model_Two ***/// 791 | void Tilla_Two(){ 792 | 793 | glPushMatrix(); 794 | glTranslatef(0,0,0); 795 | Tilla_Two_Model(); 796 | glPopMatrix(); 797 | 798 | 799 | } 800 | /// *** Tilla_Three_Model_Two ***/// 801 | void Tilla_Three(){ 802 | 803 | glPushMatrix(); 804 | glTranslatef(400,0,0); 805 | Tilla_Two_Model(); 806 | glPopMatrix(); 807 | 808 | 809 | } 810 | /// *** Tilla_Four_Model_One ***/// 811 | void Tilla_Four(){ 812 | 813 | glColor3f(0.833, 1., 0.0); 814 | glPushMatrix(); 815 | glTranslatef(380,0,0); 816 | Tilla_One_Model(); 817 | glPopMatrix(); 818 | 819 | 820 | } 821 | ///*** Tree_1 ***/// 822 | void Tree_One(){ 823 | glColor3f(0.533, 1.293, 0.0); 824 | glPushMatrix(); 825 | glTranslatef(0,0,0); 826 | Tree_Model_One(); 827 | glPopMatrix(); 828 | } 829 | 830 | ///*** Tree_2 ***/// 831 | void Tree_Two(){ 832 | glColor3f(0.533, 1.293, 0.0); 833 | glPushMatrix(); 834 | glTranslatef(540,0,0); 835 | Tree_Model_One(); 836 | glPopMatrix(); 837 | } 838 | 839 | ///*** Tree_3 ***/// 840 | void Tree_Three(){ 841 | glColor3f(0.533, 1.293, 0.0); 842 | glPushMatrix(); 843 | glTranslatef(750,0,0); 844 | Tree_Model_One(); 845 | glPopMatrix(); 846 | } 847 | ///*** Tree_4 ***/// 848 | void Tree_Four(){ 849 | glColor3f(0.533, 1.293, 0.0); 850 | glPushMatrix(); 851 | glTranslatef(292,40,0); 852 | Tree_Model_One(); 853 | glPopMatrix(); 854 | } 855 | 856 | ///*** Tree_5 ***/// 857 | void Tree_Five(){ 858 | glColor3f(0.533, 1.293, 0.0); 859 | glPushMatrix(); 860 | glTranslatef(30,-20,0); 861 | Tree_Model_Two(); 862 | glPopMatrix(); 863 | } 864 | 865 | ///*** Tree_6 ***/// 866 | void Tree_Six(){ 867 | glColor3f(0.533, 1.293, 0.0); 868 | glPushMatrix(); 869 | glTranslatef(50,-10,0); 870 | Tree_Model_Two(); 871 | glPopMatrix(); 872 | } 873 | ///*** Tree_7 ***/// 874 | void Tree_Seven(){ 875 | glColor3f(0.533, 1.293, 0.0); 876 | glPushMatrix(); 877 | glTranslatef(322,0,0); 878 | Tree_Model_Two(); 879 | glPopMatrix(); 880 | } 881 | 882 | ///*** Tree_8 ***/// 883 | void Tree_Eight(){ 884 | glColor3f(0.533, 1.293, 0.0); 885 | glPushMatrix(); 886 | glTranslatef(350,-15,0); 887 | Tree_Model_Two(); 888 | glPopMatrix(); 889 | } 890 | 891 | ///*** Tree_9 ***/// 892 | void Tree_Nine(){ 893 | glColor3f(0.533, 1.293, 0.0); 894 | glPushMatrix(); 895 | glTranslatef(760,-25,0); 896 | Tree_Model_Two(); 897 | glPopMatrix(); 898 | } 899 | 900 | ///*** Tree_10 ***/// 901 | void Tree_Ten(){ 902 | glColor3f(0.533, 1.293, 0.0); 903 | glPushMatrix(); 904 | glTranslatef(90,-2,0); 905 | Tree_Model_Three(); 906 | glPopMatrix(); 907 | } 908 | 909 | ///*** Tree_11 ***/// 910 | void Tree_Eleven(){ 911 | glColor3f(0.533, 1.293, 0.0); 912 | glPushMatrix(); 913 | glTranslatef(125,0,0); 914 | Tree_Model_Three(); 915 | glPopMatrix(); 916 | } 917 | 918 | ///*** Tree_12 ***/// 919 | void Tree_Twelve(){ 920 | glColor3f(0.533, 1.293, 0.0); 921 | glPushMatrix(); 922 | glTranslatef(408,-22,0); 923 | Tree_Model_Three(); 924 | glPopMatrix(); 925 | } 926 | 927 | /// *** Windmill ***/// 928 | void Windmill_One(){ 929 | glColor3f(0.11, 0.23, 0.36); 930 | glPushMatrix(); 931 | glTranslatef(0,-10,0); 932 | Windmill(); 933 | glPopMatrix(); 934 | 935 | } 936 | 937 | void Windmill_Two(){ 938 | glColor3f(0.11, 0.23, 0.36); 939 | glPushMatrix(); 940 | glTranslatef(508,-70,0); 941 | Windmill(); 942 | glPopMatrix(); 943 | 944 | } 945 | void Windmill_Three(){ 946 | glColor3f(0.11, 0.23, 0.36); 947 | glPushMatrix(); 948 | glTranslatef(108,-90,0); 949 | Windmill(); 950 | glPopMatrix(); 951 | 952 | } 953 | ///Object_End 954 | ///=========================================================================================================/// 955 | 956 | 957 | ///========================/// 958 | ///*** Display Function ***/// 959 | ///========================/// 960 | 961 | void display(void) 962 | { 963 | glClear(GL_COLOR_BUFFER_BIT); 964 | glColor3f(0.0, 0.0, 1.0); 965 | 966 | ///*** Object_Layer ***/// 967 | Sun(); 968 | 969 | Windmill_Three(); 970 | 971 | Hill_Big_One(); 972 | Tilla_Four(); 973 | 974 | house_three(); 975 | 976 | Hill_Big_Two(); 977 | Hill_Small_One(); 978 | 979 | cloud_three(); 980 | cloud_four(); 981 | 982 | Windmill_One(); 983 | Windmill_Two(); 984 | 985 | 986 | Tilla_One(); 987 | Tilla_Two(); 988 | Tilla_Three(); 989 | 990 | 991 | house_one(); 992 | cloud_one(); 993 | house_two(); 994 | 995 | 996 | Tree_One(); 997 | Tree_Two(); 998 | Tree_Three(); 999 | Tree_Four(); 1000 | Tree_Five(); 1001 | Tree_Six(); 1002 | Tree_Seven(); 1003 | Tree_Eight(); 1004 | Tree_Nine(); 1005 | Tree_Ten(); 1006 | Tree_Eleven(); 1007 | Tree_Twelve(); 1008 | 1009 | 1010 | 1011 | cloud_two(); 1012 | cloud_five(); 1013 | cloud_six(); 1014 | field(); 1015 | 1016 | glFlush(); 1017 | } 1018 | ///========================/// 1019 | ///*** Speed & Movement ***/// 1020 | ///========================/// 1021 | ///*** Sun_Move ***/// 1022 | void sun_move(){ 1023 | 1024 | sun_spin = sun_spin + 0.0008; 1025 | 1026 | } 1027 | void move_right(){ 1028 | 1029 | sun_move(); 1030 | 1031 | spin = spin +.1; 1032 | ax = ax + .05; 1033 | bx = bx + .08; 1034 | cx = cx + .10; 1035 | dx = dx + .15; 1036 | 1037 | if(cx>1000){ 1038 | cx = -300; 1039 | } 1040 | if(bx>1000){ 1041 | bx= -400; 1042 | 1043 | } 1044 | if(cx>1000){ 1045 | cx= -400; 1046 | 1047 | } 1048 | if(dx>1000){ 1049 | dx= -500; 1050 | 1051 | } 1052 | 1053 | 1054 | glutPostRedisplay(); 1055 | } 1056 | 1057 | 1058 | 1059 | void mouse(int key, int state, int x, int y){ 1060 | switch (key) 1061 | { 1062 | case GLUT_LEFT_BUTTON: 1063 | if (state == GLUT_DOWN) 1064 | { 1065 | glutIdleFunc(move_right); 1066 | } 1067 | break; 1068 | case GLUT_MIDDLE_BUTTON: 1069 | case GLUT_RIGHT_BUTTON: 1070 | if (state == GLUT_DOWN) 1071 | { 1072 | glutIdleFunc(NULL); 1073 | } 1074 | break; 1075 | default: 1076 | break; 1077 | } 1078 | } 1079 | 1080 | int main(int argc, char** argv) 1081 | { 1082 | glutInit(&argc, argv); 1083 | glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); 1084 | glutInitWindowPosition(50, 50); 1085 | glutInitWindowSize(1900, 1900); 1086 | glutCreateWindow("Smart Village"); 1087 | init(); 1088 | glutDisplayFunc(display); 1089 | glutMouseFunc(mouse); 1090 | glutMainLoop(); 1091 | } 1092 | --------------------------------------------------------------------------------