tag:blogger.com,1999:blog-20201948008368077252024-03-13T18:16:25.508+05:30OpenGL ProjectsOpenGL Projects is all about the cg graphics programming particularly for VTU CSE students. OpenGL Projects also cover the topics over opengl tutorials, graphics tutorials and android programmingRajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.comBlogger219125tag:blogger.com,1999:blog-2020194800836807725.post-88796309957091303822024-01-16T01:33:00.004+05:302024-01-16T01:46:09.677+05:30New Village Scenery Computer Graphics Project in OpenGL Source Code<p style="text-align: justify;">Many of the University including VTU have 'The Department of Computer Science and Engineering' which have Lab projects for students to show thier learning skill which got during thier course study. </p><p style="text-align: justify;"><a href="https://www.msec.ac.in/files/vlab/CG%20Lab%20Manual.pdf" rel="nofollow" target="_blank">VTU Computer Graphics and Visualization Laboratory [15CSL68]</a></p><p style="text-align: justify;">Above mentioned link have the lab programs prescribed by VTU under it course id mentioned have computer graphics project in OpenGL. Under this program students use thier learning ability to show of thier excellence, what they learnt in the course. Many students keeping in focus special efforts to impart thier knowledge to give best projects.</p><p style="text-align: justify;">We in this article we are going to show one of the best project in Computer Graphics Project in OpenGL with free source code. The name of the Project is New Village Scenery. </p><div><h3 class="wp-block-heading" style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 1.5625rem; font-weight: inherit; line-height: 1.3em; margin: 30px 0px 20px; outline: 0px; padding: 0px; vertical-align: baseline;">Project Description:</h3></div><div>In this Computer Graphics Project in OpenGL with free Source Code are going to draw sun, clouds, sky, river, boats, fence, trees, huts. In this projects we demonstrate the moving clouds in the sky and moving boats in the river, Above is achived by using circle, lines traingle and spheres.</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifdnhF3j3Okak7ka6D7a98DYAfurujMIERqvkc4BD6b4MEnO4I1ry3D3DZAacaKFiDM9ACES1Ucl-2UP7cH5I8HtxDWExTOuA_tBy_h5wEwFHDsohupfKfptcUJ5U-auQg6oxDXX9XChOud5TvtgJf-ylAL94_PA-ahqlkIQSzdiiYOa8iszV-4S6if8u2/s1016/New%20Village%20Scenery%20Computer%20Graphics%20Project%20in%20OpenGL%20Source%20Code.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="718" data-original-width="1016" height="226" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifdnhF3j3Okak7ka6D7a98DYAfurujMIERqvkc4BD6b4MEnO4I1ry3D3DZAacaKFiDM9ACES1Ucl-2UP7cH5I8HtxDWExTOuA_tBy_h5wEwFHDsohupfKfptcUJ5U-auQg6oxDXX9XChOud5TvtgJf-ylAL94_PA-ahqlkIQSzdiiYOa8iszV-4S6if8u2/s320/New%20Village%20Scenery%20Computer%20Graphics%20Project%20in%20OpenGL%20Source%20Code.png" width="320" /></a></div><br /><div><br /></div><div><br /></div><div>Draw Sky</div><div><br /></div><div><div> ///sky///</div><div> glBegin(GL_POLYGON);</div><div> glColor3ub(112,160,228);</div><div> glVertex2f(38.0,3.0);</div><div> glVertex2f(38.0,14.0);</div><div> glVertex2f(-12.0,14.0);</div><div> glVertex2f(-12.0,3.0);</div><div> glEnd();</div><div><br /></div><div>Draw the Sun</div><div><br /></div><div> /// Sun</div><div> glPushMatrix();</div><div> glColor3d(255,0,0);</div><div> glTranslatef(1.0, 7.0, 0);</div><div> glutSolidSphere(1.0, 750, 300);</div><div> glPopMatrix();</div></div><h3 style="text-align: left;"><br /></h3><h3 style="text-align: left;">See Also</h3><div><br /></div><div style="text-align: left;">1. <a href="https://www.openglprojects.in/2022/07/simple-city-scenery-opengl-computer.html#gsc.tab=0" target="_blank">Simple City Scenery Opengl Computer Graphics Project</a></div><p>2. <a href="https://www.openglprojects.in/2021/05/transformers-opengl-computer-graphics-projects.html#gsc.tab=0" target="_blank">Transformers - Free OpenGL Source code</a></p><p>3. <a href="https://www.openglprojects.in/2016/03/day-night-color.html#gsc.tab=0" target="_blank">Day and Night OpenGL Computer graphics Project</a></p><p><br /></p><h2 style="text-align: left;">Implementation </h2><div>We use GL_QUADS with tranlation in opengl to draw most of the scenery in this new village scenery opengl projects program. As name suggested quads means fourt vertices. We use the glvertex in opengl to join the vertices and make the objects. Below is how vertices are used in opengl.</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://www.dgp.toronto.edu/~ah/csc418/fall_2001/tut/Image22.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="192" data-original-width="348" height="192" src="https://www.dgp.toronto.edu/~ah/csc418/fall_2001/tut/Image22.gif" width="348" /></a></div><br /><h2 style="text-align: left;">Draw Components</h2><div><br /></div><div style="text-align: justify;">In this project we are going to use the different functions to implement the different object like sun in the program. void DrawAllComponents() functions is used to draw all the mentioned objects required in this program. After we draw all the objects and then we call them in the display function - void display(void)</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">After above functions are implemented we call the keyboard and mouse functions to implement the user interactions and call all of them in main functions.</div><h3 style="text-align: left;">User Interaction</h3><p>In this opengl project below is user interactions</p><p><b>Mouse interactions</b></p><p>Left Mouse button - Increase the Movement of clouds and boats</p><p>Right Mouse button - Decrease the Movement of clouds and boats</p><p><b>Key Interactions</b></p><p><b>s - </b>to stop the boat</p><p>r - to run the boat again</p><h2 style="text-align: left;">Source code and Reports Computer Graphics Project in OpenGL </h2><p>Here you can download computer graphics projects with source code and reports.</p><p>Below is soure code -</p><p>#include<windows.h></p><p>#include <iostream></p><p>#include<GL/gl.h></p><p>#include <GL/glut.h></p><p>#include <math.h></p><p>#include<windows.h></p><p><br /></p><p>float moveC = 0.0f;</p><p>float moveB1 = 0.0f;</p><p>float moveB2 = 0.0f;</p><p>float speed = 0.02f;</p><p><br /></p><p><br /></p><p>void DrawAllComponents()</p><p>{</p><p> glClearColor(1.0f,1.0f,1.0f,1.0f);</p><p> glClear(GL_COLOR_BUFFER_BIT);</p><p> glColor3d(1,0,0);</p><p> glLoadIdentity();</p><p> gluOrtho2D(-12,38,-19,14);//range</p><p> glMatrixMode(GL_MODELVIEW);</p><p><br /></p><p><br /></p><p> ///sky///</p><p> glBegin(GL_POLYGON);</p><p> glColor3ub(112,160,228);</p><p> glVertex2f(38.0,3.0);</p><p> glVertex2f(38.0,14.0);</p><p> glVertex2f(-12.0,14.0);</p><p> glVertex2f(-12.0,3.0);</p><p> glEnd();</p><p><br /></p><p> /// Sun</p><p> glPushMatrix();</p><p> glColor3d(255,0,0);</p><p> glTranslatef(1.0, 7.0, 0);</p><p> glutSolidSphere(1.0, 750, 300);</p><p> glPopMatrix();</p><p><br /></p><p> ///Cloud-01</p><p> glPushMatrix();</p><p><br /></p><p> glTranslatef(moveC,0.0f,0.0f);</p><p> glPushMatrix();</p><p> glColor3d(255,255,255);</p><p> glTranslatef(1.0, 6.0, 0);</p><p> glutSolidSphere(0.7, 250, 250);</p><p> glPopMatrix();</p><p><br /></p><p> glPushMatrix();</p><p> glColor3d(255,255,255);</p><p> glTranslatef(1.0, 7.0, 0);</p><p> glutSolidSphere(0.7, 250, 250);</p><p> glPopMatrix();</p><p><br /></p><p> glPushMatrix();</p><p> glColor3d(255,255,255);</p><p> glTranslatef(2.0, 7.0, 0);</p><p> glutSolidSphere(0.7, 250, 250);</p><p> glPopMatrix();</p><p><br /></p><p> glPushMatrix();</p><p> glColor3d(255,255,255);</p><p> glTranslatef(2.0, 6.0, 0);</p><p> glutSolidSphere(0.7, 250, 250);</p><p> glPopMatrix();</p><p><br /></p><p> glPushMatrix();</p><p> glColor3d(255,255,255);</p><p> glTranslatef(0.0, 6.5, 0);</p><p> glutSolidSphere(0.7, 250, 250);</p><p> glPopMatrix();</p><p><br /></p><p> glPushMatrix();</p><p> glColor3d(255,255,255);</p><p> glTranslatef(3.0, 6.5, 0);</p><p> glutSolidSphere(0.7, 250, 250);</p><p> glPopMatrix();</p><p><br /></p><p> glPopMatrix();</p><p><br /></p><p><br /></p><p> ///cloud-02</p><p><br /></p><p> glPushMatrix();</p><p><br /></p><p> glTranslatef(moveC,0.0f,0.0f);</p><p> glPushMatrix();</p><p> glColor3d(255,255,255);</p><p> glTranslatef(15.0, 9.0, 0);</p><p> glutSolidSphere(0.8, 250, 250);</p><p> glPopMatrix();</p><p><br /></p><p> glPushMatrix();</p><p> glColor3d(255,255,255);</p><p> glTranslatef(15.0, 8.0, 0);</p><p> glutSolidSphere(0.8, 250, 250);</p><p> glPopMatrix();</p><p><br /></p><p> glPushMatrix();</p><p> glColor3d(255,255,255);</p><p> glTranslatef(16.0, 8.0, 0);</p><p> glutSolidSphere(0.8, 250, 250);</p><p> glPopMatrix();</p><p><br /></p><p> glPushMatrix();</p><p> glColor3d(255,255,255);</p><p> glTranslatef(16.0, 9.0, 0);</p><p> glutSolidSphere(0.8, 250, 250);</p><p> glPopMatrix();</p><p><br /></p><p> glPushMatrix();</p><p> glColor3d(255,255,255);</p><p> glTranslatef(14.0, 8.5, 0);</p><p> glutSolidSphere(0.8, 250, 250);</p><p> glPopMatrix();</p><p><br /></p><p> glPushMatrix();</p><p> glColor3d(255,255,255);</p><p> glTranslatef(17.0, 8.5, 0);</p><p> glutSolidSphere(0.8, 250, 250);</p><p> glPopMatrix();</p><p><br /></p><p> glPopMatrix();</p><p><br /></p><p><br /></p><p><br /></p><p> ///cloud-03</p><p> glPushMatrix();</p><p><br /></p><p> glTranslatef(moveC,0.0f,0.0f);</p><p><br /></p><p> glPushMatrix();</p><p> glColor3d(255,255,255);</p><p> glTranslatef(22.0, 8.0, 0);</p><p> glutSolidSphere(0.75, 250, 250);</p><p> glPopMatrix();</p><p><br /></p><p> glPushMatrix();</p><p> glColor3d(255,255,255);</p><p> glTranslatef(22.0, 7.0, 0);</p><p> glutSolidSphere(0.75, 250, 250);</p><p> glPopMatrix();</p><p><br /></p><p> glPushMatrix();</p><p> glColor3d(255,255,255);</p><p> glTranslatef(23.0, 8.0, 0);</p><p> glutSolidSphere(0.75, 250, 250);</p><p> glPopMatrix();</p><p><br /></p><p> glPushMatrix();</p><p> glColor3d(255,255,255);</p><p> glTranslatef(23.0, 7.0, 0);</p><p> glutSolidSphere(0.75, 250, 250);</p><p> glPopMatrix();</p><p><br /></p><p> glPushMatrix();</p><p> glColor3d(255,255,255);</p><p> glTranslatef(24.0, 7.5, 0);</p><p> glutSolidSphere(0.75, 250, 250);</p><p> glPopMatrix();</p><p><br /></p><p> glPushMatrix();</p><p> glColor3d(255,255,255);</p><p> glTranslatef(21.0, 7.5, 0);</p><p> glutSolidSphere(0.75, 250, 250);</p><p> glPopMatrix();</p><p><br /></p><p> glPopMatrix();</p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p> ///See portion</p><p> glPushMatrix();</p><p> glBegin(GL_POLYGON);</p><p> glColor3ub(65,105,225);</p><p><br /></p><p> glVertex2f(40.0,-19.0); /// right-down</p><p> glVertex2f(38.0,-11.0); /// right-top</p><p> glVertex2f(-12.0,-11.0); /// left-top</p><p> glVertex2f(-12.0,-19.0); /// left-down</p><p> glEnd();</p><p><br /></p><p><br /></p><p> ///Ground portion</p><p> glBegin(GL_POLYGON);</p><p> glColor3ub(25,128,0);</p><p><br /></p><p> glVertex2f(90.0f, -12.5f); /// angle</p><p> glVertex2f(38.0f,-12.0f); /// right-down</p><p> glVertex2f(38.0f,3.0f); /// right-top</p><p> glVertex2f(-12.0f,3.0f); /// left-top</p><p> glVertex2f(-12.0f,-11.0f); /// left-down</p><p> glEnd();</p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p> /// House Drawing</p><p><br /></p><p> ///1st House</p><p> /// FEG</p><p> glColor3ub(162, 116, 36);</p><p> glBegin(GL_TRIANGLES);</p><p> glVertex2f(-8, -2);</p><p> glVertex2f(-6, 0);</p><p> glVertex2f(-4, -2);</p><p> glEnd();</p><p><br /></p><p> /// FGIH</p><p> glColor3ub(214, 42, 50);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(-8.023, -5.184);</p><p> glVertex2f(-8, -2);</p><p> glVertex2f(-4, -2);</p><p> glVertex2f(-3.999, -7.219);</p><p> glEnd();</p><p><br /></p><p> ///ROPQ</p><p> glColor3ub(19, 105, 51);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(-6.73, -5.67);</p><p> glVertex2f(-6.76, -3.58);</p><p> glVertex2f(-5.19, -3.58);</p><p> glVertex2f(-5.19, -6.62);</p><p> glEnd();</p><p><br /></p><p> ///EGKJ</p><p> glColor3ub(124, 85, 17);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(-6, 0);</p><p> glVertex2f(4, 0);</p><p> glVertex2f(6, -2);</p><p> glVertex2f(-4, -2);</p><p> glEnd();</p><p><br /></p><p><br /></p><p> ///GLMI</p><p> glColor3ub(156, 9, 16);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(-4, -2);</p><p> glVertex2f(5.22, -2);</p><p> glVertex2f(5.26, -5.11);</p><p> glVertex2f(-3.99, -7.22);</p><p> glEnd();</p><p><br /></p><p> ///VSTU</p><p> glColor3ub(216, 215, 111);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(-0.39, -6.40);</p><p> glVertex2f(-0.42, -3.62);</p><p> glVertex2f(1.95, -3.58);</p><p> glVertex2f(1.97, -5.86);</p><p> glEnd();</p><p><br /></p><p><br /></p><p> ///SZA1V</p><p> glColor3ub(19, 105, 51);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(-0.42, -3.62);</p><p> glVertex2f(0.38, -4.38);</p><p> glVertex2f(0.38, -5.53);</p><p> glVertex2f(-0.39, -6.40);</p><p> glEnd();</p><p><br /></p><p><br /></p><p> ///TB1C1U</p><p> glColor3ub(19, 105, 51);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(1.95, -3.58);</p><p> glVertex2f(1.21, -4.38);</p><p> glVertex2f(1.21, -5.46);</p><p> glVertex2f(1.97, -5.86);</p><p> glEnd();</p><p><br /></p><p><br /></p><p><br /></p><p> ///2nd House</p><p> ///S1R1W1</p><p> glColor3ub(0,0,0);</p><p> glBegin(GL_TRIANGLES);</p><p> glVertex2f(8.09,-5.01);</p><p> glVertex2f(10.96,-2.02);</p><p> glVertex2f(14.10, -5.01);</p><p> glEnd();</p><p><br /></p><p> ///U1V1Z1W1</p><p> glColor3ub(145, 0, 12);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(9.15, -5.01);</p><p> glVertex2f(9.14, -9.02);</p><p> glVertex2f(12.85, -9.04);</p><p> glVertex2f(12.84, -5.01);</p><p> glEnd();</p><p><br /></p><p> ///A2B2C2D2</p><p> glColor3ub(245, 10, 49);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(10.36, -6.79);</p><p> glVertex2f(10.35, -8.91);</p><p> glVertex2f(11.59, -8.99);</p><p> glVertex2f(11.58, -6.79);</p><p> glEnd();</p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p> ///1st Tree</p><p><br /></p><p> glColor3ub(22, 208, 70);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(14.88, -6.00);</p><p> glVertex2f(20, 0);</p><p> glVertex2f(24.98, -6.16);</p><p> glVertex2f(21.05, -4.96);</p><p> glVertex2f(19.09, -4.95);</p><p> glEnd();</p><p><br /></p><p> ///NWJ1H1</p><p> glColor3ub(191, 158, 24);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(19.02, -6.06);</p><p> glVertex2f(20.96, -6.09);</p><p> glVertex2f(21, -10.08);</p><p> glVertex2f(19.01, -10.08);</p><p> glEnd();</p><p><br /></p><p><br /></p><p> /// 2nd Tree</p><p> ///L1K1M1</p><p> glColor3ub(17, 218, 45);</p><p> glBegin(GL_TRIANGLES);</p><p> glVertex2f(27.02, -6.16);</p><p> glVertex2f(30, 0);</p><p> glVertex2f(32.93, -6);</p><p> glEnd();</p><p><br /></p><p> ///E1F1P1Q1</p><p> glColor3ub(191, 158, 24);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(29.09, -6.10);</p><p> glVertex2f(31.03, -6.05);</p><p> glVertex2f(31.05, -10.03);</p><p> glVertex2f(29.06, -9.97);</p><p> glEnd();</p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p> ///Rail Line</p><p> ///N1B</p><p> glColor3ub(155, 29, 29);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(-12, 2);</p><p> glVertex2f(38, 3);</p><p> glVertex2f(37.98, 2.69);</p><p> glVertex2f(-11.98, 1.71);</p><p> glEnd();</p><p><br /></p><p><br /></p><p> glColor3ub(155, 29, 29);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(-12.07, 0.72);</p><p> glVertex2f(-12.07, 0.48);</p><p> glVertex2f(38.02, 1.52);</p><p> glVertex2f(38, 1.70);</p><p> glEnd();</p><p><br /></p><p><br /></p><p> glColor3ub(0, 0, 0);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(-8, 2.08);</p><p> glVertex2f(-7.64, 2.08);</p><p> glVertex2f(-7.63, 0.63);</p><p> glVertex2f(-8, 0.62);</p><p> glEnd();</p><p><br /></p><p> glColor3ub(0, 0, 0);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(0.97, 2.31);</p><p> glVertex2f(1.28, 2.27);</p><p> glVertex2f(1.34, 0.76);</p><p> glVertex2f(0.97, 0.75);</p><p> glEnd();</p><p><br /></p><p> glColor3ub(0, 0, 0);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(11.98, 2.48);</p><p> glVertex2f(12.48, 2.49);</p><p> glVertex2f(12.5, 1);</p><p> glVertex2f(11.98, 0.98);</p><p> glEnd();</p><p><br /></p><p> glColor3ub(0, 0, 0);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(25.45, 2.75);</p><p> glVertex2f(26.09, 2.76);</p><p> glVertex2f(26.09, 1.27);</p><p> glVertex2f(25.45, 1.26);</p><p> glEnd();</p><p><br /></p><p> glColor3ub(0, 0, 0);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(33.99, 2.92);</p><p> glVertex2f(34.48, 2.93);</p><p> glVertex2f(34.58, 1.45);</p><p> glVertex2f(34.03, 1.44);</p><p> glEnd();</p><p><br /></p><p> glColor3ub(0, 0, 0);</p><p> glBegin(GL_QUADS);</p><p> glVertex2f(18.39, 2.69);</p><p> glVertex2f(19.16, 2.62);</p><p> glVertex2f(19.18, 1.13);</p><p> glVertex2f(18.42, 1.11);</p><p> glEnd();</p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p> ///boat-1 speed left to right</p><p> glPushMatrix();</p><p> glTranslatef(moveB1, 0.0f, 0.0f);</p><p> glBegin(GL_QUADS);</p><p> glColor3ub(139,69,19);</p><p> glVertex2f(1.0f, -14.0f);</p><p> glVertex2f(1.50f, -13.0f);</p><p> glVertex2f(-2.0f, -13.0f);</p><p> glVertex2f(-3.0f, -14.0f);</p><p> glEnd();</p><p><br /></p><p> glBegin(GL_QUADS);</p><p> glColor3ub(0,0,0);</p><p> glVertex2f(2.0f, -14.5f);</p><p> glVertex2f(2.0f, -14.0f);</p><p> glVertex2f(-3.0f, -14.0f);</p><p> glVertex2f(-3.0f, -14.5f);</p><p> glEnd();</p><p><br /></p><p> glBegin(GL_TRIANGLES);</p><p> glColor3ub(0,0,0);</p><p> glVertex2f(-3.0f, -14.5f);</p><p> glVertex2f(-3.0f, -14.0f);</p><p> glVertex2f(-4.5f, -13.7f);</p><p><br /></p><p> glEnd();</p><p><br /></p><p> glBegin(GL_TRIANGLES);</p><p> glColor3ub(0,0,0);</p><p> glVertex2f(2.0f, -14.5f);</p><p> glVertex2f(3.5f, -13.7f);</p><p> glVertex2f(2.0f, -14.0f);</p><p><br /></p><p> glEnd();</p><p><br /></p><p> glBegin(GL_TRIANGLES);</p><p> glColor3ub(0,0,0);</p><p> glVertex2f(2.0f, -14.0f);</p><p> glVertex2f(1.5f, -13.0f);</p><p> glVertex2f(1.0f, -14.0f);</p><p><br /></p><p> glEnd();</p><p><br /></p><p> glPopMatrix();</p><p><br /></p><p><br /></p><p><br /></p><p> ///boat-2 motion right to left</p><p> glPushMatrix();</p><p> glTranslatef(moveB2, 0.0f, 0.0f);</p><p> glBegin(GL_QUADS);</p><p> glColor3ub(139,69,19);</p><p> glVertex2f(22.0f, -17.5f);</p><p> glVertex2f(21.0f, -16.5f);</p><p> glVertex2f(17.50f, -16.5f);</p><p> glVertex2f(18.0f, -17.5f);</p><p> glEnd();</p><p><br /></p><p> glBegin(GL_QUADS);</p><p> glColor3ub(0,0,0);</p><p> glVertex2f(22.0f, -18.0f);</p><p> glVertex2f(22.0f, -17.5f);</p><p> glVertex2f(17.0f, -17.5f);</p><p> glVertex2f(17.0f, -18.0f);</p><p> glEnd();</p><p><br /></p><p> glBegin(GL_QUADS);</p><p> glColor3ub(255,99,71);</p><p> glVertex2f(20.5f, -16.5f);</p><p> glVertex2f(21.0f, -14.5f);</p><p> glVertex2f(18.5f, -14.5f);</p><p> glVertex2f(18.0f, -16.5f);</p><p> glEnd();</p><p><br /></p><p> glBegin(GL_QUADS);</p><p> glColor3ub(139,69,19);</p><p> glVertex2f(19.8f, -14.5f);</p><p> glVertex2f(19.8f, -14.0f);</p><p> glVertex2f(19.7f, -14.0f);</p><p> glVertex2f(19.7f, -14.5f);</p><p> glEnd();</p><p><br /></p><p> glBegin(GL_TRIANGLES);</p><p> glColor3ub(0,0,0);</p><p> glVertex2f(17.0f, -18.0f);</p><p> glVertex2f(17.0f, -17.5f);</p><p> glVertex2f(15.5f, -17.2f);</p><p> glEnd();</p><p><br /></p><p> glBegin(GL_TRIANGLES);</p><p> glColor3ub(0,0,0);</p><p> glVertex2f(22.0f, -17.5f);</p><p> glVertex2f(22.0f, -18.0f);</p><p> glVertex2f(23.5f, -17.2f);</p><p> glEnd();</p><p><br /></p><p> glBegin(GL_TRIANGLES);</p><p> glColor3ub(0,0,0);</p><p> glVertex2f(17.0f, -17.5f);</p><p> glVertex2f(18.0f, -17.5f);</p><p> glVertex2f(17.5f, -16.5f);</p><p> glEnd();</p><p><br /></p><p> glPopMatrix();</p><p><br /></p><p><br /></p><p><br /></p><p> //end</p><p> glPopMatrix();</p><p> glutSwapBuffers();</p><p>}</p><p><br /></p><p><br /></p><p><br /></p><p>void updateC(int value)</p><p>{</p><p><br /></p><p> if(moveC > +36)</p><p> {</p><p> moveC = -38;</p><p> }</p><p> moveC += 0.15;</p><p><br /></p><p> glutTimerFunc(20, updateC, 0);</p><p> glutPostRedisplay();</p><p>}</p><p><br /></p><p><br /></p><p>void updateB1(int value)</p><p>{</p><p><br /></p><p> moveB1 += speed;</p><p> if(moveB1 > 38)</p><p> {</p><p> moveB1 = -38;</p><p> }</p><p><br /></p><p>// moveB1 += 0.17;</p><p><br /></p><p> glutTimerFunc(20, updateB1, 0); //Notify GLUT to call update again in 25 milliseconds</p><p> glutPostRedisplay();</p><p>}</p><p><br /></p><p><br /></p><p><br /></p><p>void updateB2(int value)</p><p>{</p><p><br /></p><p><br /></p><p> if(moveB2 < -36)</p><p> {</p><p> moveB2 = +38;</p><p> }</p><p> //Notify GLUT that the display has changed</p><p><br /></p><p> moveB2 -= 0.13;</p><p><br /></p><p> glutTimerFunc(20, updateB2, 0); //Notify GLUT to call update again in 25 milliseconds</p><p> glutPostRedisplay();</p><p>}</p><p><br /></p><p><br /></p><p><br /></p><p>void handleKeypress(unsigned char key, int x, int y)</p><p>{</p><p> switch (key)</p><p> {</p><p> case 's'://stops</p><p> speed = 0.0f;</p><p> break;</p><p> case 'r'://runs</p><p> speed = 0.02f;</p><p> break;</p><p> glutPostRedisplay();</p><p> }</p><p>}</p><p><br /></p><p><br /></p><p>void handleMouse(int button, int state, int x, int y)</p><p>{</p><p><br /></p><p> if (button == GLUT_LEFT_BUTTON)</p><p> {</p><p> speed += 0.05f;</p><p> }</p><p><br /></p><p><br /></p><p> else if (button == GLUT_RIGHT_BUTTON)</p><p> {</p><p> speed -= 0.05f;</p><p> }</p><p> glutPostRedisplay();</p><p>}</p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p>void display(void)</p><p>{</p><p> DrawAllComponents();</p><p> glFlush ();</p><p>}</p><p><br /></p><p>void init()</p><p>{</p><p><br /></p><p> glClearColor(0.0f, 0.0f, 0.0f, 0.0f);</p><p><br /></p><p>}</p><p><br /></p><p>int main(int argc, char** argv)</p><p>{</p><p> glutInit(&argc, argv);</p><p> glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);</p><p><br /></p><p> glutInitWindowSize(1300, 700);</p><p> glutInitWindowPosition(100,100);</p><p> glutCreateWindow(" Village Scenery ");</p><p> init();</p><p><br /></p><p> glutTimerFunc(100, updateC, 1); // cloud speed</p><p> glutTimerFunc(100, updateB1, 0); //Boat 1</p><p> glutTimerFunc(100, updateB2, 0); //boat 2</p><p><br /></p><p> glutKeyboardFunc(handleKeypress);</p><p> glutMouseFunc(handleMouse);</p><p> glutDisplayFunc(display);</p><p><br /></p><p> glutMainLoop();</p><p> return 0;</p><p>}</p><div><br /></div>Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-15848973637619608082023-12-25T02:18:00.000+05:302023-12-25T02:18:13.810+05:30Black Pearl - The Cursed Ship sailing Day Night Computer Graphics OpenGL Projects<p> </p><div style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-weight: inherit; line-height: 1.25em; margin: 30px 0px 0.7em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;"><span style="font-size: 1.875rem;">Problem Statement: </span>Create a program using C/C++ using OpenGL API for Black Pearl - The Cursed Ship which sail day night all day around.</div><div><h3 class="wp-block-heading" style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 1.5625rem; font-weight: inherit; line-height: 1.2em; margin: 30px 0px 20px; outline: 0px; padding: 0px; vertical-align: baseline;">Project Description:</h3></div>
<div style="clear: both; margin-bottom: 1em; margin-top: 0em;">This computer graphics project using OpenGL API is implemented using the C/C++ language. Computer graphics is concerned with all aspects of producing graphics pictures images using a computerprocessing with aspect of animation.</div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;">We have designed a ship inspired by Movie <a href="https://www.imdb.com/title/tt0325980/">Pirates of the Caribbean: The Curse of the Black Pearl</a> which sail from moring from early hour to late night.</div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="background-color: white;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">In this mini-project Black Pearl - The Cursed Ship is implemented by using OpenGL API’s glut library and other computer graphics concepts. </span></span><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">To make the project more interative, we have used different keyboard functions. The key board functions with different display to make the program user interactive.</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9UJ_EFHgVBNy23t0ldATaJegpg3EKvlU3TpMpUTsqoC-EtCxvvCXAkIdOeJysdFWxOUeHkUDhyMkYVwGphCwIvJdeTKPozVfEJJ0Wih-mNWGRr7s8ZqVD9e6s-UGKBgMEhPBz8V9WcVZ8QZ1Gcxa-SR78l_XALQF5av7m-JLSWiE15dK4mIuwliZ5tmpG/s714/Black%20Pearl%20-%20The%20Cursed%20Ship%20sailing%20Day%20Night%20Computer%20Graphics%20OpenGL%20Projects.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="714" data-original-width="597" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9UJ_EFHgVBNy23t0ldATaJegpg3EKvlU3TpMpUTsqoC-EtCxvvCXAkIdOeJysdFWxOUeHkUDhyMkYVwGphCwIvJdeTKPozVfEJJ0Wih-mNWGRr7s8ZqVD9e6s-UGKBgMEhPBz8V9WcVZ8QZ1Gcxa-SR78l_XALQF5av7m-JLSWiE15dK4mIuwliZ5tmpG/s320/Black%20Pearl%20-%20The%20Cursed%20Ship%20sailing%20Day%20Night%20Computer%20Graphics%20OpenGL%20Projects.png" width="268" /></a></div><br /><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">See also - </span></div><h3 class="post-title entry-title" itemprop="name" style="background-color: white; color: #666666; font-family: "Trebuchet MS", Trebuchet, Verdana, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; font-weight: normal; line-height: normal; margin: 0.75em 0px 0px; position: relative;"><a href="https://www.openglprojects.in/2016/11/the-voyage-opengl-projects-with-source.html" target="_blank">“The Voyage”- Opengl Projects with source code</a></h3><div><h3 class="post-title entry-title" itemprop="name" style="background-color: white; color: #666666; font-family: "Trebuchet MS", Trebuchet, Verdana, sans-serif; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size: 22px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; font-weight: normal; line-height: normal; margin: 0.75em 0px 0px; position: relative;"><a href="https://www.openglprojects.in/2014/12/opengl-source-code-ship-iceberg.html">Opengl Source Code Ship Iceberg Collision</a></h3></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><h3 class="wp-block-heading" style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 1.5625rem; font-weight: inherit; line-height: 1.2em; margin: 30px 0px 20px; outline: 0px; padding: 0px; vertical-align: baseline;">Coding:</h3><div>For Ship we have designed as - </div><div><br /></div><div><div>//base</div><div> glColor3f(0.2+col,0.2+col,0.2+col);</div><div> glBegin(GL_POLYGON);</div><div> glVertex2f(10,119);</div><div> glVertex2f(10,110);</div><div> glVertex2f(41,70);</div><div> glColor3f(0.3+col,0.3+col,0.8+col);</div><div> glVertex2f(219,42);</div><div> glVertex2f(292,98);</div><div> glVertex2f(300,110);</div><div> glEnd();</div><div><br /></div><div>//p1</div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(1.0+col,1.0+col,1.0+col);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glBegin(GL_POLYGON);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(35,118);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(35,128);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(0.5+col,0.5+col,0.5+col);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(239,131);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(239,111);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(35,119);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>//side</span></div><div> glBegin(GL_POLYGON);</div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(0.8+col,0.8+col,0.8+col);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(239,131);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(239,111);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(257,110);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(257,127);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></div><div><br /></div><div>//p2</div><div> glColor3f(0.0+col,0.0+col,0.5+col);</div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glBegin(GL_POLYGON);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(45,129);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(45,140);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(233,149);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(233,131);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></div><div> //side</div><div> glBegin(GL_POLYGON);</div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(0.1+col,0.1+col,0.8+col);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(233,149);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(233,131);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(254,128);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(254,145);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></div><div><br /></div><div>//p3</div><div> glColor3f(0.2+col,0.5+col,0.2+col);</div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glBegin(GL_POLYGON);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(51,151);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(51,140);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(221,149);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(0.9+col,0.6+col,0.3+col);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(221,165);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(51,151);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>//side</span></div><div> glBegin(GL_POLYGON);</div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(0.1+col,0.4+col,0.1+col);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(221,164);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(221,149);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(247,147);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(247,162);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></div><div><br /></div><div>//p4</div><div> //pipe1</div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(0.48+col,0.27+col,0.44+col);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glBegin(GL_POLYGON);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(79,152);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(79,194);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(94,194);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(0.0+col,0.0+col,0.0+col);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(94,155);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>cloud(59,194);</span></div><div><br /></div><div> //pipe2</div><div> glColor3f(0.44+col,0.48+col,0.27+col);</div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glBegin(GL_POLYGON);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(112,156);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(112,198);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(127,198);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(0.0+col,0.0+col,0.0+col);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(127,158);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>cloud(92,198);</span></div><div><br /></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>//pipe3</span></div><div> glColor3f(0.27+col,0.48+col,0.44+col);</div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glBegin(GL_POLYGON);</span></div><div> glVertex2f(159,161);</div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(159,203);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(179,203);</span></div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(0.0+col,0.0+col,0.0+col);</span></div><div> glVertex2f(179,160);</div><div><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></div></div><div><span style="white-space: normal;"><br /></span></div><div><span style="white-space: normal;">In this </span>Computer Graphics OpenGL Projects we have also included a rocket which fly in the sky. </div></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><h3 class="wp-block-heading" style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 1.5625rem; font-weight: inherit; line-height: 1.2em; margin: 30px 0px 20px; outline: 0px; padding: 0px; vertical-align: baseline;">User Interaction:</h3></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="background-color: white; color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 16px;">By using the keyboard interface, we have performed the required action for user interaction for a better interface. The functionality of various keyboard key implement in this program is listed as below :</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="background-color: white; color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 16px;"><div style="clear: both; margin-bottom: 1em; margin-top: 0em;">z -> Shoot rocket</div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;">y -> Early Morning</div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;">m -> Morning</div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;">a -> Afternoon</div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;">e -> Evening</div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;">n -> Night</div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;">d -> Mid Night</div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;">Num 6 -> Moving Ship Fwd</div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;">Num 4 -> Moving Ship bckwd</div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;">Esc -> Exit</div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;">Left Arrow -> Moving Ship backward</div></span><span style="background-color: white;"><div style="clear: both; color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 16px; margin-bottom: 1em; margin-top: 0em;">Right Arrow -> Moving Ship Forward</div><h3 style="clear: both; color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 16px; margin-bottom: 1em; margin-top: 0em; text-align: left;">Improvement -</h3><div style="clear: both; color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 16px; margin-bottom: 1em; margin-top: 0em;">You can add the pirate flag to make it look much better. Also rocket in the sky can be allow to hit the ship and it will avoid the damage</div><h1 style="clear: both; color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 16px; margin-bottom: 1em; margin-top: 0em; text-align: left;">Source Code - </h1><div style="clear: both; color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 16px; margin-bottom: 1em; margin-top: 0em;">Find the source code mentioned below -</div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">#include <windows.h></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">#include<GL/glut.h></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">#include <stdlib.h></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">#include <stdio.h></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">#include <math.h></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">float pos=0,x=0,col=0,i,p,c,cf=0,pr,pl=0;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">int screen=0;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">//Introduction Page</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">char name[35]="Black Pearl - The Cursed Ship";</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">char college[100]="Institute of Technology";</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">char dept[100]="Department of Computer Science & Engineering";</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">char heading[100]="Made by Guides";</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">char row1[100]=" Prof. ";</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">char row2[100]=" Prof.";</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">char emsg[100]="Press ENTER to start";</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">char title[50]="Sailing of Ship Day And NighT...!";</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">char dash[100]="--------------------------------------------------------------------------------------";</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">void frontscreen(void)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">{</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glPushMatrix();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glTranslatef(50,100,0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glClearColor(0.8,0.8,1.0,1.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> int s;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glClear(GL_COLOR_BUFFER_BIT);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glRasterPos2i(184,480); //displays college name</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> for(s=0;college[s]!='\0';s++)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.0,0.0,1.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24,college[s]);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glRasterPos2i(180,450); //displays dept.</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> for(s=0;dept[s]!='\0';s++)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(1.0,0.0,0.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24,dept[s]);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glRasterPos2i(210,380); //displays project name</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> for(s=0;title[s]!='\0';s++)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.0,0.0,0.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24,title[s]);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glRasterPos2i(155,370); //displays dashes</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> for(s=0;dash[s]!='\0';s++)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.0,0.0,0.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutBitmapCharacter(GLUT_BITMAP_9_BY_15,dash[s]);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glRasterPos2i(170,340); //displays heading of table</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> for(s=0;heading[s]!='\0';s++)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.0,0.0,0.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24,heading[s]);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glRasterPos2i(155,330); //displays dashes</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> for(s=0;dash[s]!='\0';s++)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.0,0.0,0.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutBitmapCharacter(GLUT_BITMAP_9_BY_15,dash[s]);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glRasterPos2i(170,310); //displays 1st row in table</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> for(s=0;row1[s]!='\0';s++)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.0,0.0,0.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24,row1[s]);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glRasterPos2i(170,290); //displays 2nd row in table</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> for(s=0;row2[s]!='\0';s++)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.0,0.0,0.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24,row2[s]);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glRasterPos2i(155,270); //displays dashes</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> for(s=0;dash[s]!='\0';s++)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.0,0.0,0.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutBitmapCharacter(GLUT_BITMAP_9_BY_15,dash[s]);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glRasterPos2i(200,100); //displays "enter msg"</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> for(s=0;emsg[s]!='\0';s++)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(1.0,0.0,0.5);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24,emsg[s]);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glPopMatrix();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glFlush();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">}</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">//sun/moon</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">void Drawarc(float sa,float ea,float cx,float cy,float rd)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">{</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> float PI = 3.14;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> float step=1.0;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> float angle,x=0,y=0,centerX=cx,centerY=cy,radius=rd;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glBegin(GL_POLYGON);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> for(angle=sa;angle<ea; angle+=step)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> float rad ;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> rad = PI*angle/180;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> x = centerX+radius*cos(rad);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> y = centerY+radius*sin(rad);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(x,y);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glEnd();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glFlush();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">}</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">//smoke</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">void cloud(int m, int n)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">{</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> for(c=p=0;c<31;c+=10,p-=1)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.5,0.5,0.5);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> Drawarc(0,360,m+c,n,10+p);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">}</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">void ship(float x)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">{</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glPushMatrix();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glTranslatef(x,0,0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">//base</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.2+col,0.2+col,0.2+col);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glBegin(GL_POLYGON);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(10,119);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(10,110);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(41,70);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.3+col,0.3+col,0.8+col);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(219,42);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(292,98);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(300,110);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glEnd();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">//p1</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(1.0+col,1.0+col,1.0+col);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glBegin(GL_POLYGON);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(35,118);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(35,128);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(0.5+col,0.5+col,0.5+col);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(239,131);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(239,111);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(35,119);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>//side</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glBegin(GL_POLYGON);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(0.8+col,0.8+col,0.8+col);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(239,131);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(239,111);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(257,110);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(257,127);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">//p2</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.0+col,0.0+col,0.5+col);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glBegin(GL_POLYGON);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(45,129);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(45,140);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(233,149);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(233,131);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> //side</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glBegin(GL_POLYGON);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(0.1+col,0.1+col,0.8+col);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(233,149);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(233,131);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(254,128);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(254,145);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">//p3</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.2+col,0.5+col,0.2+col);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glBegin(GL_POLYGON);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(51,151);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(51,140);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(221,149);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(0.9+col,0.6+col,0.3+col);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(221,165);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(51,151);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>//side</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glBegin(GL_POLYGON);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(0.1+col,0.4+col,0.1+col);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(221,164);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(221,149);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(247,147);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(247,162);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">//p4</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> //pipe1</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(0.48+col,0.27+col,0.44+col);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glBegin(GL_POLYGON);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(79,152);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(79,194);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(94,194);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(0.0+col,0.0+col,0.0+col);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(94,155);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>cloud(59,194);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> //pipe2</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.44+col,0.48+col,0.27+col);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glBegin(GL_POLYGON);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(112,156);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(112,198);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(127,198);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(0.0+col,0.0+col,0.0+col);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(127,158);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>cloud(92,198);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>//pipe3</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.27+col,0.48+col,0.44+col);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glBegin(GL_POLYGON);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(159,161);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(159,203);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glVertex2f(179,203);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glColor3f(0.0+col,0.0+col,0.0+col);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(179,160);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>cloud(144,203);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glPopMatrix();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">}</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">void water()</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">{</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glBegin(GL_POLYGON);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.2+col,0.2+col,0.6+col);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(00,00);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(00,300);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(1024,300);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(1024,00);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glEnd();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">}</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">void mountain2()</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">{</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> float a,b;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.6+col,0.4+col,0.2+col);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> for(a=0,b=300;a<1025;a=a+80)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glBegin(GL_POLYGON);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(-40+a,b);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(10+a,b+140);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(60+a,b);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glEnd();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">}</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">void mountain()</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">{</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> float a,b;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.8+col,0.6+col,0.4+col);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> for(a=0,b=300;a<1025;a=a+80)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glBegin(GL_POLYGON);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(0+a,b);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(50+a,b+100);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(100+a,b);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glEnd();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">}</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">void mountain3()</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">{</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> float a,b;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.4+col,0.2+col,0.0+col);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> for(a=0,b=350;a<1025;a=a+80)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glBegin(GL_POLYGON);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(0+a,b);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(50+a,b+180);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(100+a,b);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glEnd();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">}</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">void flag(float x)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">{</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> int s;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glPushMatrix();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glTranslatef(x,0,0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.0,0.0,0.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glBegin(GL_POLYGON);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(245,160);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(245,250);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(242,250);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(242,160);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glEnd();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.8,0.1,0.1);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glBegin(GL_POLYGON);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(245,250);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(275,215);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(245,180);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glEnd();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glRasterPos2i(50,80); //displays college name</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> for(s=0;college[s]!='\0';s++)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(1.0,1.0,1.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24,name[s]);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glPopMatrix();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">}</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">void crackers()</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">{</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> // if(cf==1)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(1,0,0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glBegin(GL_POLYGON);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(100+pos,100+pr);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(100+pos,110+pr);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(101+pos,110+pr);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glVertex2f(101+pos,100+pr);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glEnd();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glFlush();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutPostRedisplay();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">}</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">void init()</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">{</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glClearColor(0.0,0.0,0.0,1.0);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glLoadIdentity();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>gluOrtho2D(0,1024,0,768);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">}</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">void plane()</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">{</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glPushMatrix();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glTranslatef(0+pl,700,0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glColor3f(0.0,0.0,0.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glBegin(GL_POLYGON);//rectangular body</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(0.0,30.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(0.0,55.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(135.0/3,55.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glColor3f(1.0,0.0,0.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(135.0/3,30.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glEnd();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glColor3f(0.0,0.0,0.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glBegin(GL_POLYGON);//upper triangle construction plane</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(135.0/3,55.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(150.0/3,50.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(155.0/3,45.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(160.0/3,40.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(135.0/3,40.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glEnd();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glColor3f(0.0,0.0,0.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glBegin(GL_LINE_LOOP);//outline of upper triangle plane</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(135.0/3,55.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(150.0/3,50.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(155.0/3,45.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(160.0/3,40.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(135.0/3,40.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glEnd();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glColor3f(1.0,0.0,0.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glBegin(GL_POLYGON);//lower triangle</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(135.0/3,40.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(160.0/3,40.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(160.0/3,37.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(145.0/3,30.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(135.0/3,30.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glEnd();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glColor3f(1.0,0.0,0.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glBegin(GL_POLYGON);//back wing</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(0.0,55.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(0.0,80.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(10.0/3,80.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(40.0/3,55.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glEnd();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glColor3f(1.0,0.0,0.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glBegin(GL_POLYGON);//left side wing</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(65.0/3,55.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(50.0/3,70.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(75.0/3,70.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(90.0/3,55.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glEnd();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glColor3f(1.0,0.0,0.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glBegin(GL_POLYGON);//rightside wing</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(70.0/3,40.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(100.0/3,40.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(80.0/3,15.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glVertex2f(50.0/3,15.0/3);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glEnd();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">glPopMatrix();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">}</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">void display()</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">{</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glClear(GL_COLOR_BUFFER_BIT);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> if(screen==0)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> frontscreen();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glFlush();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> else if(screen==1)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>{</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> mountain3();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>mountain2();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>mountain();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>water();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span> if(cf==1)</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> crackers();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>pr+=2;</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>ship(pos);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>flag(pos);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>plane();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>pl+=2;</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>if(pl==1200)</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>pl=0;</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> if(i==1)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.9,0.9,0.5);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> Drawarc(0,360,200,700,10);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> if(i==2)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(0.8,0.7,0.4);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> Drawarc(0,360,400,700,10);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> if(i==3)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(1.0,1.0,1.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> Drawarc(0,360,600,700,10);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> if(i==4)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glColor3f(1.0,1.0,1.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> Drawarc(0,360,800,700,10);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glFlush();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutPostRedisplay();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutSwapBuffers();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glFlush();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">}</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">void keyboard(unsigned char key, int x, int y)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">{</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> switch (key)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> case 13:if(screen==0)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> {</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> screen=1;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutPostRedisplay();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> break;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> case 27:exit (0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span> break;</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> case 'y':glClearColor(0.8,0.5,0.4,1.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> col=-0.1;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> i=0;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutPostRedisplay();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span> break;</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> case 'm':glClearColor(0.5,0.5,1.0,1.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> i=1;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> col=0.2;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutPostRedisplay();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span> break;</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> case 'a':glClearColor(0.9,0.9,0.3,1.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> i=2;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> col=0.3;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutPostRedisplay();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span> break;</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> case 'e':glClearColor(0.8,0.5,0.4,1.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> col=-0.1;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> i=0;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutPostRedisplay();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span> break;</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> case 'n':glClearColor(0.5,0.5,0.5,1.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> i=3;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutPostRedisplay();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> col=-0.2;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> <span style="white-space: pre;"> </span> break;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> case 'd':glClearColor(0.0,0.0,0.0,0.0);</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> i=4;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> col=-0.3;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutPostRedisplay();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span> break;</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> case '6':pos+=2;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> break;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> case '4':pos-=2;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> break;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> case 'z':cf=1;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> pr=0;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> glutPostRedisplay();</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> break;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"> }</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">}</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">void SpecialInput(int key, int x, int y)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">{</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">switch(key)</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">{</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">case GLUT_KEY_UP:</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">break;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">case GLUT_KEY_DOWN:</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">break;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">case GLUT_KEY_LEFT:</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">pos-=2;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">break;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">case GLUT_KEY_RIGHT:</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">pos+=2;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">break;</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">}</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">}</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><br /></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">int main()</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">{</span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glutInitWindowSize(1024,768);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glutInitWindowPosition(0,0);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glutCreateWindow("Black Pearl - The Cursed Ship");</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glutSwapBuffers();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glutKeyboardFunc(keyboard);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glutDisplayFunc(display);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glutSpecialFunc(SpecialInput);</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>init();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;"><span style="white-space: normal;"><span style="white-space: pre;"> </span>glutMainLoop();</span></span></div><div style="clear: both; margin-bottom: 1em; margin-top: 0em;"><span style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;">}</span></div><div style="color: #3a3a3a; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 16px;"><br /></div></div></span></div>Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-66055378710853387112023-03-12T02:58:00.001+05:302023-03-12T03:11:42.133+05:30Satellites Launch Mini Projects OpenGL Computer graphics<div style="text-align: justify;">ISRO has made our county proud. They have lauched so many sattelites into the sapce for tele communication, sciencetific discovery, defence, remote sensing, meteorolog etc. In this article we are going to code satellite launch mini projects using opengl computer graphcis in c/c++. </div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">We launch satellites into space by putting them on rockets. The rockets carrying satellites launch via a luching station through tons of propellants (fules of rocket). The propellants provide energy to the rocket to get out of Earth gravity 's pull (Speed is called escape velocity). Rocket with even thrust get into space at mutliple stages. The final stage of the rocket is to place the satellite into it orbit.</div><div style="text-align: justify;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzApOTQUQUDaGGRW3bSl9DWL9NsIIvG2x3FzIdo9k95OpvCTjoYNWENk3sI3W4S9bHdz0Dzjg0EWLPoYR1GaJeC3OcoQYvJ7RhKtd1l7uLZPmZzGhGxVE73vORNrQbEB4MkHLG2PUju5E5TJvyr5c2nIsAtIlUnphaaQ6LorDbVYBfCPFl4h3oC2tWig/s1279/Satellites%20Launch%20Mini%20Projects%20OpenGL%20Computer%20graphics.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Satellites Launch Mini Projects OpenGL Computer graphics" border="0" data-original-height="725" data-original-width="1279" height="226" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzApOTQUQUDaGGRW3bSl9DWL9NsIIvG2x3FzIdo9k95OpvCTjoYNWENk3sI3W4S9bHdz0Dzjg0EWLPoYR1GaJeC3OcoQYvJ7RhKtd1l7uLZPmZzGhGxVE73vORNrQbEB4MkHLG2PUju5E5TJvyr5c2nIsAtIlUnphaaQ6LorDbVYBfCPFl4h3oC2tWig/w400-h226/Satellites%20Launch%20Mini%20Projects%20OpenGL%20Computer%20graphics.jpg" title="Satellites Launch Mini Projects OpenGL Computer graphics" width="400" /></a></div><br /><div style="text-align: justify;"><br /></div><h1 style="text-align: justify;">Aim of the Mini Projects</h1><div style="text-align: justify;">The aim of this Satellites Launch Mini Projects with OpenGL Computer graphics is to simulate the lauch if satellites using the opengl functions and codes. We are going to create the Earth, rocket, satellites using opengl and simulate the actual lauching of satellites.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><br /></div><h1 style="text-align: justify;">Design and Implementation </h1><div>1. Drawing of Earth - </div><div><br /></div><div>2. Drawing of Rocket-</div><div><br /></div><div>3. Drawing of Satellite - </div><div><br /></div><div><h3 style="text-align: left;"><b>Do You Know? </b></h3><div><br /></div><div>ISRO have <a href="https://www.isro.gov.in/Student_Program_Satellite.html" target="_blank">student satellite program</a>.
Students who want to working in space technology may develope the payload for satellites with the help of ISRO through thier university.</div></div><div><br /></div><div><h1 style="text-align: left;">User Interaction in the program</h1><div>The Satellites Launch Mini Projects OpenGL Computer graphics program includes interaction through keyboard as mentioned below -</div><div><br /></div><div>P - Launch the rocket</div><div>Q- Quit</div></div><div><br /></div><h1 style="text-align: left;">Download the source of Mini Projects OpenGL</h1>Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-39844001885576155702023-02-18T23:15:00.005+05:302023-02-18T23:15:52.718+05:30Create Pendulum in OpenGL Computer Graphics Program<div style="text-align: justify;">We have created many simple programs using OpenGL C/C++ in this blog. In this post we are going to create another simple opengl program. We are creating a simple pendulum. You can use these code as base to create a project particlualry based on the use of pendulum.</div><h1 style="text-align: left;">Introduction </h1><div style="text-align: justify;">A pendulum can be define as a certain mass of object tied from a pivot that can swings back and forth due to force of gravity. The Pendulum swing at the same distance in both the directions. The angle made by pendulum from the centre on bothe side are equal and called amplitude of pendulum.</div><div style="text-align: justify;"><br /></div><h1 style="text-align: justify;">Design and Code</h1><div>This simple pendulum opengl graphics program we are going to code will have two things - circle and lines. We are going to create a simple circle as clock and attache thread to it with a small circle to it. We will swing the circle right and left from the center point of it attachement with thread.</div><div><br /></div><div style="text-align: center;"><a href="https://www.openglprojects.in/2014/03/draw-circle-opengl.html#gsc.tab=0" target="_blank">Learn how to draw a circle in opengl</a></div><div style="text-align: center;"><br /></div><div style="text-align: justify;">First in this computer graphics program we are going to write a function for coding circles. We are goint to name this functions as drawcircle. The function will have four arguments segments, radius, x, y. As name suggest these are angle (segments), radius of thread, x and y coordinates.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><div>float drawCircle(float segments,float radius,float sx,float sy)</div><div>{</div><div> glBegin(GL_LINE_LOOP);</div><div> for(int i=0;i<segments;i++)</div><div> {</div><div> float theta=2.0*3.142*float(i)/float(segments); //get the current angle</div><div> float x=radius*cos(theta);</div><div> float y=radius*sin(theta);</div><div> glVertex2f(x+sx,y+sy);</div><div> }</div><div> glEnd();</div><div>}</div><div><br /></div><div>Now we are going to draw the pendulum with the help of draw functions which looks like - </div><div><br /></div><div><div>void draw(float x1,float y1,float angle)</div><div>{</div><div> float segments=100;</div><div> float radius=6.0;</div><div><br /></div><div> //Drawing Clock main Circle</div><div> glLineWidth(4);</div><div> glColor3f(1,0,0);</div><div> drawCircle(segments,radius,x1,y1);</div><div><br /></div><div> //Drawing Minute Line</div><div> glColor3f(1,1,0);</div><div> glLineWidth(2);</div><div> glBegin(GL_LINES);</div><div> glVertex2f(x1,y1);</div><div> glVertex2f(x1,(radius/3.0)*2.0);</div><div> glEnd();</div><div><br /></div><div> //Drawing Hour Line</div><div> glColor3f(1,0,0);</div><div> glLineWidth(2);</div><div> glBegin(GL_LINES);</div><div> glVertex2f(x1,y1);</div><div> glVertex2f(radius/3.0,radius/3.0);</div><div> glEnd();</div><div> //Drawing Pendulum Circle</div><div> double radians=angle*3.142/180;</div><div> float x2=(radius*3.4)*cos(radians);</div><div> float y2=(radius*3.4)*sin(radians);</div><div> float radius2=radius/3.0;</div><div><br /></div><div> glColor3f(0,0,1);</div><div> //glLineWidth(2);</div><div> drawCircle(segments,radius2,x2,y2);</div><div><br /></div><div> glBegin(GL_LINES);</div><div> glVertex2f(x1,-1*(radius)+0.2);</div><div> glVertex2f(x2,y2);</div><div> glEnd();</div><div>}</div></div><div><br /></div><div>In above opengl computer graphics program code we have drawn a <a href="https://www.openglprojects.in/2012/04/mini-project-on-clock-using-opengl.html#gsc.tab=0">simple clock</a> with hour and minute hands.You may skip therse as they are just to make this program look realstic and more sensible. In last few line we were able to draw the pendulum circle and the thread with the help of circle functions above and GL_LINES. </div><div><br /></div><div>As we have the draw function we applying the below logic to make the right and left movment of pendulum and thread.</div><div><br /></div><div><div>if(angle>315)</div><div>{</div><div>angle=315;</div><div>inc=-inc;</div><div>}</div><div>if(angle<225)</div><div>{</div><div>angle=225;</div><div>inc=-inc;</div><div>}</div></div><div><br /></div><div>We are going to place all the code in display function and then create the main functions. You can see the output below.</div><h1>Outpu Pendulum OpenGL Program</h1></div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI8QBF7CEgFlFluirFYSUtSf_7jLbKVxevEMKRVqcd07WzIUvegvGN-yfhd_8zOh85D397UoOvRr4qmApDieVWUsl098c82ZaCnQuvLhOWqxTwXXuafymciCQWbGBOiIwTwraO6GHiFg-voPxDeN6YAii6lx2-Qj9z6O5TaxlPPsPEH3YwEoDXBEzLqA/s561/Pendulum%20in%20OpenGL%20Computer%20Graphics%20Program.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="521" data-original-width="561" height="297" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI8QBF7CEgFlFluirFYSUtSf_7jLbKVxevEMKRVqcd07WzIUvegvGN-yfhd_8zOh85D397UoOvRr4qmApDieVWUsl098c82ZaCnQuvLhOWqxTwXXuafymciCQWbGBOiIwTwraO6GHiFg-voPxDeN6YAii6lx2-Qj9z6O5TaxlPPsPEH3YwEoDXBEzLqA/s320/Pendulum%20in%20OpenGL%20Computer%20Graphics%20Program.jpg" width="320" /></a></div><br /><div><br /></div><div><br /></div><h1 style="text-align: left;">Projects Suggestion</h1><div>1. Simple Old Mechanical <a href="https://www.openglprojects.in/2015/03/time-zone-opengl-c-graphics-projects.html#gsc.tab=0">Clock</a></div><div>2. Clock tower with long pendulam Clock</div><div>3. Different kinds of swings</div><div>4. Circus swings with jokers</div><div>5. Amusment park with swings </div><h1 style="text-align: left;">Download </h1><div>Get the full code of the </div><div></div>
<div class="download_code"><a class="btn_left" href="https://drive.google.com/file/d/1tpBPr_jS4OkUIKwYA3dItK5n4UdoZUPG/view?usp=share_link" target="_blank">Download source code</a></div>Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-40856180323895214952023-02-05T23:53:00.002+05:302023-02-05T23:53:23.616+05:30Atom Simulation - computer graphics projects with source code<p>Download the project Atom Simulation - computer graphics projects with source code file. The Atom simulation is OpenGL computer graphics projects uses a single window.</p><p><span style="background-color: white; color: #202020; font-family: "Nunito Sans", sans-serif; font-size: 14px;">OpenGL (Open Graphics Library) is a cross-platform, industry-standard graphics API used for creating 3D applications and games. It provides a set of commands for drawing 2D and 3D objects, as well as managing the rendering pipeline, lighting, shading, and texturing.</span></p><p><span style="background-color: white; color: #202020; font-family: "Nunito Sans", sans-serif; font-size: 14px;">One of the advantages of using OpenGL is that it provides a low-level interface to the graphics hardware, which means that it can be used on a variety of platforms, including Windows, macOS, Linux, and mobile devices. It also allows developers to take advantage of the latest hardware advancements and performance optimizations.</span></p><p>This is the Atom simulation: This window contains all content that is the menu bar and display of the simulation.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://user-images.githubusercontent.com/70787887/128596742-17ab830e-ea83-4afc-acfd-183c370d7486.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="723" data-original-width="800" height="723" src="https://user-images.githubusercontent.com/70787887/128596742-17ab830e-ea83-4afc-acfd-183c370d7486.png" width="800" /></a></div><br /><p><br /></p><p>This window is used for all events and for this project.</p><p>In this window, we display the simulation of the 10 atoms of the periodic table.</p><p>And all mouse and keyboard events triggered in window.</p><p>All labels and information about the model displayed on this window.</p><p><br /></p><div><br /></div>Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-39193946238784687842022-07-11T01:16:00.005+05:302022-07-11T01:16:55.165+05:30Simple City Scenery Opengl Computer Graphics Project<p><span face="Arial, Helvetica, sans-serif" style="color: #4b4949; font-size: 13.8px;">In this blogpost we are going to show you simple scenery opengl computer graphics project with source code. We are going to code a simple scenery use the opengl graphics library using c/c++.</span></p><h2 class="subtitle" style="color: #6ea6af; font-family: arial, helvetica, sans-serif; font-size: 1.7em; line-height: 1.3em; margin: 0px 0px 0.7em;">Aim of the Project</h2><div><p style="color: #4b4949; font-family: Arial, Helvetica, sans-serif; font-size: 13.8px; margin: 0px 0px 0.75em;">As said above we aim to create a scenery but big question is which type of scenery and what will be shown.</p><p style="color: #4b4949; font-family: Arial, Helvetica, sans-serif; font-size: 13.8px; margin: 0px 0px 0.75em;">We are going to create mountains with Sun/Moon in sky. There is one road crossing the mountain. We also going to draw tall buildings, traffic light signals and tower. There will be two mode in the scenery - day and night. In day light scene in sky sun will be display along with some birds fluying around. In the night scene we have moon and airplane flying in the sky along star twinkling.</p><p style="color: #4b4949; font-family: Arial, Helvetica, sans-serif; font-size: 13.8px; margin: 0px 0px 0.75em;">In both day and night scene, there is bus running on the road and clouds roaming in sky. Color of sky will be skyblue in day and black-opaque in night. Cloud will be white color. Road will be in black color along with some white strips.</p><p style="color: #4b4949; font-family: Arial, Helvetica, sans-serif; font-size: 13.8px; margin: 0px 0px 0.75em;"><span style="font-size: 13.8px;">Few Lines from song "City Of Stars" - Movie:</span><span style="font-size: 13.8px;"> </span><strong style="font-size: 13.8px;">La La Land</strong></p><div class="full module moduleCallout" id="mod_52512547" style="clear: left; color: #4b4949; font-family: Arial, Helvetica, sans-serif; font-size: 13.8px; margin-bottom: 1.3em; overflow-wrap: break-word; word-break: break-word;"><div id="52512547_callout"><div class="callout colorbox" style="background: rgba(215, 215, 215, 0.77); border-radius: 10px; clear: both; line-height: 2em; margin: auto; padding: 20px 25px; text-align: center; width: 416px;"><p style="font-size: 1.2em; margin: 0px;">City of stars</p><p style="font-size: 1.2em; margin: 0px;">Are you shining just for me?</p><p style="font-size: 1.2em; margin: 0px;">City of stars</p><p style="font-size: 1.2em; margin: 0px;">There's so much that I can't see</p></div></div></div><div class="full module moduleText" id="mod_52535942" style="clear: left; color: #4b4949; font-family: Arial, Helvetica, sans-serif; font-size: 13.8px; margin-bottom: 1.3em; overflow-wrap: break-word; word-break: break-word;"><div class="txtd" id="txtd_52535942"><h2 class="subtitle" style="color: #6ea6af; font-family: arial, helvetica, sans-serif; font-size: 1.7em; line-height: 1.3em; margin: 0px 0px 0.7em;">Implementation of computer graphics project</h2><div><div class="full module moduleText" id="mod_52512548" style="clear: left; font-size: 13.8px; margin-bottom: 1.3em; overflow-wrap: break-word; word-break: break-word;"><div class="txtd" id="txtd_52512548"><p style="margin: 0px 0px 0.75em;">This project uses different OpenGL functions to create different objects.</p><p style="margin: 0px 0px 0.75em;"><strong>Coding for Sun</strong></p><p style="margin: 0px 0px 0.75em;">glLoadIdentity();<br />glBegin(GL_POLYGON);<br />glColor3ub(255.0f, 255.0f, 128.0f);<br />float angle10;<br />for (int i=0;i<360;i++)<br />{<br />angle10=i*3.1416/180;<br />glVertex2f(0.0+0.12*cos(angle10),0.9+0.12*sin(angle10));</p><p style="margin: 0px 0px 0.75em;">}<br />glEnd();</p><p style="margin: 0px 0px 0.75em;"><strong>Coding for Moon</strong></p><p style="margin: 0px 0px 0.75em;"><br />glLoadIdentity();<br />glBegin(GL_POLYGON);<br />glColor3ub(255, 255, 255);<br />GLfloat x5=.7f;<br />GLfloat y5=.7f;<br />GLfloat radius5 =.07f;<br />GLfloat twicePi5 = 2.0f * PI;<br />GLfloat triangleAmount5=100;<br />glBegin(GL_TRIANGLE_FAN);<br />glVertex2f(x5, y5); // center of circle<br />for(int i = 0; i <= triangleAmount5; i++)<br />{<br />glVertex2f(<br />x5 + (radius5 * cos(i * twicePi5 / triangleAmount5)),<br />y5 + (radius5 * sin(i * twicePi5 / triangleAmount5))<br />);<br />}<br />glEnd();</p><p style="margin: 0px 0px 0.75em;">Code for Airplane</p><p style="margin: 0px 0px 0.75em;"><br /></p><p style="margin: 0px 0px 0.75em;">glLoadIdentity();</p><p style="margin: 0px 0px 0.75em;"><br />glPushMatrix();<br />glScalef(0.4,0.4,0);<br />glTranslatef(0.0f,1.5f, 0.0f);<br />glTranslatef(position6, 0.0f, 0.0f);</p><p style="margin: 0px 0px 0.75em;">glBegin(GL_POLYGON); // airplane outer body<br />glColor3ub(234, 229, 229); // white<br />glVertex2f(-0.3f, 0.2f);<br />glVertex2f(0.3f, 0.2f);<br />glVertex2f(0.4f, 0.3f);<br />glVertex2f(0.45f, 0.4f);<br />glVertex2f(0.45f, 0.5f);<br />glVertex2f(0.3f, 0.4f);<br />glVertex2f(0.0f, 0.4f);<br />glVertex2f(-0.2f, 0.4f);<br />glVertex2f(-0.3f, 0.4f);<br />glVertex2f(-0.35f, 0.38f);<br />glVertex2f(-0.4f, 0.3f);<br />glVertex2f(-0.35f, 0.23f);<br />glVertex2f(-0.3f, 0.2f);<br />glEnd();<br />glBegin(GL_POLYGON); // airplane front window<br />glColor3ub(117, 69, 160); // purple one<br />glVertex2f(-0.37f, 0.35f);<br />glVertex2f(-0.32f, 0.35f);<br />glVertex2f(-0.3f, 0.36f);<br />glVertex2f(-0.3f, 0.38f);<br />glVertex2f(-0.35f, 0.38f);<br />glEnd();<br />glBegin(GL_LINES); // airplane front window<br />glColor3ub(255, 255, 255); // white<br />glVertex2f(-0.35f, 0.35f);<br />glVertex2f(-0.33f, 0.38f);<br />glVertex2f(-0.33f, 0.35f);<br />glVertex2f(-0.31f, 0.38f);<br />glEnd();<br />glBegin(GL_LINES); // airplane front door<br />glColor3ub(144, 126, 181); // purple one<br />glVertex2f(-0.25f, 0.26f);<br />glVertex2f(-0.23f, 0.24f);<br />glVertex2f(-0.23f, 0.24f);<br />glVertex2f(-0.18f, 0.24f);<br />glVertex2f(-0.18f, 0.24f);<br />glVertex2f(-0.16f, 0.26f);<br />glVertex2f(-0.16f, 0.26f);<br />glVertex2f(-0.16f, 0.36f);<br />glVertex2f(-0.16f, 0.36f);<br />glVertex2f(-0.18f, 0.38f);<br />glVertex2f(-0.18f, 0.38f);<br />glVertex2f(-0.23f, 0.38f);<br />glVertex2f(-0.23f, 0.38f);<br />glVertex2f(-0.25f, 0.36f);<br />glVertex2f(-0.25f, 0.36f);<br />glVertex2f(-0.25f, 0.26f);<br />glEnd();<br />glBegin(GL_QUADS); // Airplane front wind<br />glColor3ub(117, 69, 160); // purple one<br />glVertex2f(0.02f, 0.15f);<br />glVertex2f(0.05f, 0.15f);<br />glVertex2f(-0.03f, 0.26f);<br />glVertex2f(-0.1f, 0.26f);<br />glEnd();<br />glBegin(GL_QUADS); // Airplane back wind<br />glColor3ub(117, 69, 160); // purple one<br />glVertex2f(-0.08f, 0.4f);<br />glVertex2f(0.0f, 0.4f);<br />glVertex2f(0.07f, 0.49f);<br />glVertex2f(0.04f, 0.49f);<br />glEnd();<br />// Airplane window<br />glColor3ub(117, 69, 160); // purple one<br />GLfloat x2=-0.09f;<br />GLfloat y2=0.35f;<br />GLfloat radius1 =.02f;<br />int triangleAmount1 = 100;<br />GLfloat twicePi1 = 2.0f * PI;<br />glBegin(GL_TRIANGLE_FAN);<br />glVertex2f(x2, y2); // center of circle<br />for(int i = 0; i <= triangleAmount1; i++)<br />{<br />glVertex2f(<br />x2 + (radius1 * cos(i * twicePi1 / triangleAmount1)),<br />y2 + (radius1 * sin(i * twicePi1 / triangleAmount1))<br />);<br />}<br />glEnd();<br />// Airplane window<br />glColor3ub(117, 69, 160); // purple one<br />GLfloat x3=-0.02f;<br />GLfloat y3=0.35f;<br />radius1 =.02f;<br />twicePi1 = 2.0f * PI;<br />glBegin(GL_TRIANGLE_FAN);<br />glVertex2f(x3, y3); // center of circle<br />for(int i = 0; i <= triangleAmount1; i++)<br />{<br />glVertex2f(<br />x3 + (radius1 * cos(i * twicePi1 / triangleAmount1)),<br />y3 + (radius1 * sin(i * twicePi1 / triangleAmount1))<br />);<br />}<br />glEnd();<br />// Airplane window<br />glColor3ub(117, 69, 160); // purple one<br />GLfloat x4=0.06f;<br />GLfloat y4=0.35f;<br />radius1 =.02f;<br />twicePi1 = 2.0f * PI;<br />glBegin(GL_TRIANGLE_FAN);<br />glVertex2f(x4, y4); // center of circle<br />for(int i = 0; i <= triangleAmount1; i++)<br />{<br />glVertex2f(<br />x4 + (radius1 * cos(i * twicePi1 / triangleAmount1)),<br />y4 + (radius1 * sin(i * twicePi1 / triangleAmount1))<br />);<br />}<br />glEnd();</p><p style="margin: 0px 0px 0.75em;">glPopMatrix();</p><p style="margin: 0px 0px 0.75em;">Code for Birds</p><p style="margin: 0px 0px 0.75em;">glLoadIdentity();<br />glPushMatrix();<br />glTranslatef(position5,0.0f, 0.0f);<br />glBegin(GL_POLYGON);<br />glColor3ub(0.0, 0.0, 0.0);<br />float angle41;<br />for (int i=0;i<360;i++)<br />{<br />angle41=i*3.1416/180;<br />glVertex2f(0.8+0.04*cos(angle41),0.7+0.02*sin(angle41));</p><p style="margin: 0px 0px 0.75em;">}<br />glEnd();</p><p style="margin: 0px 0px 0.75em;">glBegin(GL_POLYGON);<br />glColor3ub(0.0, 0.0, 0.0);<br />float angle42;<br />for (int i=0;i<360;i++)<br />{<br />angle42=i*3.1416/180;<br />glVertex2f(0.75+0.02*cos(angle42),0.71+0.02*sin(angle42));</p><p style="margin: 0px 0px 0.75em;">}<br />glEnd();</p><p style="margin: 0px 0px 0.75em;">glBegin(GL_POLYGON);<br />glColor3ub(255.0, 255.0, 255.0);<br />float angle43;<br />for (int i=0;i<360;i++)<br />{<br />angle43=i*3.1416/180;<br />glVertex2f(0.74+0.005*cos(angle43),0.71+0.005*sin(angle43));</p><p style="margin: 0px 0px 0.75em;">}<br />glEnd();<br />//wing</p><p style="margin: 0px 0px 0.75em;">glBegin(GL_TRIANGLES);<br />glColor3ub(255.0, 255.0, 255.0);<br />glVertex2f(0.8f,0.75f);<br />glVertex2f(0.79,0.71f);<br />glVertex2f(0.785f,0.8f);<br />glEnd();</p><p style="margin: 0px 0px 0.75em;">//lip<br />glBegin(GL_TRIANGLES);<br />glColor3ub(255.0, 0.0, 0.0);<br />glVertex2f(0.73f,0.72f);<br />glVertex2f(0.69f,0.71f);<br />glVertex2f(0.73f,0.70f);<br />glEnd();</p><p style="margin: 0px 0px 0.75em;">In our Simple City Scenery opengl computer graphics program we have used three birds. You can use many birds you like, just adjust the coordinate of thier body so they fit in the scene. Code for the bird will be common for all just need some tweak in the coordinates.</p></div></div><div class="full module moduleDistributionVideo" id="mod_new33" style="clear: left; font-size: 13.8px; margin-bottom: 1.3em; overflow-wrap: break-word; word-break: break-word;"></div><div class="full module moduleText" id="mod_52512552" style="clear: left; font-size: 13.8px; margin-bottom: 1.3em; overflow-wrap: break-word; word-break: break-word;"><div class="txtd" id="txtd_52512552"><p style="margin: 0px 0px 0.75em;">You can find full source code in the download link.</p></div></div><div class="full module moduleText" id="mod_52512554" style="clear: left; font-size: 13.8px; margin-bottom: 1.3em; overflow-wrap: break-word; word-break: break-word;"><h2 class="subtitle" style="color: #6ea6af; font-family: arial, helvetica, sans-serif; font-size: 1.7em; line-height: 1.3em; margin: 0px 0px 0.7em;">User Interaction</h2><div class="txtd" id="txtd_52512554"><p style="margin: 0px 0px 0.75em;">In this opengl computer graphics project we have used both keyboard and mouse interaction. Separate opengl functions has been use for calling mouse events and keyboard events. There only few intractions that user and do with this program.</p><p style="margin: 0px 0px 0.75em;"><strong><u>Keyboard Interaction</u></strong></p><p style="margin: 0px 0px 0.75em;">Following are keyboard functions used for user in this opengl program.</p><p style="margin: 0px 0px 0.75em;">'s': With this key Bus/Vechile in the program stop moving and halt at the postion where this key has been place.<br />'r': With this key Bus/Vechile in the program start running/movin. It will start from postion where it halting.<br />'d': With this key user can switch to day mode when in the night mode.<br />'n': This key will allow user to change from day mode to night mode.</p><p style="margin: 0px 0px 0.75em;"><br /></p><h2 class="subtitle" style="color: #6ea6af; font-family: arial, helvetica, sans-serif; font-size: 1.7em; line-height: 1.3em; margin: 0px 0px 0.7em;">Learn about Functions used</h2><div class="moduleTable" id="div_table_view_52536032" style="font-size: 13.8px; margin: 0px 0px 0.5em; overflow: auto; padding: 0px;"><table class="style0" id="table_view_52536032" style="border-collapse: collapse; border-spacing: 0px; border: 0px; font-size: 1em; margin: 0px; padding: 0px; width: 520px;"><thead id="thead_view_52536032" style="vertical-align: bottom;"><tr><th style="background: padding-box padding-box rgb(255, 255, 255); border: 1px solid rgb(215, 215, 215); color: #4b4949; margin: 0px; overflow: visible; padding: 0.4em; text-align: center; width: 200px;"><div style="max-width: 200px; min-width: 120px;">Funcrions</div></th><th style="background: padding-box padding-box rgb(255, 255, 255); border: 1px solid rgb(215, 215, 215); color: #4b4949; margin: 0px; overflow: visible; padding: 0.4em; text-align: center; width: 200px;"><div style="max-width: 200px; min-width: 120px;">Descritpions</div></th></tr></thead><tbody id="tbody_view_52536032"><tr><td style="background-clip: padding-box; background-color: white; border: 1px solid rgb(215, 215, 215); color: #4b4949; margin: 0px; overflow: visible; padding: 0.4em; width: 200px;"><div style="max-width: 200px; min-width: 120px;">GL_TRIANGLE_FAN</div></td><td style="background-clip: padding-box; background-color: white; border: 1px solid rgb(215, 215, 215); color: #4b4949; margin: 0px; overflow: visible; padding: 0.4em; width: 200px;"><div style="max-width: 200px; min-width: 120px;">The first vertex is always held fixed. From there on, every group of 2 adjacent vertices form a triangle with the first.</div></td></tr><tr><td style="background-clip: padding-box; background-color: white; border: 1px solid rgb(215, 215, 215); color: #4b4949; margin: 0px; overflow: visible; padding: 0.4em; width: 200px;"><div style="max-width: 200px; min-width: 120px;">glLoadIdentity()</div></td><td style="background-clip: padding-box; background-color: white; border: 1px solid rgb(215, 215, 215); color: #4b4949; margin: 0px; overflow: visible; padding: 0.4em; width: 200px;"><div style="max-width: 200px; min-width: 120px;">id</div></td></tr><tr><td style="background-clip: padding-box; background-color: white; border: 1px solid rgb(215, 215, 215); color: #4b4949; margin: 0px; overflow: visible; padding: 0.4em; width: 200px;"><div style="max-width: 200px; min-width: 120px;">glutTimerFunc()</div></td><td style="background-clip: padding-box; background-color: white; border: 1px solid rgb(215, 215, 215); color: #4b4949; margin: 0px; overflow: visible; padding: 0.4em; width: 200px;"><div style="max-width: 200px; min-width: 120px;">d</div></td></tr><tr><td style="background-clip: padding-box; background-color: white; border: 1px solid rgb(215, 215, 215); color: #4b4949; margin: 0px; overflow: visible; padding: 0.4em; width: 200px;"><div style="max-width: 200px; min-width: 120px;">glutPostRedisplay()</div></td><td style="background-clip: padding-box; background-color: white; border: 1px solid rgb(215, 215, 215); color: #4b4949; margin: 0px; overflow: visible; padding: 0.4em; width: 200px;"><div style="max-width: 200px; min-width: 120px;"> </div></td></tr><tr><td style="background-clip: padding-box; background-color: white; border: 1px solid rgb(215, 215, 215); color: #4b4949; margin: 0px; overflow: visible; padding: 0.4em; width: 200px;"><div style="max-width: 200px; min-width: 120px;">GL_QUADS</div></td><td style="background-clip: padding-box; background-color: white; border: 1px solid rgb(215, 215, 215); color: #4b4949; margin: 0px; overflow: visible; padding: 0.4em; width: 200px;"><div style="max-width: 200px; min-width: 120px;"> </div></td></tr><tr><td style="background-clip: padding-box; background-color: white; border: 1px solid rgb(215, 215, 215); color: #4b4949; margin: 0px; overflow: visible; padding: 0.4em; width: 200px;"><div style="max-width: 200px; min-width: 120px;">glPushMatrix</div></td><td style="background-clip: padding-box; background-color: white; border: 1px solid rgb(215, 215, 215); color: #4b4949; margin: 0px; overflow: visible; padding: 0.4em; width: 200px;"><div style="max-width: 200px; min-width: 120px;"> </div></td></tr></tbody></table><br /></div><div class="moduleTable" id="div_table_view_52536032" style="font-size: 13.8px; margin: 0px 0px 0.5em; overflow: auto; padding: 0px;"><div class="full module moduleText" id="mod_52536024" style="clear: left; font-size: 13.8px; margin-bottom: 1.3em; overflow-wrap: break-word; word-break: break-word;"><h2 class="subtitle" style="color: #6ea6af; font-family: arial, helvetica, sans-serif; font-size: 1.7em; line-height: 1.3em; margin: 0px 0px 0.7em;">Future Encashment</h2><div class="txtd" id="txtd_52536024"><p style="margin: 0px 0px 0.75em;">We would love to hear from you with below feature you can add in this Computer Graphics Mini Project to make it more interesting.</p><ol style="margin: 0px 0px 0.75em 2em; padding: 0px;"><li style="margin: 0px 0px 0.5em;">Add more building/houses in the project.</li><li style="margin: 0px 0px 0.5em;">Draw river around which flow from the mountain in the program and it contain bridge if possible.</li><li style="margin: 0px 0px 0.5em;">Add more vechiles on the road with sound effects of horns.</li><li style="margin: 0px 0px 0.5em;">Add footpath for people and let some human walki in.</li></ol><p style="margin: 0px 0px 0.75em;"></p></div></div><div class="full module moduleVideo" id="mod_52512581" style="clear: both; font-size: 13.8px; margin-bottom: 1.3em; overflow-wrap: break-word; word-break: break-word;"><h2 class="subtitle" style="color: #6ea6af; font-family: arial, helvetica, sans-serif; font-size: 1.7em; line-height: 1.3em; margin: 0px 0px 0.7em;">Video Demo</h2><div><br />
<iframe width="560" height="315" src="https://www.youtube.com/embed/Ffjrluh0Y0M" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div><div><br /></div><div><br /></div><div><h2 class="subtitle" style="color: #6ea6af; font-family: arial, helvetica, sans-serif; font-size: 1.7em; line-height: 1.3em; margin: 0px 0px 0.7em;">Source Code Download</h2><div class="txtd" id="txtd_52536027" style="font-size: 13.8px;"><p style="margin: 0px 0px 0.75em;">Download source code of this Computer Graphics Mini Project from the link provide in the post below. You are free to ask anything about this projects to us in comments section. You may also write an email to us.</p></div></div>
</div></div></div></div></div></div></div></div>
<div class="download_code"><a class="btn_left" href="" target="_blank">DOWNLOAD CODE</a></div>Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-219146217871395462022-05-30T01:03:00.003+05:302022-05-30T01:03:14.356+05:30Top Computer Graphics Projects Ideas for 2022<div style="text-align: justify;">One idea can change the world. Here in this blog post we are giving you some computer graphics projects ideas, that will help you build new innovative project. These ideas will help you in completing you VTU CS computer graphics . Many of thes Computer Graphics (CG) Project Topics may be complex to desgin and code. You can be showman among your peers, when you will able to execute these complex Computer Graphics (CG) Project ideas by coding them into a fantastic opengl computer graphics projects.</div><div style="text-align: justify;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIwzxu9ZW-hSxv9llCge7gvqDDsIwaUeUPB8GZRBJGIVnp8Ye9yT5yjfuUtpdur8nkn3uqBLTYiXfcMUh_sd1a0J4ti4bkosFzorFrR9KCc273I5sEMlDdns0Fl5Mub7Wg1Kx_YK6CxbzIU3wT5NwZm0MRXPAS4s_osDzqI_PhJzc55N4m6SW2s45Dvg/s312/top%20computer%20graphics%20projects%20ideas%20for%202022.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Top Computer Graphics Projects Ideas for 2022" border="0" data-original-height="230" data-original-width="312" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIwzxu9ZW-hSxv9llCge7gvqDDsIwaUeUPB8GZRBJGIVnp8Ye9yT5yjfuUtpdur8nkn3uqBLTYiXfcMUh_sd1a0J4ti4bkosFzorFrR9KCc273I5sEMlDdns0Fl5Mub7Wg1Kx_YK6CxbzIU3wT5NwZm0MRXPAS4s_osDzqI_PhJzc55N4m6SW2s45Dvg/s16000/top%20computer%20graphics%20projects%20ideas%20for%202022.png" title="Top Computer Graphics Projects Ideas for 2022" /></a></div><br /><div><br /><div><br /></div><div>Social Messaging Apps</div></div><div><br /></div><div style="text-align: justify;">Social media is very powerful tool for this generation. One of the best thing as current generation student you can design a computer graphics mini projects that shows how these social media works.</div><div style="text-align: justify;"><br /></div><div>Tesla EV Cars</div><div><br /></div><div style="text-align: justify;">EV or Electrical vechiles are getting it popularity due to it's impact in making world green again. <a href="https://www.tesla.com/">Tesla</a> is one the leading company, hot in news for it world class electrical cars. A CG mini projects over the Tesla EV Cars would surely be innovative ideas.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Medical drones</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Drones are future and it will have impact on human kind. It would be great Computer Graphics Projects Idea for desing and code for working of a medical drones.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Internet of Things (IoT)</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Interenet or world wide web as we says has evolved alot, it is giving new and innovatiove solution to many problem of mankind. We can creat an Opengl graphics projects that will show how different things can be connected via intenet and can be opeated from anywhere.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Covid 19</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">We can save million live if we spread the informative news about Covid 19. It's symptoms, socail distancing, testing, precaution to be taken etc with computer graphics can be shown. It would be great to show as well the impotance of getting vacinated.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Missile</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">You might have hear about ongoing war. Now is the time to show graphically what a missile is and how it function along with different types of missiles. </div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Hydrogen vehicle</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">As said above electric vechiles are future but Hydrogen fuled vechiles may give tough competion to them. We can use our Computer Graphics Projects Ideas for developing of Hydrogen vehicle, how H2 is use to run a vechiles.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><br /></div>Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-51312807375613046012022-01-18T00:38:00.001+05:302022-01-18T00:38:33.917+05:303D Bedroom OpenGL Computer graphics projects <p> computer graphics project using opengl</p><h1 class="style-scope ytd-watch-metadata" style="-webkit-box-orient: vertical; -webkit-line-clamp: 2; background: rgb(249, 249, 249); border: 0px; color: #030303; display: -webkit-box; font-family: "YouTube Sans", Roboto, sans-serif; font-size: 2rem; line-height: 2.8rem; margin: 0px; max-height: 5.6rem; overflow: hidden; padding: 0px; text-overflow: ellipsis; word-break: break-word;"><yt-formatted-string class="style-scope ytd-watch-metadata" force-default-style="">Computer graphics projects</yt-formatted-string></h1><p><span style="background-color: white; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px;"><br /></span></p>
<div class="download_code"><a class="btn_left" href="https://github.com/Mahibabu1993/OpenGL-Project/blob/master/transformers.cpp" target="_blank">DOWNLOAD CODE</a><a class="btn_left" href="https://github.com/n-gauhar/bedroom-design" target="_blank">GITHUB</a></div>
<h1>Contents</h1><p><a href="#abs">Abstract</a></p><p><a href="#imp">Implementation</a></p><p><a href="#int">Interaction</a></p><p><a href="#fut">Future Encashment</a></p><p><a href="#vid">Video Demo</a></p><p><a href="#imp">Source Code Download</a></p><p><span style="background-color: white; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px;">This is an assignment done for my Computer Graphics lab using C++ and OpenGL. The GL, GLU and GLUT libraries were used. The bedroom was designed using cubes, pyramids and one 2D polygon.</span></p><p dir="auto" style="background-color: white; box-sizing: border-box; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px;">The features of the bedroom -</p><ul dir="auto" style="background-color: white; box-sizing: border-box; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;"><li style="box-sizing: border-box;">No lighting, no textures, no curve</li><li style="box-sizing: border-box; margin-top: 0.25em;">A pendulum clock with a moving pendulum</li><li style="box-sizing: border-box; margin-top: 0.25em;">A rotating fan (can be turned on/off)</li><li style="box-sizing: border-box; margin-top: 0.25em;">Change eyepoint and lookat point using keys</li></ul><h4 dir="auto" style="background-color: white; box-sizing: border-box; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; line-height: 1.25; margin-bottom: 16px; margin-top: 24px;"><a aria-hidden="true" class="anchor" href="https://github.com/n-gauhar/bedroom-design/blob/main/README.md#the-keys-used-are--" id="user-content-the-keys-used-are--" style="background-color: transparent; box-sizing: border-box; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration-line: none;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z" fill-rule="evenodd"></path></svg></a>The keys used are -</h4><p dir="auto" style="background-color: white; box-sizing: border-box; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px;">To move Eye point:</p><ol dir="auto" style="background-color: white; box-sizing: border-box; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;"><li style="box-sizing: border-box;">w: up</li><li style="box-sizing: border-box; margin-top: 0.25em;">s: down</li><li style="box-sizing: border-box; margin-top: 0.25em;">a: left</li><li style="box-sizing: border-box; margin-top: 0.25em;">d: right</li><li style="box-sizing: border-box; margin-top: 0.25em;">i: zoom in</li><li style="box-sizing: border-box; margin-top: 0.25em;">o: zoom out</li></ol><p dir="auto" style="background-color: white; box-sizing: border-box; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px;">To move Camera point:</p><ol dir="auto" style="background-color: white; box-sizing: border-box; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;"><li style="box-sizing: border-box;"><p dir="auto" style="box-sizing: border-box; margin-bottom: 16px; margin-top: 16px;">j: up</p></li><li style="box-sizing: border-box; margin-top: 0.25em;"><p dir="auto" style="box-sizing: border-box; margin-bottom: 16px; margin-top: 16px;">n: down</p></li><li style="box-sizing: border-box; margin-top: 0.25em;"><p dir="auto" style="box-sizing: border-box; margin-bottom: 16px; margin-top: 16px;">b: left</p></li><li style="box-sizing: border-box; margin-top: 0.25em;"><p dir="auto" style="box-sizing: border-box; margin-bottom: 16px; margin-top: 16px;">m: right</p></li><li style="box-sizing: border-box; margin-top: 0.25em;"><p dir="auto" style="box-sizing: border-box; margin-bottom: 16px; margin-top: 16px;">l: move nearer</p></li><li style="box-sizing: border-box; margin-top: 0.25em;"><p dir="auto" style="box-sizing: border-box; margin-bottom: 16px; margin-top: 16px;">k: move far</p></li><li style="box-sizing: border-box; margin-top: 0.25em;"><p dir="auto" style="box-sizing: border-box; margin-bottom: 16px; margin-top: 16px;">q to move to default position (both eyepoint & lookat point)</p></li><li style="box-sizing: border-box; margin-top: 0.25em;"><p dir="auto" style="box-sizing: border-box; margin-bottom: 16px; margin-top: 16px;">f: to turn on/off fan</p></li></ol>Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-78372976005809071092021-06-13T02:42:00.006+05:302021-07-22T01:15:52.850+05:30Computer Graphics Mini Project - 3D Car Animation<p style="text-align: justify;">There are many car related and racing related Computer Graphics Mini Project Projects.
Some are simple, some little complex but all are good for student to choose for their Mini Project.
All our computer graphics projects are in 2d. In this post we are going to give your a new
3D Car Animation project. </p><p style="text-align: justify;">This projects blog post are written in such a
way that you can use it for you report. We have tried our best in writing the post that well help students in
creating report of Computer Graphics Mini Project Projects themselves without any hassle. </p>
<div style="text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj8vxVSX23JqjBzPloPdx1nUi25LUHEouY61IejYc3ONqN5ZgYp751HL_3vsO_HvKD2Q-48NAyToHZd1iCFH_E_wRtf_hC54q_IDYdpGqrYlzp6C9BHSEW_5bJxKadKOD_EWCYUy6ZrUtc/s941/Computer+Graphics+Mini+Project+Projects+-+3D+Car+Animation.JPG"><img alt="Computer Graphics Mini Project Projects - 3D Car Animation" border="0" data-original-height="586" data-original-width="941" height="249" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj8vxVSX23JqjBzPloPdx1nUi25LUHEouY61IejYc3ONqN5ZgYp751HL_3vsO_HvKD2Q-48NAyToHZd1iCFH_E_wRtf_hC54q_IDYdpGqrYlzp6C9BHSEW_5bJxKadKOD_EWCYUy6ZrUtc/w400-h249/Computer+Graphics+Mini+Project+Projects+-+3D+Car+Animation.JPG" title="Computer Graphics Mini Project Projects - 3D Car Animation" width="400" /></a></div><br />
<h1 style="text-align: left;">Contents</h1>
<p><a href="#abs">Abstract</a></p>
<p><a href="#imp">Implementation</a></p>
<p><a href="#int">Interaction</a></p>
<p><a href="#fut">Future Encashment</a></p>
<p><a href="#vid">Video Demo</a></p>
<p><a href="#imp">Source Code Download</a></p>
<h2 id="abs" style="text-align: left;">Abstract</h2><div><div>Main aim of this Mini Project is to illustrate 3D Car Animation using OpenGL Computer graphics. The concepts of OpenGL glut library and C++ has been used to create 3D Car Animation. We demonstrates all the animation of 3D car including standalone car, driving in day/night, wheel effect, fog effect, animate in different directions, change of colors.</div><div>There is user interaction in this CG program. We have used input devices like mouse and key board to interact with program. </div></div>
<h2 id="imp" style="text-align: left;">Implementation</h2><div>This program is implemented using various OpenGL functions and user defined functions which are given upcoming paragraphs. </div><div><br /></div><div style="text-align: justify;">To code this basic OpenGL Computer Graphics Mini Project Projects we need to understand the concept of car design and it's movement. First we need to code a car. There are different module for car coding - front module, body, window, wheel and silencer. We are not going to full code a glimpse of it below - </div><div><br /></div><div><b><u>Code for drawing front window -</u></b></div><div><br /></div><div><div>glBegin(GL_TRIANGLES); </div><div> glColor3f(0.3,0.3,0.3);</div><div> glVertex3f( 0.6, 0.5,0.6);</div><div> glVertex3f( 0.7,0.65,0.6); //tri front window</div><div> glVertex3f(0.7,0.5,0.6);</div></div><div><br /></div><div><b><u>Code for ignition system</u></b></div><div><br /></div><div><div>glPushMatrix();</div><div> glColor3f(0.7,0.7,0.7);</div><div> glTranslatef(1.65,0.2,0.3);</div><div> glRotatef(90.0,0,1,0);</div><div> gluCylinder(t,0.02,0.03,.5,10,10);</div><div>glPopMatrix();</div></div><div><br /></div><div><b><u>Code for Wheel </u></b></div><div><br /></div><div><div>glColor3f(0.7,0.7,0.7);</div><div>glPushMatrix();</div><div> glBegin(GL_LINE_STRIP);</div><div><span style="white-space: pre;"> </span> for(theta=0;theta<360;theta=theta+20)</div><div><span style="white-space: pre;"> </span> {</div><div> glVertex3f(0.6,0.2,0.62);</div><div> glVertex3f(0.6+(0.08*(cos(((theta+angle)*3.14)/180))),0.2+(0.08*(sin(((theta+angle)*3.14)/180))),0.62);</div><div><span style="white-space: pre;"> </span> }</div><div>glEnd();</div></div><div><br /></div><div style="text-align: justify;">This Computer Graphics Mini Project Projects not just show the animation of car the aim of project but also have title. In beginning to project there is title screen which allow to show case the name of projects, student name, guide name, college name and instructions for the program.</div><div><div><br /></div><div style="text-align: left;"><div><b><u>Various OpenGL functions used in this program.</u></b></div><div><b><u><br /></u></b></div><div>glutInit() : interaction between the windowing system and OPENGL is initiated</div><div><br /></div><div>glutInitDisplayMode() : used when double buffering is required and depth information is required</div><div><br /></div><div>glutCreateWindow() : this opens the OPENGL window and displays the title at top of the window</div><div><br /></div><div>glutInitWindowSize() : specifies the size of the window</div><div><br /></div><div>glutInitWindowPosition() : specifies the position of the window in screen co-ordinates</div><div><br /></div><div>glutKeyboardFunc() : handles normal ascii symbols</div><div><br /></div><div>glutSpecialFunc() : handles special keyboard keys</div><div><br /></div><div>glutReshapeFunc() : sets up the callback function for reshaping the window</div><div><br /></div><div>glutIdleFunc() : this handles the processing of the background</div><div><br /></div><div>glutDisplayFunc() : this handles redrawing of the window</div><div><br /></div><div>glutMainLoop() : this starts the main loop, it never returns</div><div><br /></div><div>glViewport() : used to set up the viewport</div><div><br /></div><div>glVertex3fv() : used to set up the points or vertices in three dimensions</div><div><br /></div><div>glColor3fv() : used to render color to faces</div><div><br /></div><div>glFlush() : used to flush the pipeline</div><div><br /></div><div>glutPostRedisplay() : used to trigger an automatic redrawer of the object</div><div><br /></div><div>glMatrixMode() : used to set up the required mode of the matrix</div><div><br /></div><div>glLoadIdentity() : used to load or initialize to the identity matrix</div><div><br /></div><div>glTranslatef() : used to translate or move the rotation center from one point to another in three dimensions</div><div><br /></div><div>glRotatef() : used to rotate an object through a specified rotation angle</div><div><br /></div><div><br /></div><div><b><u>Other similar projects -</u></b></div><div><br /></div><div><a href="https://www.openglprojects.in/2015/03/2d-car-racing-game-opengl-projects-with-source-code.html#gsc.tab=0">2D car racing game</a></div><div><a href="https://www.openglprojects.in/2017/05/a-movable-car.html#gsc.tab=0">A Movable Car</a></div><div><a href="https://www.openglprojects.in/2017/05/a-movable-car.html#gsc.tab=0">Car Race OpenGL Program</a></div><div><br /></div>
<div><h2 id="int" style="text-align: left;">Interaction</h2><div>In this graphics program we have user interaction with mouse and keyboard. </div><div><br /></div><div><b><u>Mouse Interaction</u></b></div><div><b><u><br /></u></b></div><div>-> Press Right mouse button for menu and select submenu there. </div><div><ul style="text-align: left;"><li>car model mode</li><li>car driving mode</li><li>fog effect</li><li>wheel effect</li><li>toggle light</li><li>car colors<ul><li></li><li>blue</li><li>red</li><li>green</li><li>black</li><li>yellow</li><li>grey</li></ul></li><li>Day mode</li><li>Night mode</li></ul></div><div><br /></div><div><b><u>Keyboard Interaction</u></b></div><div><br /></div><div><div><ol style="text-align: left;"><li>esc - Exit from the program</li><li>spacebar - Enter the main screen from start screen.</li><li>x- Rotate the car in 'x' direction</li><li>y- Rotate the car in 'y' direction</li><li>z- Rotate the car in 'z' direction</li><li>a- Increase the size of car in'x' direction</li><li>s- Increase the size of car in 'y' direction</li><li>q- Increase the size of car in 'z' direction</li><li>u- Camera top view</li><li>f- Camera side view</li><li>left arrow key - Move car in forward direction</li><li>right arrow key- Move car in backward direction</li></ol></div></div><div><br /></div>
<h2 id="fut">Future Enhancement</h2>
You can implement many enhancement in future like adding sound to it etc. Below are some future addition that can be added to projects for improvement. </div><div><ol style="text-align: left;"><li>Addition of sound</li><li>More cars can be added into it.</li><li>Surroundings can be created in much better way by adding tree etc.</li><li>Multiple roads can be added with street light</li><li>Traffic signal can be added</li><li>Advance camera view</li><li>More colors can be added</li></ol></div><div><br /></div></div></div>
<h2 id="vid" style="text-align: left;">Video Demo</h2>
<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/HFGhItVXWog" title="YouTube video player" width="560"></iframe><div><br /></div>
<h2 id="code" style="text-align: left;">Source Code Download</h2>
<div>Download source code of this Computer Graphics Mini Project from the link given below. Feel free to ask anything about this projects to us via comments or email to us. </div>
<div class="download_code"><a class="btn_left" href="https://drive.google.com/open?id=0B4cYLdYzy4oqZElHVnJFSHhYOUE" target="_blank">DOWNLOAD SOURCE CODE</a></div>Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-85662862343338894942021-05-26T20:51:00.004+05:302021-05-27T00:05:55.184+05:30TRANSFORMERS - The OpenGL Computer Graphics Projects<p>OpenGL Projects Committed to provide student new and best Computer Graphics Projects. In view of that we have posted so many innovative projects using OpenGL C++ on this blog. Students can download the source codes from OpenGL Projects, use them in their own innovative projects. We know coding is fun! so what's in here? In this post we bring you one simple still classic projects that will demonstrate the "TRANSFORMERS", inspired from the movie <a href="https://en.wikipedia.org/wiki/Transformers_(film_series)" target="_blank">Transformers</a>. We will give insight about projects as well as source code for same. This projects is developed by Mahesh Bhandari of New Horizon College of Engineering, Bengaluru.</p>
<div class="download_code"><a class="btn_left" href="https://github.com/Mahibabu1993/OpenGL-Project/blob/master/transformers.cpp" target="_blank">DOWNLOAD CODE</a><a class="btn_left" href="https://github.com/Mahibabu1993/OpenGL-Project" target="_blank">GITHUB</a></div>
<div><h2 style="text-align: left;">About Transformers</h2></div><div>Transformers are actually objects that transform. But with reference to our film we can define the transformers are alien robots that can transform themselves into various other mechanical objects. The idea was inspired from the toy lines from japan. These transformers have been created on earth but lives on alien plane called cybertron. They can talk like human and have emotion like human, hence both negative as well as positive behavior. </div><div><br /></div><h2 style="text-align: left;">What are we building</h2><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI3BB3z2imVej1rzzyngdLYrgSunQSqqODhgUzIlhN-S7DCif25IHcExvVyOhyHBLRsbm_dwU5q0abVHWfSs9HX_eGkT2czIlegdr-e3VBL7BIjAeGKhcWHzJ_bV3DMpDNyF4zX77Y3KhB/s1178/transformer+opengl+projects.JPG" style="margin-left: auto; margin-right: auto;"><img alt="TRANSFORMERS - The OpenGL Computer Graphics Projects" border="0" data-original-height="686" data-original-width="1178" height="233" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI3BB3z2imVej1rzzyngdLYrgSunQSqqODhgUzIlhN-S7DCif25IHcExvVyOhyHBLRsbm_dwU5q0abVHWfSs9HX_eGkT2czIlegdr-e3VBL7BIjAeGKhcWHzJ_bV3DMpDNyF4zX77Y3KhB/w400-h233/transformer+opengl+projects.JPG" title="TRANSFORMERS - The OpenGL Computer Graphics Projects" width="400" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"></td></tr></tbody></table><br /><div><br /></div><div><br /></div><div>In this OpenGL Computer Graphics Projects, we are building a Transformer not exactly but a smaller robot that will transform. We are going to code a simple robot which will have two arms and legs, a head with small antenna. To show different body we will differentiate the body color and joint color and of course the head color. </div><div><br /></div><div>First we are going to design a small place with trees across it to make the <a href="https://www.openglprojects.in/2015/11/java-opengl-graphics-programming.html#gsc.tab=0" target="_blank">scenery in this opengl projects</a>. As we said we will design a simple robot, this will place in the midway of scenery. Now we will code to animate the robot. The idea is to collapse all the parts of robot and transform in to a car or vehicles as seen in the movie. When you will do this and run the program you will feel watching the movie, isn't that cool.</div><div><br /></div><h2 style="text-align: left;">The Transformer OpenGL Projects</h2><div><br /></div><div>Lets code this Computer Graphics Projects.</div><div>We will write code for different objects say tree, clouds etc and then club all them into the main functions. For example you can see the code for tree below - </div><div><br /></div><div><br /></div><div><div>void tree()</div><div>{</div><div> //Trunk</div><div> glColor3f(0.325,0.208,0.039);</div><div> glScalef(1.5,0.3,0.3);</div><div> glTranslatef(0,-10,0);</div><div> glutSolidSphere(10,18,20);</div><div> glTranslatef(0,10,0);</div><div> glScalef(1/1.5,1/0.3,1/0.3);</div><div> glutSolidCube(12);</div><div><br /></div><div> //Tree</div><div> glColor3f(0,1,0);</div><div> for(int c=-5;c<=10;c+=5)</div><div> {</div><div> glTranslatef(c,25,0);</div><div> glScalef(1,0.8,1);</div><div> glutSolidSphere(20,20,20);</div><div> glScalef(1,1/0.8,1);</div><div> glTranslatef(-c,-25,0);</div><div> }</div><div>}</div></div><div><br /></div><div>Now as we have code for all the objects we have to code the animation and bring it to display function.</div><div><br /></div><div><div>void trans()</div><div>{</div><div> if (yll<130)</div><div> {</div><div> yll+=1;</div><div> ylu+=1;</div><div> yln+=1;</div><div> }</div><div> else if(yrh>240)</div><div> {</div><div> yrh-=1;</div><div> yre-=1;</div><div> yrf-=1;</div><div> ye-=1;</div><div> yrnc-=1;</div><div> }</div><div> else if(yll<220)</div><div> {</div><div> yll+=1;</div><div> }</div><div> else if(rlh<=560)</div><div> {</div><div> rlh+=1;</div><div> rrh-=1;</div><div> rla+=0.9;</div><div> rra-=0.9;</div><div> }</div><div> else if(rxa<=90)</div><div> {</div><div> rxa+=1;</div><div> tz-=2;</div><div> ty+=1.2;</div><div> }</div><div> else</div><div> {</div><div> flag=1;</div><div> rxa=0;</div><div> sx=1.3;</div><div> sy=0.5;</div><div> sz=1;</div><div> }</div><div>}</div></div><div><br /></div><div><br /></div><div>All the code are easy to understand and make. Just download the code and see yourself.</div><h2 style="text-align: left;">What Can be improve?</h2><div><br /></div><div>As we know perfection is myth, hence we can improve this OpenGL projects as well. In future we can improve it with code reusability. With recursion and other techniques we can improve the coding as well reduce the compilation time. The projects can be implement in 3D which will make it more impressive. Addition of sound and lights will also mark improvement. We can add user interaction in the program. </div><h2 style="text-align: left;">Conclusion </h2><div><br /></div><div><div>After movie came many people think transformers(basically robot with Artificial Intelligence) may replace everything within the future. It's vital to understand about the transformers. The aim of this project is to point out the demonstration of working of transformers. This project demonstrates one among the simplest cartoon series of transformers, the project completely uses graphics and has been done using OpenGL. The code utilized in the program is extremely simple. we will easily understand the working of transformers by seeing the output of this project.</div><div><br /></div><div>Minimum code is written to point out the animation in order that the programmers can easily understand and can be distributed with modification in the code as open source. With this OpenGL Computer Graphics Projects, you will learn the techniques that will helps in future endeavors. </div></div><div><br /></div><h2 style="text-align: left;">Video</h2><div><br />
<iframe width="560" height="315" src="https://www.youtube.com/embed/1919Le8QOr8" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div><div><br /></div><h2 style="text-align: left;">Source Code</h2>
<div class="download_code"><a class="btn_left" href="https://github.com/Mahibabu1993/OpenGL-Project/blob/master/transformers.cpp" target="_blank">DOWNLOAD CODE</a><a class="btn_left" href="https://github.com/Mahibabu1993/OpenGL-Project" target="_blank">GITHUB</a></div>Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-25493496725567334522021-03-29T00:51:00.045+05:302021-03-31T23:53:58.609+05:30Rubik's Cube OpenGL Computer Graphics ProjectAre you looking for Rubik's Cube CG project with source code, then your search ends here. We are going to show you a great OpenGL Project, Rubik's Cube OpenGL Computer Graphics Project. Download the free source for mini projects with source code for your academic and the final year projects as well as any other semester projects. Just download the Rubik's Cube C++ source code in OpenGL computer graphics and play around to make your own changes. Amend, play with the code and add your own source code that will make this project more interesting.<div><br /><h2 style="text-align: left;">What is Rubik's Cube?</h2><div><br /></div><div>The Rubik's Cube is a 3D puzzle discovered in the year 1974 by Hungarian sculptor Ernő Rubik. It was named as Magic Cube then. It slowly become one of the best selling toy. You can read more about the this interesting toy on the <a href="https://en.wikipedia.org/wiki/Rubik's_Cube">Wikipedia</a>.</div><div><br /></div><h4 style="text-align: left;">Abstract</h4><div>In this blog post we are going to see, a complex opengl project to show and solve the puzzele of Rubik's Cube in OpenGL C++. </div><div><br /></div><div><div>The cubies are divided into three different types:</div><div><br /></div><div>Centre Cubies:</div><div>The center cubies refer to the cubie pieces that are located at the center of each face of the Rubik's cube. There is a total of six cubies, and each has one facelet, they always stick in the same location corresponding to each other.</div><div><br /></div><div>Corner Cubies:</div><div>The corner cubies refer to the cubic pieces that are located at the corner of the Rubik's cube. There is a total of eight corners, and each has three facelets.</div><div><br /></div><div>Edge Cubies:</div><div>The edge cubies refer to the edge pieces that are located between each pair of the corresponding corners. There are 12 different edges in the Rubik's cube, and each has two Facelets.</div><div><br /></div><div>All cubes do not have the same color arrangements. The colors utilized for these illustrations is known as BOY (Blue, Orange, and Yellow, are faced in the clockwise direction). Here, you need to analyze the locations of the centers corresponding to each other, as this is always your color arrangements.</div><div><br /></div><div>White is located opposite to yellow.</div><div><br /></div><div>Blue is located opposite to green.</div><div><br /></div><div>Orange is located opposite red.</div><div><br /></div><div>Orange is also located to the right of blue only if white is facing up.</div></div><div><br /></div><h4 style="text-align: left;">User Interaction </h4><div><div>1. The interaction between the windowing system and OPENGL is initiated.</div><div>We initialize the window size and window position.</div><div><br /></div><div>2. Display function is called where the functions and operations for the</div><div>Rubiks cube are defined.</div><div><br /></div><div>3. Using the left mouse button the cube can be rotated along the</div><div>required axis.</div><div><br /></div><div>4. Using the right mouse button menus can be viewed, by selecting the</div><div>options from the menu the required face of the cube can be rotated either</div><div>clockwise or anti-clockwise.</div><div><br /></div><div>5. The rotation of faces of the cube can also be done using keys from the</div><div>keyboard.</div><div><br /></div><div>6. Press the key ‘a’ to rotate the top face of the cube in the clockwise direction.</div><div><br /></div><div>7. Press the key ‘q’ to rotate the top face of the cube in the anti-clockwise</div><div>direction.</div><div><br /></div><div>8. Press the key ‘s’ to rotate the right face of the cube in the clockwise</div><div>direction.</div><div><br /></div><div>9. Press the key ‘w’ to rotate the right face of the cube in the anti-clockwise</div><div>direction.</div><div><br /></div><div>10. Press the key ‘d’ to rotate the front face of the cube in the clockwise</div><div>direction.</div><div><br /></div><div>11. Press the key ‘e’ to rotate the front face of the cube in the anti-clockwise</div><div>direction.</div><div><br /></div><div>12. Press the key ‘f’ to rotate the left face of the cube in the clockwise direction.</div><div><br /></div><div>13. Press the key ‘r’ to rotate the left face of the cube in the anti-clockwise</div><div>direction.</div><div><br /></div><div>14. Press the key ‘g’ to rotate the back face of the cube in the clockwise</div><div>direction.</div><div><br /></div><div>15. Press the key ‘t’ to rotate the back face of the cube in the anti-clockwise</div><div>direction.</div><div><br /></div><div>16. Press the key ‘h’ to rotate the bottom face of the cube in the clockwise</div><div>direction.</div><div><br /></div><div>17. Press the key ‘y’ to rotate the bottom face of the cube in the anti-clockwise</div><div>direction.</div><div><br /></div><div>19. Press the key ‘o’ for the automatic solving.</div><div><br /></div><div>20. Press the keys ‘m’ and ‘n’ to control the speed of rotation.</div><div><br /></div><div>21. Use the keys ‘1’,’2’,’4’,’5’,’6’,’8’,’9’ to rotate the cube along different axes.</div><div>Screen Shots</div><div><br /></div></div></div><h3 style="text-align: left;">Source Code </h3><div>Want Source code write a email to us at openglprojects@gmail.com</div>Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-75023258077711650152021-03-28T02:40:00.003+05:302021-03-28T02:40:23.295+05:30Getting Started with OpenGL ES for Android<p>All Android devices have graphics processing unit (GPU), which used for handling the graphics processing. OpenGL is one of the API used in Android which support all devices, other is Vulkan which support only Android 7.0 and above. In this post we will getting stated with OpenGL ES for Android. This is simple Android OpenGL ES tutorial for beginners.</p><p><span face="arial, sans-serif" style="background-color: white; color: #202124; font-size: 36px;">Prerequisite</span></p><p><span face="arial, sans-serif" style="background-color: white; color: #202124;">Before we get started with OpenGL ES Tutorial for Android, we should know about the prerequisite like pre-learning, software, tools, plugins required and other information and definition about graphics APIs.</span></p><p><b>What is OpenGL ES?</b></p><p><span face="arial, sans-serif" style="background-color: white; color: #202124;"></span></p><p>As defined in our many posts, OpenGL is acronym of Open Graphics Library which is cross platform which means, platform-independent graphics API. OpenGL ES means OpenGL for Embedded Systems, API for computer graphics in embedded systems like mobile phones.</p><p>As we proceed further in this <span style="background-color: white; color: #202124;">OpenGL ES Tutorial for Android, we assume that reader are aware of basics of Java, xml, Opengl and Android ecosystem. If you have some idea about Android you must have Android Studio installed which have Android SDK, AVD and all other tools required for Android App development.</span></p><p><span style="background-color: white; color: #202124;"><b>Project Setup</b></span></p><p><span style="background-color: white;"><span style="color: #202124;">Create a new project in android studio, name it OpenGLESTutorial choose basic template. Android studio will create the all required code including the java files and xml files. </span></span></p><p><span style="background-color: white;"><span style="color: #202124;">1. OpenGL ES Check</span></span></p><p><span style="color: #202124;"><span style="background-color: white;">As we are working with OpenGL ES we need to <a href="https://www.openglprojects.in/2015/07/how-to-check-if-android-device-supports-opengl-es-2.0.html">check if android device the support OpenGL ES 2.0</a> or not. <br /><br /></span></span></p><div class="line number10 index9 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java keyword" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; font-weight: bold; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">final</code> <code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();</code></div><div class="line number11 index10 alt2" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java spaces" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"> </code><code class="java keyword" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; font-weight: bold; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">final</code> <code class="java keyword" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; font-weight: bold; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">boolean</code> <code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">supportsEs2 = configurationInfo.reqGlEsVersion >= </code><code class="java value" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #009900; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">0x20000</code><code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">;</code></div><div class="line number12 index11 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"> </div><div class="line number13 index12 alt2" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java spaces" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"> </code><code class="java keyword" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; font-weight: bold; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">if</code> <code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">(supportsEs2)</code></div><div class="line number14 index13 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java spaces" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"> </code><code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">{</code></div><div class="line number15 index14 alt2" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java spaces" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"> </code><code class="java comments" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #008200; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">// Request an OpenGL ES 2.0 compatible context.</code></div><div class="line number16 index15 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java spaces" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"> </code><code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">mGLSurfaceView.setEGLContextClientVersion(</code><code class="java value" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #009900; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">2</code><code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">);</code></div><div class="line number17 index16 alt2" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"> </div><div class="line number18 index17 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java spaces" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"> </code><code class="java comments" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #008200; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">// Set the renderer to our demo renderer, defined below.</code></div><div class="line number19 index18 alt2" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java spaces" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"> </code><code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">mGLSurfaceView.setRenderer(</code><code class="java keyword" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; font-weight: bold; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">new</code> <code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">LessonOneRenderer());</code></div><div class="line number20 index19 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java spaces" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"> </code><code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">}</code></div><div class="line number21 index20 alt2" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java spaces" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"> </code><code class="java keyword" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; font-weight: bold; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">else</code></div><div class="line number22 index21 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java spaces" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"> </code><code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">{</code></div><div class="line number23 index22 alt2" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java spaces" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"> </code><code class="java comments" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #008200; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">// This is where you could create an OpenGL ES 1.x compatible</code></div><div class="line number24 index23 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java spaces" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"> </code><code class="java comments" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #008200; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">// renderer if you wanted to support both ES 1 and ES 2.</code></div><div class="line number25 index24 alt2" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java spaces" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"> </code><code class="java keyword" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; font-weight: bold; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">return</code><code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">;</code></div><div class="line number26 index25 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java spaces" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"> </code><code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">}</code></div><div class="line number27 index26 alt2" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"> </div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java spaces" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"> </code><code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;">setContentView(mGLSurfaceView);</code></div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"><br /></code></div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"><br /></code></div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"><br /></code></div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; float: none; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; width: auto;"><span style="background-color: transparent;">Earlier Android emulator does not support OpenGL ES 2.0, to test real device was required, but now now Android emulator does support </span>OpenGL ES 2.0. Hence we can test our tutorial on <span style="background-color: transparent;">the </span>Android emulator as well as real Android phones.<span style="background-color: transparent;"> </span></div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; float: none; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; width: auto;"><span style="background-color: transparent;"><br /></span></div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; float: none; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; width: auto;"><span style="background-color: transparent;">Moreover, to stop Android user who don't have phone/device supporting OpenGL ES Version, </span><uses-feature> tag need to be added in the project <uses-feature> tag. Add the following code in AndroidManifest.xml file.</div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; float: none; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; width: auto;"><pre style="font-family: Consolas, monospace; font-size: 9.8pt;"><<span style="color: navy; font-weight: bold;">uses-feature </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:glEsVersion</span><span style="color: green; font-weight: bold;">="0x00020000"<br /></span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:required</span><span style="color: green; font-weight: bold;">="true" </span>/></pre></div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; float: none; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; width: auto;"><span style="background-color: transparent;"><br /></span></div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; float: none; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; width: auto;"><span style="background-color: transparent;">2. Create Class</span></div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; float: none; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; width: auto;"><span style="background-color: transparent;"><br /></span></div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; float: none; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; width: auto;">First create a class name <span style="font-family: Consolas, monospace; font-size: 9.8pt;">OpenGLView Overide the class with </span><span style="background-color: transparent; font-family: Consolas, monospace; font-size: 9.8pt;">GLSurfaceView</span><span style="font-family: Consolas, monospace; font-size: 9.8pt;">. Add all the overide methord. Create init methord as shown below.</span></div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; float: none; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; width: auto;"><span style="font-family: Consolas, monospace; font-size: 9.8pt;"><br /></span></div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; float: none; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; width: auto;"><pre style="font-family: Consolas, monospace; font-size: 9.8pt;"><span style="color: navy; font-weight: bold;">public class </span>OpenGLView <span style="color: navy; font-weight: bold;">extends </span>GLSurfaceView {<br /><br /> <span style="color: navy; font-weight: bold;">public </span>OpenGLView(Context context) {<br /> <span style="color: navy; font-weight: bold;">super</span>(context);<br /> init();<br /> }<br /><br /> <span style="color: navy; font-weight: bold;">public </span>OpenGLView(Context context, AttributeSet attrs) {<br /> <span style="color: navy; font-weight: bold;">super</span>(context, attrs);<br /> init();<br /> }<br /> <span style="color: navy; font-weight: bold;">private void </span>init(){<br /> setEGLContextClientVersion(<span style="color: blue;">2</span>);<br /> setPreserveEGLContextOnPause(<span style="color: navy; font-weight: bold;">true</span>);<br /> setRenderer(<span style="color: navy; font-weight: bold;">new </span>OpenGLRenderer());<br /> }<br />}</pre></div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"><pre style="font-family: Consolas, monospace; font-size: 9.8pt;"><br /></pre><pre style="font-family: Consolas, monospace; font-size: 9.8pt;">Now create a class OpenGLRenderer and implement interface GLSurfaceView.Renderer and write all methord.</pre><pre style="font-family: Consolas, monospace; font-size: 9.8pt;"><span style="color: navy; font-weight: bold;">public class </span>OpenGLRenderer <span style="color: navy; font-weight: bold;">implements </span>GLSurfaceView.Renderer {<br /> <span style="color: olive;">@Override<br /></span><span style="color: olive;"> </span><span style="color: navy; font-weight: bold;">public void </span>onSurfaceCreated(GL10 gl, EGLConfig config) {<br /> GLES20.<span style="font-style: italic;">glClearColor</span>(<span style="color: blue;">1f</span>,<span style="color: blue;">0</span>,<span style="color: blue;">0</span>,<span style="color: blue;">1f</span>);<br /> }<br /><br /> <span style="color: olive;">@Override<br /></span><span style="color: olive;"> </span><span style="color: navy; font-weight: bold;">public void </span>onSurfaceChanged(GL10 gl, <span style="color: navy; font-weight: bold;">int </span>width, <span style="color: navy; font-weight: bold;">int </span>height) {<br /><br /> }<br /><br /> <span style="color: olive;">@Override<br /></span><span style="color: olive;"> </span><span style="color: navy; font-weight: bold;">public void </span>onDrawFrame(GL10 gl) {<br /> GLES20.<span style="font-style: italic;">glClear</span>(GLES20.<span style="color: #660e7a; font-style: italic; font-weight: bold;">GL_COLOR_BUFFER_BIT</span>);<br /> }<br />}</pre></code></div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"><span style="font-family: "Times New Roman"; font-size: medium; white-space: normal;"><br /></span></code></div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><code class="java plain" style="background: none; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 1em; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; vertical-align: baseline; width: auto;"><span style="font-family: "Times New Roman"; font-size: medium; white-space: normal;">3</span></code><span style="background-color: initial; color: black; font-family: "Times New Roman"; font-size: medium; white-space: normal;">. Main Activity XML</span></div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: Monaco, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 16px; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; white-space: pre; width: auto;"><span style="background-color: initial; color: black; font-family: "Times New Roman"; font-size: medium; white-space: normal;"><br /></span></div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; float: none; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; width: auto;">In activity_main layout create an widget for creating canvas. Add the following code- </div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; float: none; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; width: auto;"><br /></div><div class="line number28 index27 alt1" style="background: none white; border-radius: 0px; border: 0px; box-shadow: none; box-sizing: content-box; direction: ltr; float: none; height: auto; inset: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em 0px 0em; position: static; vertical-align: baseline; width: auto;"><pre style="font-family: Consolas, monospace; font-size: 9.8pt;"><<span style="color: navy; font-weight: bold;">com.india.myapplication.OpenGLView<br /></span><span style="color: navy; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:id</span><span style="color: green; font-weight: bold;">="@+id/openglview"<br /></span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_height</span><span style="color: green; font-weight: bold;">="match_parent"<br /></span><span style="color: green; font-weight: bold;"> </span><span style="color: #660e7a; font-weight: bold;">android</span><span style="color: blue; font-weight: bold;">:layout_width</span><span style="color: green; font-weight: bold;">="match_parent"</span>/></pre><pre style="font-family: Consolas, monospace; font-size: 9.8pt;"><br /></pre><pre style="font-family: Consolas, monospace; font-size: 9.8pt;">Now call the widget in Main Activity class</pre><pre style="font-family: Consolas, monospace; font-size: 9.8pt;">OpenGLView <span style="color: #660e7a; font-weight: bold;">openGLView</span>;</pre><pre style="font-family: Consolas, monospace; font-size: 9.8pt;">Initalize the OpenGL View in main activity class</pre><pre style="font-family: Consolas, monospace; font-size: 9.8pt;"><span style="color: #660e7a; font-weight: bold;">openGLView </span>=(OpenGLView) findViewById(R.id.<span style="color: #660e7a; font-style: italic; font-weight: bold;">openglview</span>);</pre><pre style="font-family: Consolas, monospace; font-size: 9.8pt;"><br /></pre><pre style="font-family: Consolas, monospace; font-size: 9.8pt;">Now the app, test it on emulator or on real device. You will see a red color surface which is rendered by OpenGL ES. </pre><pre style="font-family: Consolas, monospace; font-size: 9.8pt;">You can change the color of surface by changing in the - GLES20.<span style="font-size: 9.8pt; font-style: italic;">glClearColor</span><span style="font-size: 9.8pt;">(</span><span style="color: blue; font-size: 9.8pt;">1f</span><span style="font-size: 9.8pt;">,</span><span style="color: blue; font-size: 9.8pt;">0</span><span style="font-size: 9.8pt;">,</span><span style="color: blue; font-size: 9.8pt;">0</span><span style="font-size: 9.8pt;">,</span><span style="color: blue; font-size: 9.8pt;">1f</span><span style="font-size: 9.8pt;">);</span></pre><pre style="font-family: Consolas, monospace; font-size: 9.8pt;"><br /></pre></div>Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-1848008153883137132020-05-22T23:22:00.002+05:302020-05-22T23:41:37.558+05:30वट सावित्री व्रत ओपनजीएल प्रोजेक्ट्स<h1 style="background-color: white; font-stretch: inherit; line-height: 20px; padding: 0px 0px 10px; text-align: left;"><font color="#6b6b6b" face="mangal, arial, helvetica, sans-serif"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgS4J-Vajq5Pj34gKufiqNumbsMHDz9n5nBEJ2Gn-wiryStF5S4AIysNeWfu2qxD0HL5yZay0GQPmQA7C25wevLC-i5DnJIyB-Ew7S9YtvQPq3oyH9aXubObo_9KWYPgso_F7v3UuDEvJhW/" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="451" data-original-width="679" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgS4J-Vajq5Pj34gKufiqNumbsMHDz9n5nBEJ2Gn-wiryStF5S4AIysNeWfu2qxD0HL5yZay0GQPmQA7C25wevLC-i5DnJIyB-Ew7S9YtvQPq3oyH9aXubObo_9KWYPgso_F7v3UuDEvJhW/s320/images+%25282%2529.jpg" width="320" /></a></div><span style="font-size: 15px; font-weight: 400;"><br /></span></font></h1><h1 style="background-color: white; font-stretch: inherit; line-height: 20px; padding: 0px 0px 10px; text-align: left;"><font color="#6b6b6b" face="mangal, arial, helvetica, sans-serif"><span style="font-size: 15px; font-weight: 400;">वट</span></font>सावित्री व्रत</h1><h2 class="synopsis" style="background-color: white; color: #6b6b6b; font-family: mangal, arial, helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; font-weight: 400; line-height: 20px; padding: 0px 0px 10px;">इस दिन वट यानी बरगद के पेड़ की पूजा की जाती है। कहा जाता है कि वट वृक्ष की जड़ों में ब्रह्मा, तने में भगवान विष्णु व डालियों व पत्तियों में भगवान शिव का निवास स्थान माना जाता है। व्रत रखने वालों को मां सावित्री और सत्यवान की कथा पढ़ना या सुनना जरूरी होता है।</h2><div>यह व्रत विशेषकर विवाहित महिलाओं के द्वारा अखंड सौभाग्य का आशीर्वाद पाने के लिए रखा जाता है। धार्मिक मान्यता के अनुसार, यदि कोई शादीशुदा महिला इस व्रत को सच्चे मन से करती है तो उसका पति दीर्घायु होता है। हिन्दू पंचांग के अनुसार यह व्रत हर साल ज्येष्ठ माह की अमावस्या तिथि के दिन रखा जाता है। आइए जानते हैं इस व्रत का शुभ मुहूर्त और व्रत विधि।<br /></div><div><h2 class="synopsis">मान्यता है कि इस दिन माता सावित्री ने अपने दृढ़ संकल्प और श्रद्धा से यमराज द्वारा अपने मृत पति सत्यवान के प्राण वापस पाए। इसलिए महिलाओं के लिए ये व्रत बेहद ही फलदायी माना जाता है।</h2></div><div><br /></div><div>यह प्रोजेक्ट शीघ्र ही प्रकाशित होनेवाली है।</div><div><br /></div>Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-17453872660222226412020-03-30T22:27:00.000+05:302020-03-30T22:27:29.277+05:30Electromagnetic induction demo with opengl graphic program<div dir="ltr" style="text-align: left;" trbidi="on">
<div>
<div style="text-align: justify;">
Electromagnetic induction or magnetic induction or simply induction is process in which electric current or voltage is passed through a conductor when it is placed in postion around varying magnetic field. Induction also produce current when a conducting material constantly moves around a static magnetic field. The current run through conducting material due to electromagnetic force. Michael Faraday has been credited for discoverey of Law of Induction in 1831. The laws is now called Faraday laws of Electromagnetic induction. We are going demo with help of computer graphics how Electromagnetic induction work. The graphic will be coded in c++ with opengl graphic library.</div>
</div>
<h2>
</h2>
<ul>
</ul>
<div>
<br /></div>
<div>
<h2 style="text-align: left;">
<b>Abstract</b></h2>
</div>
<div>
<b><br /></b></div>
<div>
With help of opengl program computer graphics we are going to demo the <span style="text-align: justify;">Electromagnetic induction. </span><br />
<span style="text-align: justify;"><br /></span>
<span style="text-align: justify;"><br /></span></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKvnsBvcmjl6piZsAqkkIbhOaSpuQAj0w8G-HyFUl4h1CKH7-WzXPAH3Cfp4y9wd2001sk_IjZvNdCcTv0CAlun3EATYxmTopL6Bc7a_KkqXsIlOxb22L5f7w_4c45rLMRemVdfrEdylVi/s1600/1585507483762196-0.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;">
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKvnsBvcmjl6piZsAqkkIbhOaSpuQAj0w8G-HyFUl4h1CKH7-WzXPAH3Cfp4y9wd2001sk_IjZvNdCcTv0CAlun3EATYxmTopL6Bc7a_KkqXsIlOxb22L5f7w_4c45rLMRemVdfrEdylVi/s1600/1585507483762196-0.png" width="400" />
</a>
</div>
<span style="text-align: justify;"><br /></span>
<br />
<h2 style="text-align: left;">
<span style="text-align: justify;">Faraday laws of Electromagnetic induction.</span></h2>
</div>
Before we get into details of the program first you need to understand what <span style="text-align: justify;">Faraday laws of Electromagnetic induction is all about. This will help us in properly demo the </span><span style="text-align: justify;">Electromagnetic induction with opengl program graphically.</span><br />
<span style="text-align: justify;"><br /></span>
<span style="text-align: justify;"><br /></span>
<span style="background: rgb(255 , 255 , 255); border: 0px; box-sizing: border-box; font-family: "karla"; font-size: 16px; letter-spacing: -0.36px; margin: 0px; outline: 0px; padding: 0px;">There are two faraday's law of electromagnetic induction as stated below - </span><br />
<ol style="text-align: left;">
<li><span style="background: rgb(255 , 255 , 255); border: 0px; box-sizing: border-box; font-family: "karla"; font-size: 16px; letter-spacing: -0.36px; margin: 0px; outline: 0px; padding: 0px;"><b>First law :</b> change in magnetic flux linked with a closed coil, an induced emfis produced and current flows through the coil. This induced e.m.f. remains till the flux changes. </span></li>
<li><b>Second law : </b>The induced emf in a coil is equal to the rate of change of flux linkage.</li>
</ol>
<div>
There are many things like equation, maxwell farady law, Lenz law, right thumb rule but we will not focus on them.</div>
<div>
<br /></div>
<div style="text-align: justify;">
There are many application of <span style="text-align: justify;">Electromagnetic induction </span>including electrical components such as inductors and transformers, and devices such as electric motors and generators. The ATM swipe in pos also use the Electromagnetic induction.</div>
<div style="text-align: justify;">
<br /></div>
<h2 style="text-align: justify;">
Description of opengl program</h2>
<div>
Our opengl program demo <span style="text-align: justify;">Electromagnetic induction graphically. We are going to code the program with user interface. </span></div>
<div>
<span style="text-align: justify;"><br /></span></div>
<div>
<span style="text-align: justify;">The opengl program will create two basic model one for static magnet another for rotating magnet. First a wireframe cylinder is needed which will act as conductor or coil. This coil then attached to spherical object which is bulb. A rectangular magnet is also designed. When magnet is place in coil the emf is produced and bulb glows as current runs in coil. Color of sphere is black when there is no current and for current same will change to yellow.</span></div>
<div>
<span style="text-align: justify;"><br /></span></div>
<div>
<span style="text-align: justify;">In another scenario we will rotate magnet and produce current. Rapid movement of magnet can be shown using pencils like cone with rectangular middle. </span></div>
<div>
<span style="text-align: justify;"><br /></span></div>
<div>
<span style="text-align: justify;"><br /></span></div>
<h2 style="text-align: left;">
<span style="text-align: justify;">User Interface</span></h2>
<div>
<span style="text-align: justify;">Following keyboard interface and functionity as given below is used in this opengl program - </span></div>
<div>
<span style="text-align: justify;"><br /></span></div>
<div>
<span style="text-align: justify;">'S/s' key - start the program</span></div>
<div>
<span style="text-align: justify;">'M/m' key - move the magnet</span></div>
<div>
<span style="text-align: justify;">'T/t' key - toggle</span></div>
<div>
<span style="text-align: justify;">'F/f' key - increase the flow</span></div>
<div>
<span style="text-align: justify;">'Esc/e/E' key - to exit any time.</span></div>
<div>
<span style="text-align: justify;"><br /></span></div>
<div>
<span style="text-align: justify;">Email us @ openglprojects@gmail.com for source code and reports.</span></div>
<div>
<span style="text-align: justify;"><br /></span></div>
</div>
Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-67909931003723407572019-01-14T23:05:00.001+05:302019-01-15T00:55:21.456+05:30The Classroom CG lab Programs VTU<div dir="ltr" style="text-align: left;" trbidi="on">
<h3>
Preface </h3>
<div>
OpenGL is used in the CG lab Programs VTU 6th SEM for learning the graphics. The aim of this blog is to give as much exposure to students so they can learn create and explore the new ideas of implementing the Computer graphics.</div>
<div>
<br /></div>
<div>
We have share many projects with free source code. We have also provided the free <a href="https://www.openglprojects.in/search/label/Tutorial">opengl tutorials</a> in our blog. We have shre multiple programs snippets of c/c++ source code in OpenGL. There are many simple projects that can be used for large program with some library based program that can be complex in nature. With the same aim we have come up a program that act as the first part of our complex journey. We name the Program as - "The Classroom".<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpjLfRHxs4ZRNzU5aSQPp3uzu3_BZJQOLTH2Rs4H5oenomTcF71clyKgcOYJXCHtWSqx0f7HJJEzWAaUNNM5xLil5lMadcSIiVZv3F0P9mBSAYgNiVe4z6jOMXFWv_hyCtigXQG6zAsIxN/s1600/The+Classroom+CG+lab+Programs+VTU+6th+SEM.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="734" data-original-width="907" height="322" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpjLfRHxs4ZRNzU5aSQPp3uzu3_BZJQOLTH2Rs4H5oenomTcF71clyKgcOYJXCHtWSqx0f7HJJEzWAaUNNM5xLil5lMadcSIiVZv3F0P9mBSAYgNiVe4z6jOMXFWv_hyCtigXQG6zAsIxN/s400/The+Classroom+CG+lab+Programs+VTU+6th+SEM.PNG" width="400" /></a></div>
<br />
<h3 style="text-align: left;">
Introduction</h3>
</div>
<div>
The Classroom CG lab Programs for VTU 6th SEM student comprised of showing jouney of education when we all are child and start learning the basics. This program will show the graphical representation of the the classroom where a teacher try to teaches student "A for apple B for Ball ...".</div>
<h3 style="text-align: left;">
Components</h3>
<div>
CG lab Programs which we have come up with have so many components or functions. These functions are basically code for small objects like roof, floor, blackboard tube light etc. Different parts of the classroom have different functions to create the objects.</div>
<div>
<br /></div>
<div>
We have created the lady teachers by using the different objects. Like the face we have used the circle to draw it. Similarly the hair we use the semi circle (created code for it). The other parts like nose we have use the lines and vertices with proper coordinates.</div>
<div>
<br /></div>
<div>
There are four kids which are facing towards the teachers has been rendered in this The Classroom CG lab Programs VTU 6th SEM. We have created two benches and each benches consist of two students. </div>
<div>
<br /></div>
<div>
There is dark mode of the program where you can switch off the tubelight and whole class would be in dark.</div>
<h3 style="text-align: left;">
User Interactions</h3>
<div>
n - to continues form start screen and proceed to next.</div>
<div>
b- back to previous screen</div>
<div>
r- restart the screen</div>
<div>
<br /></div>
<h3 style="text-align: left;">
Video Demo</h3>
<div>
<div style="text-align: center;">
<iframe allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/YJrYP4-0muE" width="560"></iframe></div>
</div>
<div>
<br /></div>
<h3 style="text-align: left;">
Source Code</h3>
<div>
To get the source code write to openglprojects@gmail.com with the project title.</div>
</div>
Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-86073870491906579002018-08-26T00:28:00.002+05:302018-08-26T00:28:18.009+05:30OpenGL Chess Board in C++ with Source Code<div dir="ltr" style="text-align: left;" trbidi="on">
Chess is interesting game with 8X8 checker of black and white. Hence we are going to see a program in OpenGL that implement Chess Board in C++ with free Source Code.<br />
<br />
This program implements with the three functions:<br />
<br />
1. Init function - this initalise the opengl program.<br />
2. Chess Boards - this calculate the chess and sqaure and draw the same in the screen.<br />
3. Main function - this is the must and common program for each and every oepngl program.<br />
<br />
chessboard() this function is used for the calculation of the end point of the cordinates of the box to make and is also mainly responsible for calling the drawSquare()<br />
It is also a display function which is called from the main function which is responsible for sending graphics to the display window.<br />
<br />
The forming of boxes is made through iterating first of all from 1st row and making 1st column then 2nd and then till 8th column as a single chessbord contains 8 column.<br />
<br />
The similiar above operation is repeated till all the 8 rows have been iterated making a total 64 boxes (8 rows and 8 column).<br />
<br />
The finally the chessboard() function contains a opengl glFlush() which process all opengl routine as quickly as possible means it flushes all the matter on the display window for the next display.<br />
<br />
This similar to our earlier <a href="https://www.openglprojects.in/2013/02/chess-board-in-opengl-computer-graphics.html#gsc.tab=0">chess board opengl program</a>.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO15KN_5rep-dCs1TK0e7cXZZ4I1Yz9d5kQELQnlM-3MtVEuUzg3wS3yabc3BG8_u3r4-f-vsRpMcH3Jp3r2VSVCC-AtRITenuwKt4yB7Ab6fDPVx0r-JBmHRl0i_PXG1iJNhdLgeF62Ou/s1600/openGL_chess_Board.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="530" data-original-width="680" height="249" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO15KN_5rep-dCs1TK0e7cXZZ4I1Yz9d5kQELQnlM-3MtVEuUzg3wS3yabc3BG8_u3r4-f-vsRpMcH3Jp3r2VSVCC-AtRITenuwKt4yB7Ab6fDPVx0r-JBmHRl0i_PXG1iJNhdLgeF62Ou/s320/openGL_chess_Board.png" width="320" /></a></div>
<h3 style="text-align: left;">
USE OF THE PROGRAM:</h3>
The program OpenGL Chess Board in C++ can be use in the chess board game as well as in making the floor of the house or any other structure.<br />
<h3 style="text-align: left;">
Source Code : </h3>
<div>
<br /></div>
<div>
<div>
#include<windows.h></div>
<div>
#include<glut.h></div>
<div>
int c = 0;</div>
<div>
void init()</div>
<div>
{</div>
<div>
// For displaying the window color</div>
<div>
glClearColor(0, 1, 1, 0);</div>
<div>
// Choosing the type of projection</div>
<div>
glMatrixMode(GL_PROJECTION);</div>
<div>
// for setting the transformation which here is 2D</div>
<div>
gluOrtho2D(0, 800, 0,600);</div>
<div>
}</div>
<div>
<br /></div>
<div>
void drawSquare(GLint x1, GLint y1, GLint x2, GLint y2, GLint x3, GLint y3, GLint x4, GLint y4)</div>
<div>
{</div>
<div>
// if color is 0 then draw white box and change value of color = 1</div>
<div>
if (c == 0)</div>
<div>
{</div>
<div>
glColor3f(1, 1, 1); // white color value is 1 1 1</div>
<div>
c = 1;</div>
<div>
}</div>
<div>
// if color is 1 then draw black box and change value of color = 0</div>
<div>
else</div>
<div>
{</div>
<div>
glColor3f(0, 0, 0); // black color value is 0 0 0</div>
<div>
c = 0;</div>
<div>
}</div>
<div>
<br /></div>
<div>
// Draw Square</div>
<div>
glBegin(GL_POLYGON);</div>
<div>
glVertex2i(x1, y1);</div>
<div>
glVertex2i(x2, y2);</div>
<div>
glVertex2i(x3, y3);</div>
<div>
glVertex2i(x4, y4);</div>
<div>
glEnd();</div>
<div>
}</div>
<div>
void chessboard()</div>
<div>
{</div>
<div>
glClear(GL_COLOR_BUFFER_BIT); // Clear display window</div>
<div>
GLint x, y;</div>
<div>
<br /></div>
<div>
for (x = 0; x <= 800; x += 100)</div>
<div>
{</div>
<div>
for (y = 0; y <= 600; y += 75)</div>
<div>
{</div>
<div>
drawSquare(x, y + 75, x + 100, y + 75, x + 100, y, x, y);</div>
<div>
}</div>
<div>
}</div>
<div>
// Process all OpenGL routine s as quickly as possible</div>
<div>
glFlush();</div>
<div>
}</div>
<div>
<br /></div>
<div>
int main(int agrc, char ** argv)</div>
<div>
{</div>
<div>
// Initialize GLUT</div>
<div>
glutInit(&agrc, argv);</div>
<div>
// Set display mode</div>
<div>
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);</div>
<div>
// Set top - left display window position.</div>
<div>
glutInitWindowPosition(100, 100);</div>
<div>
// Set display window width and height</div>
<div>
glutInitWindowSize(800, 600);</div>
<div>
// Create display window with the given title</div>
<div>
glutCreateWindow("Chess Board using OpenGL in C++");</div>
<div>
// Execute initialization procedure</div>
<div>
init();</div>
<div>
// Send graphics to display window</div>
<div>
glutDisplayFunc(chessboard);</div>
<div>
// Display everything and wait.</div>
<div>
glutMainLoop();</div>
<div>
}</div>
</div>
<br /></div>
Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-69168009184662168812018-05-09T01:50:00.000+05:302018-05-09T01:50:07.372+05:30AirPlane Game Computer Graphics Project<div dir="ltr" style="text-align: left;" trbidi="on">
In our blog we have seen many projects that deals with gaming. Today we are introducing one of the most complex game which we called the "AirPlane Game". It is not similar to copter <a href="https://www.openglprojects.in/2016/04/copter-computer-graphics-game-project.html">game in openGL</a> we have seen earlier. It is more complex and used SOIL.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5tIgtUQaylgq912T8qvJ3uhpJ9w8cekvWK0G5LuGIq6RFITVFdMTGMrlCPhcD9oZAKjK4mkd1GFTQKyfIFEbapOpXQ52zSwkG1Pnys9yBD5neJUk7dcbgoTbFBVyzszBhgGuMubcbxTDl/s1600/airplane+game+computer+graphics.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="768" data-original-width="1366" height="223" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5tIgtUQaylgq912T8qvJ3uhpJ9w8cekvWK0G5LuGIq6RFITVFdMTGMrlCPhcD9oZAKjK4mkd1GFTQKyfIFEbapOpXQ52zSwkG1Pnys9yBD5neJUk7dcbgoTbFBVyzszBhgGuMubcbxTDl/s400/airplane+game+computer+graphics.png" width="400" /></a></div>
<h2 style="text-align: left;">
Objective :</h2>
<div>
The objective of the project is to built a game using opengl and c++, which use the airplane as tool of game. The Computer Graphics game Project use playing have to run the airplane through the scene avoiding the danger as well as keeping the fuel up. As the fuel goes down user game ends, same when you hit by incoming object.</div>
<div>
<br /></div>
<div>
<div>
Features : </div>
<div>
<br /></div>
<div>
1. Splash Screen </div>
<div>
2. Options to Choose the plane</div>
<div>
3. Option to choose the scence</div>
<div>
4. Different menu as mentioned below.</div>
<div>
<br /></div>
<div>
A menu with screen with the following items: </div>
<div>
<br /></div>
<div>
• Play </div>
<div>
• Settings </div>
<div>
• Instructions </div>
<div>
• Credits </div>
<div>
• High Scores </div>
<div>
• Exit </div>
<div>
<br /></div>
<div>
The game use SOIL to load the image hence you have to first set the soil in your project. </div>
</div>
<div>
<br /></div>
<div>
For source code and documents email to openglprojects@gmail.com</div>
<div>
<br /></div>
</div>
Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-29469507153116777992018-04-06T09:29:00.000+05:302018-04-06T09:29:17.954+05:30OpenGL Code Traffic Signals<div dir="ltr" style="text-align: left;" trbidi="on">
Presenting to you another OpenGL Code on Traffic Signals. We have already seen the Advance <a href="https://www.openglprojects.in/2015/08/advance-traffic-signal-c-source-code-projects.html#gsc.tab=0">Traffic Signal OpenGL Program</a>, now we will see another good program for same.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFuZWAXNH7prn_1B757o30_pCd-zg0kAUWgyiiifZ6VfexxKZox-6dyEaEdDjNsR7vgrO39lGW5H5n5OG9W7hzEsFNKBtVYFpYrbmENtAMva4VXjsqswmKMmrol7oBAfbeMfPJAuNdeaHc/s1600/opengl+code+traffic+signal.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="OpenGL Code Traffic Signals" border="0" data-original-height="600" data-original-width="1279" height="187" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFuZWAXNH7prn_1B757o30_pCd-zg0kAUWgyiiifZ6VfexxKZox-6dyEaEdDjNsR7vgrO39lGW5H5n5OG9W7hzEsFNKBtVYFpYrbmENtAMva4VXjsqswmKMmrol7oBAfbeMfPJAuNdeaHc/s400/opengl+code+traffic+signal.PNG" title="OpenGL Code Traffic Signals" width="400" /></a></div>
<h3 style="text-align: left;">
Features </h3>
The OpenGL Code we presenting have many of the good features. Some of the features is listed below -<br />
<br />
<ol style="text-align: left;">
<li><b>Light Options</b> - As in any traffic signal you will see the three lights - red, yellow and green. All the options has been implemented.</li>
<li><b>Vehicles</b> - To keep the OpenGL Code simple for all only three vehicles has been added. Though, if you like to add more do it, you are welcome.</li>
<li><b>Lanes</b> - The right and left lane options is implemented in the program.</li>
<li><b>User Interactions</b> - Both mouse and keyboard interaction has been added to the OpenGL Code. All the user interactions has been listed in the post below.</li>
<li>There is options to speed up the traffic is also in the code.</li>
<li>Program has include the front page for introduction.</li>
</ol>
<h3 style="text-align: left;">
User Interactions</h3>
<div>
As mentioned earlier both mouse and keyboard user interaction has been added to this OpenGL Code. </div>
<div>
<ul style="text-align: left;">
<li><b>Keyboard Interactions</b></li>
</ul>
<div>
<ol style="text-align: left;">
<li><b>Enter - </b>From First Introduction screen to screen press Enter key at beginning.</li>
<li><b>Help - </b> Press <b>'h'</b>to get the help screen.</li>
<li><b>Left to right movement -</b> press <b>'l'</b> to allow only left to right movement of traffic.</li>
<li><b>Right to left movement -</b> press <b>'r'</b> to allow only right to left movement of traffic.</li>
<li><b>Speed up - </b>To speed up the traffic press <b>'s'</b>.</li>
</ol>
<div>
<ul style="text-align: left;">
<li><b>Mouse Interactions</b></li>
</ul>
<div>
<ol style="text-align: left;">
<li><b>Left Mouse Button - </b>This will stop the traffic as Red light gets on.</li>
<li><b>Right Mouse Button (on hold) - </b>Press right mouse button and keep on hold for yellow light.<b> </b></li>
<li><b>Right Mouse Button (released) - </b>After releasing the right mouse button the light changes from yellow to green and traffic moves.</li>
</ol>
<h3 style="text-align: left;">
Video Demo</h3>
<iframe allow="autoplay; encrypted-media" allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/WrrC0g42-zA" width="560"></iframe>
</div>
</div>
</div>
<div>
<br /></div>
<h3 style="text-align: left;">
Downloads</h3>
<div>
You can download the OpenGL Code from the <a href="https://drive.google.com/open?id=1_DXF3ePOxgHQ2CPmcUZsOlwM0A0B0jt2">Google Drive link</a>.</div>
<br /></div>
</div>
Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-52889022296054343232018-04-03T07:00:00.000+05:302018-03-30T01:55:50.700+05:30Simple Travelling Salesman Problem (TSP) OpenGL Graphics Program<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: left;">
Many students looking for OpenGL Graphics Program for Travelling Salesman Problem (TSP), so we came up with it.</div>
<h3 style="clear: both; text-align: left;">
What is Travelling Salesman Problem (TSP)?</h3>
<div>
The Traveling Salesman Problem is problem where a traveler (or salesman) have to visit given no of cities, with known distance. Salesman have to visit each city once with and return to origin city with shortest possible distance.<br />
<br />
The TSP is np-hard problem, where we have to optimized all the possible combinations.<br />
<br />
<b>Solutions</b><br />
<b><br /></b>
How to solve this problem?<br />
<br />
In Computational world we solve this problem with two techniques - 1. Brute Force Approach and 2. Dynamic Programming.<br />
<br />
<b>1. Brute Force Approach</b> - If we have n, no of cities then by brute force approach we will get (n-1)! permutations. We calculate cost (distance) of every permutation and record minimum cost for it. Finally return the permutation with minimum cost. The time complexity for this method is n!.<br />
<br />
<b>2. Dynamic Programming - </b>In this method we create the cost matrix and find the minimum cost.<br />
<br />
Read the <a href="file:///C:/Users/pritirajeevsingh/Documents/ERS-2017-011-LIS.pdf">Dynamic Programming Approach for TSP</a>.<br />
<h3 style="text-align: left;">
Our Travelling Salesman Problem OpenGL Program</h3>
In our program we have restricted ourself to a maximum of 10000 cities. So, at begining user have to input the no of cities subjected to restriction, as mentioned. Each cities are represented as points. Lines joining the cities represent the distance. In initial setup the program creates sequence from the input, then distance is calculated. The swap and iterations are performs on the cities to find out the minimum distance.<br />
<br /></div>
<div>
You can see the image below - </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQOj9Do_DvlFQfFZtgy6-LluoXxw6e63Jl8q1-Xf0o7hJjIhV1QpQz8-os_U6mtJclpel0zyCFt1uknrt7L8T4s6QgenhzWUB2UGM-zuZtUVyz11CXB_N52yOTHCmgdMFkKEAJxJEzW-1d/s1600/tsp+opengl.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="639" data-original-width="1130" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQOj9Do_DvlFQfFZtgy6-LluoXxw6e63Jl8q1-Xf0o7hJjIhV1QpQz8-os_U6mtJclpel0zyCFt1uknrt7L8T4s6QgenhzWUB2UGM-zuZtUVyz11CXB_N52yOTHCmgdMFkKEAJxJEzW-1d/s640/tsp+opengl.PNG" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="clear: both; text-align: left;">
User Interaction</h3>
<div class="separator" style="clear: both;">
The initial distance is calculate at the beginning after user enter the no of cities in command line.</div>
<div class="separator" style="clear: both;">
Next, there is two options for user - <b>key 's'</b> and <b>key 'a'</b>.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
When key <b>'s'</b> is pressed, two cities are selected randomly and swapped only when distance is minimum. This is performed as many times as <b>'s'</b> is pressed and distance calculated after swamp is shown in command line.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Pressing <b>'a'</b>, the swapping performed as many times for different cities(all). After performing each iterations the distance is shown in command line and finally it shows the minimum possible distance. Though this may not be the shortest path or minimum distance covered but optimal solution. </div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<a href="https://github.com/esmitt/RandomTSP-OpenGL/blob/master/main.cpp">Download the source code from the Github</a>. Watch Video Demo below.</div>
<div class="separator" style="clear: both;">
<br /></div>
<iframe allow="autoplay; encrypted-media" allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/6lrZESOfUjQ" width="560"></iframe></div>
Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-90519291045404691762018-03-13T02:39:00.000+05:302018-03-25T02:42:08.893+05:30Robot Computer Graphics Program in C<div dir="ltr" style="text-align: left;" trbidi="on">
OpenGL is amazing, it have potential of great stuffs from creating a small triangle to big structures. We have seen many <a href="http://www.openglprojects.in/2014/02/Simple-animated-robot-opengl-mini-projects-for-6th-sem.html#gsc.tab=0">robot program in OpenGL</a>. Here we come with another robot computer graphics program in C with the use of OpenGL API.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBzNOjG6S5_oLoqu6rv4lFlcRE9yzsUlCvRfvxgkhRYLAFCJqC7lzwFIWo7uzlp4igScHnrWpjvTBbzIgRzVKTRYN5NvxpVk_S_Jh5htsK3nARXM6UOhBi7Rc6SP7xc61uhGYMMUegmvfI/s1600/robot.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="409" data-original-width="511" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBzNOjG6S5_oLoqu6rv4lFlcRE9yzsUlCvRfvxgkhRYLAFCJqC7lzwFIWo7uzlp4igScHnrWpjvTBbzIgRzVKTRYN5NvxpVk_S_Jh5htsK3nARXM6UOhBi7Rc6SP7xc61uhGYMMUegmvfI/s1600/robot.PNG" /></a></div>
<h3 style="clear: both; text-align: left;">
Features </h3>
<div>
<ul style="text-align: left;">
<li>A human features with hands,legs, neck, head and face drawn with simple approach.</li>
<li>A colorful robot with animation made.</li>
<li>A dat file created that used as input for certain restrictions which we can't hard code in program.</li>
<li>Four header files used -
<ol>
<li><b>vars.h</b> - It contains all the global variables used in the program. Also have dimension for the body if the robot.dat is unreadable or not present.</li>
<li><b>file.h</b> - This header used for reading input from robot.dat file.</li>
<li><b>keyboard.h</b> - As name suggests it contains keyboard input functions.</li>
<li><b>mouse.h</b> - Same as keyboard.h, it also have mouse input functions.</li>
</ol>
</li>
<li>Program uses selection buffer to determine what body part was selected, the judging by button pushed and mouse movement, the proper transformation is executed.</li>
</ul>
</div>
<h3 style="clear: both; text-align: left;">
Main Functions</h3>
<div class="separator" style="clear: both;">
main(); read data file, initialize glut stuff</div>
<div class="separator" style="clear: both;">
init(); lighting and material stuff, initialize matrices to identity</div>
<div class="separator" style="clear: both;">
display(); glut display function (calls display_robot(rendermode))</div>
<div class="separator" style="clear: both;">
display_robot(mode); call each of the body part functions</div>
<div class="separator" style="clear: both;">
reshape_window(); glut reshape function</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
draw_body(mode); draw the torso and neck</div>
<div class="separator" style="clear: both;">
draw_head(mode); draw the head and face</div>
<div class="separator" style="clear: both;">
draw_leftarm(mode); draw all of the left arm</div>
<div class="separator" style="clear: both;">
draw_rightarm(mode); draw all of the right arm</div>
<div class="separator" style="clear: both;">
draw_leftleg(mode); draw all of the left leg</div>
<div class="separator" style="clear: both;">
draw_rightleg(mode); draw all of the right leg</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Mouse Interface:</div>
<div class="separator" style="clear: both;">
To translate the robot (x, y direction): click the right mouse button on the torso,</div>
<div class="separator" style="clear: both;">
and drag it around the screen. Once the button is released, the robot will move (in</div>
<div class="separator" style="clear: both;">
the direction of the vector from where the button was pushed to where it was released)</div>
<div class="separator" style="clear: both;">
To move the robot forward and backward (z direction):</div>
<div class="separator" style="clear: both;">
right click once on the torso to move it forward</div>
<div class="separator" style="clear: both;">
left click once on the torso to move it backward</div>
<div class="separator" style="clear: both;">
note: the amount which the robot moves in the z direction for each click can be</div>
<div class="separator" style="clear: both;">
adjusted using the '-' and '+' keys. (default == 0.2), each adjustment is by 0.2</div>
<div class="separator" style="clear: both;">
</div>
<div class="separator" style="clear: both;">
To rotate body parts or the torso(about x or y axis):</div>
<div class="separator" style="clear: both;">
left click on the body part you want to rotate. (hold in the button)</div>
<div class="separator" style="clear: both;">
then drag the mouse the direction you want the robot to rotate.</div>
<div class="separator" style="clear: both;">
upon release of the button, the rotation will occur.</div>
<div class="separator" style="clear: both;">
(the amount of rotation is the distance of the drag (in pixels) mod 360)</div>
<div class="separator" style="clear: both;">
To rotate about the z axis:</div>
<div class="separator" style="clear: both;">
click and drag with the middle button. the amount of rotation is determined</div>
<div class="separator" style="clear: both;">
by the horizontal change (mode 360)</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Keyboard Interface:</div>
<div class="separator" style="clear: both;">
Rotations: push 'q' for x axis, 'w' for y, 'e' for z</div>
<div class="separator" style="clear: both;">
push 'Q' for -x, 'W' for -y, 'E' for -z</div>
<div class="separator" style="clear: both;">
then choose the body part with, 0-9, 'o','p','[',']'</div>
<div class="separator" style="clear: both;">
0-torso, 1- head, 2-leftupperarm, 3-leftlowerarm, 4-leftwrist</div>
<div class="separator" style="clear: both;">
5-rightupperarm, 6- rightlowerarm, 7- rightwrist,</div>
<div class="separator" style="clear: both;">
8-leftupperleg, 9- leftlowerleg, 'o'- left foot,</div>
<div class="separator" style="clear: both;">
'p'-rightupperleg, '['-rightlowerleg, ']'-right foot</div>
<div class="separator" style="clear: both;">
Translation:</div>
<div class="separator" style="clear: both;">
use same q,w,e and Q,W,E for axis/direction selection</div>
<div class="separator" style="clear: both;">
then push 't' to translate</div>
<div class="separator" style="clear: both;">
use + and - to adjust the amount of translation</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<a href="https://drive.google.com/open?id=1T8n12mzL8gApNxGbHV64Ms7INLbDLTIj">Download Source code</a></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
</div>
Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-28179436621259408322018-03-08T23:23:00.000+05:302018-03-08T23:34:38.829+05:30Flag of USA<div dir="ltr" style="text-align: left;" trbidi="on">
We have already seen two flags Programs - OpenGL Flag Hoisting program with Our Indian Tricolor and <a href="http://www.openglprojects.in/2017/05/flag-of-south-africa.html#gsc.tab=0">OpenGL program on flag of South Africa</a>. Today in this post we are going to see another flag program. This flag is about USA.<br />
<h3 style="text-align: left;">
Challenges</h3>
Flag of usa have mainly two parts - one with pattern of stars other the stripes. While maintaining the ration of flag, the pattern has to be drawn in left corner and white and red stripes to rest of the flag. Another problem is the 7 stripes along side of star patterns are smaller in length, we have to keep in mind about it.<br />
<h3 style="text-align: left;">
Approach</h3>
<div>
First thing is done by drawing the star with <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glBegin.xml">GL_TRIANGLE_FAN</a>, using the proper coordinates and angles. Next we draw the pattern of stars using the for loop function with if else conditions, which determines the alternate between rows of five or six stars.</div>
<div>
<br /></div>
<div>
Define a int variable that holds the value of no of stripes(13). This helps in drawing the stripes in loop as well as determine the number of stripes left. This variable also helps in fixing the length of 7 smaller stripes. Alternate stripe colors is done using the if else, and odd even conditions in it. The GL_QUADS has been used to drawn the stripes.</div>
<br />
Unlike our other flag programs here we are displaying the whole screen with flag only. Also there is no pole and no hoisting like we have in <a href="http://www.openglprojects.in/2015/04/flag-hosting-graphics-programs-in-c-cplusplus.html#gsc.tab=0">Computer graphics OpenGL Flag Hoisting program</a> . You can watch the video demo of this projects on Youtube.<br />
<br />
<br />
<div style="text-align: center;">
<iframe allow="autoplay; encrypted-media" allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/WjAaDcRCIlo" width="560"></iframe>
</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<h3 style="text-align: left;">
Source Code</h3>
<div style="text-align: left;">
Shoot an email to <span style="background-color: white; color: #555555; font-family: arial, sans-serif; font-size: 12.8px; white-space: nowrap;">openglprojects@gmail.com for t</span>he Source code of this OpenGL Program, we will sent instruction to get the source code.</div>
</div>
Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-9690524020035387602018-03-01T21:03:00.000+05:302018-03-01T21:03:00.405+05:303D Martyr’s Monument -Shaheed Minar<div dir="ltr" style="text-align: left;" trbidi="on">
A Very Good 3D Project on Martyr’s Monument (Shaheed Minar) Submitted by <a href="mailto:nayeemasis@yahoo.com">Nayeem</a>. It is a 3D Computer Graphics OpenGL projects based on <a href="https://en.wikipedia.org/wiki/Shaheed_Minar,_Dhaka">Bangladesh Shaheed Minar</a> or Martyr’s Monument.<br />
<br />
<b>Note : -</b> This Projects is submitted by Nayeem through the <a href="http://www.openglprojects.in/p/submit-your-project.html">Submit Your Project</a> which you can too submit as well.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwGmrlAl-Ihi46Fobe8P8Rg9zz0Bv5225naECJ5A-CrvJqe8yZUGUsBwe_I7lQPZkTdUctv0QIwZ5MVPZr42Co9vprufnuDrfGg6yg1kWwKH5matNzI4g-4El7VbkVPhdshxpDaDKPQt1I/s1600/3D+Martyr%25E2%2580%2599s+Monument+-Shaheed+Minar.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="720" data-original-width="1280" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwGmrlAl-Ihi46Fobe8P8Rg9zz0Bv5225naECJ5A-CrvJqe8yZUGUsBwe_I7lQPZkTdUctv0QIwZ5MVPZr42Co9vprufnuDrfGg6yg1kWwKH5matNzI4g-4El7VbkVPhdshxpDaDKPQt1I/s640/3D+Martyr%25E2%2580%2599s+Monument+-Shaheed+Minar.jpg" width="640" /></a></div>
<br />
<b><br /></b>
<b>Introduction:</b>
<br />
<b><br /></b>
Martyr’s Monument (Shaheed Minar) is based at Dhaka, it was projects idea of teacher of Nayeem from <b>Ahsanullah University of Science and Technology</b>
<i>Dept. of Computer Science and Engineering</i>. It is wonderful projects based on the ideal martyrs monuments. It is also a tribute for martyrs and to remember them by laying
down flowers to the Martyr’s Monument. <br />
<br />
<b>Tools:</b>
<br />
<b><br /></b>
For this lab Project, they have used the OpenGL 3. The GLUT library has bee used to access OpenGL function. The basic concept from OpenGL which envolve this 3D Martyr’s Monument project are as follows -<br />
<ul>
<li>Transformation</li>
<li>Timer</li>
<li>Color</li>
<li>Lighting</li>
<li>Textures</li>
<li>3d text</li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnDmaBlKRZXw3it7eh6ypYUqKQ6uoFlLpV_GoK_1tg12NJNlathzwfj4cus7IoviVqE-wGC86M2PD1hfCyL0CLcZnnIhf8oYDqgXjlRhwPpFSI7NBn0yurhpBQ8ZBo6ggIOcyXPo3iGXts/s1600/3D+Martyr%25E2%2580%2599s+Monument+-Shaheed+Minar+1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="508" data-original-width="893" height="364" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnDmaBlKRZXw3it7eh6ypYUqKQ6uoFlLpV_GoK_1tg12NJNlathzwfj4cus7IoviVqE-wGC86M2PD1hfCyL0CLcZnnIhf8oYDqgXjlRhwPpFSI7NBn0yurhpBQ8ZBo6ggIOcyXPo3iGXts/s640/3D+Martyr%25E2%2580%2599s+Monument+-Shaheed+Minar+1.PNG" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<br />
<b>Feature:</b> Now we will discuss about the features of this project which are as following -<br />
<br />
<li>The project showcase the Shaheed Minar Structure of Dhaka with the perfect scale.</li>
<li>The structure was design this architecture with perfection with compute graphics using opengl.</li>
<li>Different texture like grass, sky and tiles used in this program to give more realistic look.</li>
<li>There are two mode in the project which show the structure in Day and Night Lighting combination.</li>
<li>There is an option to rotate Shahid Minar at 360o.</li>
<li>It also have text display in 3D.</li>
<div>
<b><br /></b>
<b>Obstacle:</b>
<br />
<b><br /></b>
The main Challenge in completing the project was to find the right coordinate to draw plane for object surface. It was really very
challenging finding original coordinate display it perfectly.
<br />
<b><br /></b>
<b>Future work:</b>
<br />
<br />
<ul style="text-align: left;">
<li>Add City View and flower dropping on base.</li>
<li>Add many peoples around the structure who pay homage by flowers etc.</li>
<li>Add boundary and other stuffs.</li>
<li>Add more animation to the project.</li>
<li>Add sound and music to the project.</li>
</ul>
<br />
<b><br /></b>
<b>Download:</b>
<br />
<b><br /></b>
You can download the source code of the project from <a href="https://github.com/Nayeem170/Shohid-Minar-OpenGL-C-project-">Github</a> as well as report from there.<br />
<b><br /></b>
<br /></div>
</div>
Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-76729349940433749192018-02-10T01:58:00.000+05:302018-02-10T01:58:39.778+05:30Space Invaders Freeglut Project<div dir="ltr" style="text-align: left;" trbidi="on">
C++ graphics program enrich with many development in the technology. Opengl graphics library is one of them that lead to the vast improvement in the computer graphics programming with free apis. <b>Glut </b>- <i>The OpenGL Utility Toolkit is a library of utilities for OpenGL programs. </i>We have many program like<a href="http://www.openglprojects.in/2015/04/flag-hosting-graphics-programs-in-c-cplusplus.html#gsc.tab=0"> Flag hoisting C++ program</a> utilize the use of Glut. There is an alternative to Glut, called <b>Freeglut</b>. In this post we will have a program using freeglut. The is named as Space Invaders.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR9WkBK1efqBZOF5XXNNiswtdUeQBgNeqOYmJUeg5lva_wtBQ3gQDGKV3Hn4n6hTHcc_4tTKeTfsJYQ3dFlyjlgwjofcypmvi1WLkdMgwnh7qZ83UBTdCs3AId7bSsu6HoUFsdso1TLJ-o/s1600/splash+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="171" data-original-width="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR9WkBK1efqBZOF5XXNNiswtdUeQBgNeqOYmJUeg5lva_wtBQ3gQDGKV3Hn4n6hTHcc_4tTKeTfsJYQ3dFlyjlgwjofcypmvi1WLkdMgwnh7qZ83UBTdCs3AId7bSsu6HoUFsdso1TLJ-o/s1600/splash+1.png" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQ7O4m54wIGv7RU9a7fHRSP4dMYPM2GMnC9yLnzoxiS7v5HqOfSm649pIA0byAMUX3xT7QpZdV3hgP-DyhmYKCVAIc4K3UxQvj1GP9H0bRKwWh2kyU2ru8uNiiMqcAPiMsxEC5P0p_mtz-/s1600/splash+2.png" imageanchor="1"><img border="0" data-original-height="171" data-original-width="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQ7O4m54wIGv7RU9a7fHRSP4dMYPM2GMnC9yLnzoxiS7v5HqOfSm649pIA0byAMUX3xT7QpZdV3hgP-DyhmYKCVAIc4K3UxQvj1GP9H0bRKwWh2kyU2ru8uNiiMqcAPiMsxEC5P0p_mtz-/s1600/splash+2.png" /></a></div>
<br />
<h3 style="text-align: left;">
<b>What is Freeglut?</b></h3>
FreeGLUT is an alternative to the OpenGL Utility Toolkit (GLUT) library, the open source alternative. GLUT (and hence FreeGLUT) allows the user to create and manage windows containing OpenGL contexts on a wide range of platforms and also read the mouse, keyboard and joystick functions. FreeGLUT is intended to be a full replacement for GLUT, and has only a few differences.<br />
<br />
Since GLUT has gone into stagnation, FreeGLUT is in development to improve the toolkit. The origninal writer of Freeglut is <b>Pawel W. Olszta</b>. <i>Andreas Umbach and Steve Baker</i> has made significant contribution to Pawel for freeglut.<br />
<h3 style="text-align: left;">
Space Invaders Freeglut Project</h3>
<div>
<ol style="text-align: left;">
<li>This program is similar to other <a href="http://www.openglprojects.in/2016/10/grobot-israel-student-opengl-computer-graphics-program.html">opengl computer graphics programs</a>, where we will use the freeglut libraries instead of glut. <GL/freeglut.h> is replacing <GL/glut.h></li>
<li>The program starts with splash screen, which uses the textures to display the strings. There is separate file used to write the code for the textures.</li>
<li>This is a game project, where there is a aircraft loaded with weapons. Use the gun to target the enemy before the heap crosses the safeline.</li>
<li>Each shot with accuracy give the points to player. Score is displayed as well as overall high score .</li>
<li> Game have different options to choose from like play, exist and choose the difficulty levels.</li>
</ol>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb5XHKOHDYX7kA3h1Y55epEkr5Vs-BnM6PYSeJYDyy2MPzr3AcRgtZkJgOsrRkr_iU9b5-S7dGEvixrgvs1m8bvlZ6A4qcSI7iVUAhm4hx_oNBKBIPghiF0j1toXXbzfMB5otc11nMDbZz/s1600/main+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="320" data-original-width="304" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb5XHKOHDYX7kA3h1Y55epEkr5Vs-BnM6PYSeJYDyy2MPzr3AcRgtZkJgOsrRkr_iU9b5-S7dGEvixrgvs1m8bvlZ6A4qcSI7iVUAhm4hx_oNBKBIPghiF0j1toXXbzfMB5otc11nMDbZz/s1600/main+1.png" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4x-3F8XG2vMb6yb5YTAVS2EXQ0VQvTv1P2SnmTc8j1Qs5NGIEKMaG39ZHl37Z0jLGVXEarMdX473mc1bJEy_Q0wVvWp1TQztv51pU4y3EeSGJmrUI3sN81eYntJxNXfixP7aR8aX93c8g/s1600/play.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="530" data-original-width="505" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4x-3F8XG2vMb6yb5YTAVS2EXQ0VQvTv1P2SnmTc8j1Qs5NGIEKMaG39ZHl37Z0jLGVXEarMdX473mc1bJEy_Q0wVvWp1TQztv51pU4y3EeSGJmrUI3sN81eYntJxNXfixP7aR8aX93c8g/s320/play.png" width="304" /></a></div>
<div>
<br /></div>
</div>
<h3 style="text-align: left;">
Glut and Freeglut</h3>
<div>
This program can be used with the glut as well. Instead of using <GL/freeglut.h> use <GL/glut.h>. Also if some error persist,use the glut alternative of freegult. </div>
<div>
<br /></div>
<div>
You can <a href="https://drive.google.com/file/d/0B4Usyvy-VMLkM09iam9WRThUcG8/view">download the source code</a> as well as the <a href="https://drive.google.com/file/d/0B4Usyvy-VMLkcFNGTXMwUW9KNmc/view">textures c code</a> without any guaranty. </div>
<div>
<br /></div>
<div>
The source code is hosted out of our control, hence we disclaim to any liabilities arose due to use of the code. The copyright is hold by owner as stated in the source code, we govern with the same.We congrats the writer to provide us such a wonderful projects in freeglut.</div>
</div>
Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com1tag:blogger.com,1999:blog-2020194800836807725.post-59012940321800957492017-10-05T21:35:00.000+05:302017-10-05T21:36:51.936+05:30Doll - OpenGL programming using glut<div dir="ltr" style="text-align: left;" trbidi="on">
Every Child likes doll, play with it. Every adult used to have as decor item in their collections. In this post we are going to draw a doll with OpenGL Programming using Glut. We will use the c/c++ and opengl glut to draw a beautiful doll.<br />
<br />
<div style="text-align: center;">
<a class="button" href="https://app.box.com/s/g2zwx72nv16nbp0ji16va096he9567r5" style="background-color: rgb(153 , 0 , 0); font-size: 24px;" target="_blank"><span style="background-color: #990000; color: white; font-size: x-large;">Download Source Code</span><span class="button-overlay"></span><span class="button-overlay"></span></a></div>
<br />
<h3 style="text-align: left;">
1. Outline of the Doll</h3>
First we will outline how our doll should look like. We are going to draw a simple doll, hence we are not going to have complex attire for it. The doll will have head. without hair - simply bald. It will have coat and pant as cloths and the black shoes. The coat will be simple with few button fully closed.<br />
<br />
The doll should look straight forward. The eye would be more opened liked an egg and eyebrow to be cross not parallel nor it is curve. Colors are choice of programmers, hence if you want you can adjust with it as you want it to be.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5MPz1eBMaupTCo-Hx0IaelXeJ0IZJFZg84LrjkoMmypS-Sb8AtAlL9cu8b0sjPFYtFULiJLMrn_DxAGJ9bdQRjVrWohT5DVmvdPMk9Kkad_9M3B_b9aofklQKMVdPpT33X-3UOIhe4ynK/s1600/doll+OpenGL+Programming+using+Glut.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="OpenGL Programming using Glut" border="0" data-original-height="600" data-original-width="600" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5MPz1eBMaupTCo-Hx0IaelXeJ0IZJFZg84LrjkoMmypS-Sb8AtAlL9cu8b0sjPFYtFULiJLMrn_DxAGJ9bdQRjVrWohT5DVmvdPMk9Kkad_9M3B_b9aofklQKMVdPpT33X-3UOIhe4ynK/s400/doll+OpenGL+Programming+using+Glut.png" title="OpenGL Programming using Glut" width="400" /></a></div>
<br />
<br />
<h3 style="text-align: left;">
2. Draw Doll in OpenGL</h3>
As we finished outlining the doll, so we will go to coding part of it. In this OpenGL Programming using Glut, the shape of doll is code as head first, middle part and then legs.<br />
<br />
Face/head is coded using the sphere (gluSphere(gluNewQuadric(),1,100,100);) and put egg like shape with dot on it for eyes. A big line will drawn with high thickness to have the eyebrow. Again same gluSphere(gluNewQuadric() is used for drawing the mouse but radius would be very small. Both left and right, eyes as well as eyebrow is coded separately. All object is drawn using transformation matrix.<br />
<br />
The Middle part have neckring which is drawn by the use of <a href="http://www.openglprojects.in/2017/08/3d-primtives-in-opengl.html">glutSolidTorus</a>. Next is the coat and buttons. The belly coat is drawn by using gluCylinder(gluNewQuadric() and the transformation matrix. There is three button each a small sphere.<br />
<br />
Bellycoatbottom is drawn using the gluDisk(gluNewQuadric(),0,.8,30,30);, yeah with matrix. Last is shoes which covered by gluSphere in footright and footleft functions.<br />
<h3 style="text-align: left;">
<br />3. Rendering</h3>
Before we go to the one of the main features let first define the global variable that will define initial camera position and viewing window values. Also it is important to define Initialization values for lighting.<br />
<br />
We have defined a function which will render the object to make it look more realistic. It helps in enable depth testing, lightning - Ambient, Diffuse and Specular.<br />
<br />
<h3 style="text-align: left;">
4. User Interaction</h3>
One of the important part of this OpenGL Programming using Glut is the user interaction. Here we have both keyboard as well as Mouse interactions. With the help of mouse doll can be move in either of directions. Keyboard interactions is listed below-<br />
<br />
GLUT_KEY_UP - move one up scaling<br />
GLUT_KEY_DOWN - move one down scaling<br />
GLUT_KEY_RIGHT- move one step right<br />
GLUT_KEY_LEFT- move one step left<br />
GLUT_KEY_F10 - toggle whole screen<br />
GLUT_KEY_F9 - toggle doll with interaction<br />
<br />
<h3 style="text-align: left;">
5. Final Thought</h3>
We are able to draw a computer graphics doll with the help of <a href="http://www.openglprojects.in/2016/02/3d-bi-cycle-opengl-programming.html">OpenGL Programming</a> using Glut in C/C++. This program have used the lighting and depth of material which is one of the feature of opengl to give a 3D touch to the objects.<br />
<br />
Do download the source code and share your experience thoughts suggestions etc to us via comments. You can also contact us for any help or any other query use our contact form. Happy learning! Happy Coding!.<br />
<br />
<div style="text-align: center;">
<a class="button" href="https://app.box.com/s/g2zwx72nv16nbp0ji16va096he9567r5" style="background-color: rgb(153 , 0 , 0); font-size: 24px;" target="_blank"><span style="background-color: #990000; color: white; font-size: x-large;">Download Source Code</span><span class="button-overlay"></span><span class="button-overlay"></span></a>
</div>
<br /></div>
Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com0tag:blogger.com,1999:blog-2020194800836807725.post-11479625764807669082017-09-07T04:58:00.001+05:302017-10-05T19:55:43.698+05:30"Ray" OpenGL Sample Program in Visual Studio<div dir="ltr" style="text-align: left;" trbidi="on">
There are many OpenGL <a href="https://www.opengl.org/archives/resources/code/samples/glut_examples/examples/examples.html">sample program</a> written in early days of OpenGL Development. These Sample Program or sample code written by many of the authors in top university.<br />
<br />
In this post were are going to talk about one such sample code written by David Bucciarelli (<a href="mailto:tech.hmw@plus.it">tech.hmw@plus.it</a>).
This article aims to improvise knowledge of seekers, who want to learn opengl programming with sample code. The download source code from the link in the post for this opengl sample code along with mesa version uploaded to github. Do give author the credit if your are using this opengl sample code in your work projects etc.
<br />
<br />
<div style="text-align: center;">
<a class="button" href="https://app.box.com/s/9qwou8aygdw97umtem9ait7bkypjuj91" style="background-color: rgb(153 , 0 , 0); font-size: 24px;" target="_blank"><span style="background-color: #990000; color: white; font-size: x-large;">Download Sample Code</span><span class="button-overlay"></span><span class="button-overlay"></span></a> <a class="button" href="https://raw.githubusercontent.com/JoakimSoderberg/mesademos/master/src/demos/ray.c" style="background-color: rgb(153 , 0 , 0); font-size: 24px;" target="_blank"><span style="background-color: #990000; color: white; font-size: x-large;">Github Mesa Version</span><span class="button-overlay"></span><span class="button-overlay"></span></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen="allowfullscreen" frameborder="0" height="360" src="https://www.youtube.com/embed/X2LVs34a47E" width="540"></iframe></div>
<h3>
1.Overview</h3>
The <b>OpenGL Sample Program</b> has been tested in Microsoft Visual Studio Ultimate 2010 and will works in almost all the other version as well. It can be executed on other platforms like linux, mac os etc with some modification.<br />
<br />
The program consist of mainly a light source and a spherical mirror placed on square strips. There are other sections like help section and two maps one for texture of plane and other for texture of sphere.<br />
<br />
The Program is user interactive, allow use to give input and get desire output. The user interaction has been code with keyboard functionality of OpenGL.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_AGAsL-0DbxhpwqUnKW7e2WYgDrO5lRnaboxpi6_nwU0m2DSTfTVo-KxVmFffiNsRmW7ZTLxcATLcE4Q3VZRQcXkJJC7NF1CXop_lbA9srJmaNhtKLEBP3CKmcCMzdiy5dvAOr4dq3d2n/s1600/Ray+OpenGL+Sample+Program+in+Visual+Studio.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt=""Ray" OpenGL Sample Program in Visual Studio" border="0" data-original-height="516" data-original-width="653" height="315" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_AGAsL-0DbxhpwqUnKW7e2WYgDrO5lRnaboxpi6_nwU0m2DSTfTVo-KxVmFffiNsRmW7ZTLxcATLcE4Q3VZRQcXkJJC7NF1CXop_lbA9srJmaNhtKLEBP3CKmcCMzdiy5dvAOr4dq3d2n/s400/Ray+OpenGL+Sample+Program+in+Visual+Studio.PNG" title=""Ray" OpenGL Sample Program in Visual Studio" width="400" /></a></div>
<br />
<h3>
2. The OpenGL Sample Program</h3>
The Ray V.10 Written by David Bucciarelli is our OpenGL sample program. You need to have MS visual studio to get started with. Also you need to setup the OpenGL environment to execute the apis provided by them for this opengl sample code. Learn <a href="http://www.openglprojects.in/2015/03/glut-visual-studio-installation-on-windows.html">how to setup opengl in MS visual studio</a> in window.<br />
<br />
<strong>Header Files - </strong>First of all include the header files, including glut in the program as we do in "hello world opengl". Thereafter write down the global variable which goes on the way as program progress.<br />
<br />
<b>Functions</b> - This program have many functions including the basic opengl function like init, reshape, key and main. We have other functions which is created for drawing the objects. Since we required these function to do our work they are called and used in program.<br />
<br />
<b>User Interaction</b> - The key board and special key function is written so user can give input and interact with our program.<br />
<h3>
3. Coding</h3>
There is two object - light source and mirror for reflection. We are going to draw both of them with the help of sphere. Hence we need to call the function for drawing sphere. First of all define the radius for the sphere and then also define the width and height for texture (strips) and it's reflection. Also define the frame rate as we are going to use it as well.<br />
<br />
Now we will see all the function one by one (excludes basic functions).<br />
<br />
gettime(void) - with use of glutget function this function used to check the status of glut and time with GLUT_ELAPSED_TIME.<br />
<br />
calcposobs(void) - defines the position (direction) of observer.<br />
<br />
special(int k, int x, int y) - define specil keyboard functions for left, right, up and down navigation keys.<br />
<br />
key(unsigned char k, int x, int y) - normal user interaction functions assign to different keys.<br />
<br />
printstring(void *font, char *string) - to print the string.<br />
<br />
printhelp(void) - use printstring() and display help box. Font we are using is GLUT_BITMAP_HELVETICA (12 and 18 size).<br />
<br />
seelight(float p[3],float dir[3]) - the light source.<br />
<br />
colorcheckmap(float ppos[3], float c[3]) - this draw the plane map.<br />
<br />
updatecheckmap(int slot) - update plane map with change cause by user interaction.<br />
<br />
updatereflectmap(int slot) - update reflection map with change cause by user interaction.<br />
<br />
drawbase(void) - Our base is square strips or checkers, this function draws it.<br />
<br />
drawobj(void) - draw objects.<br />
<br />
dojoy(void)- for joystick functions.<br />
<br />
updatemaps(void) - Update maps<br />
<br />
draw(void) - Finally draws everything on the screen by rendering objects.<br />
<br />
initspherepos(void) - details the sphere position.<br />
<br />
inittextures(void) - for textures<br />
<br />
initdlists(void) - lists<br />
<br />
<h3>
4. User Interactions</h3>
The user interaction in this program is given below -<br />
<br />
h - Togle Help<br />
<br />
f - Togle Fog<br />
<br />
b - Togle Back face culling<br />
<br />
p - Togle Wire frame<br />
<br />
Arrow Keys (navigation key) - Rotate in left, right, up and down respectively to respective keys<br />
<br />
a - Increase velocity<br />
<br />
z - Decrease velocity<br />
if(joyavailable)<br />
j - Togle jostick control (Joystick control available)<br />
else<br />
(No Joystick control available)<br />
<br />
To move the light source: s - left, d - right, e - far, x - near, w - down r - up<br />
<br />
To move the mirror sphere: j - left, k - right, i - far, m - near, u - down o - up<br />
<br />
1 - Togle the plane texture map window<br />
<br />
2 - Togle the sphere texture map window<br />
<div>
<br /></div>
<h3>
5. Final Words</h3>
The ray - OpenGLSample Program on compilation and execution will show a checker with one mirror in sphere shape and a light source. There is also two maps in left and right. These maps show the plane and reflection textures. A helps popup like appears in beginning itself that give glimpse of all user interactions in the program. The Youtube video above is showing demo of all the functionality of this program.<br />
<br />
If you are keen to learn and become an <a href="http://gameprogrammingpatterns.com/introduction.html">game programmer</a> this program is especially relevant to you. Also in point of view of exam or project preparation is opengl sample code is an additional help.<br />
<br />
Finally, do download this program and comment about it in the comment box.
<br />
<br />
<br /></div>
Rajeevhttp://www.blogger.com/profile/03147189487850777395noreply@blogger.com1