Draw a house using Points OpenGl

In this post i am drawing a simple house in OpenGL. House is consist of some basic Triangles and rectangular shapes by using these i am going to make a simple House. Download Source code void myDisplay(void) { glClear(GL_COLOR_BUFFER_BIT); int y = 200; glBegin(GL_LINE_LOOP); glVertex2i(70, 10 + y ); // draw some points (don't know … Continue reading Draw a house using Points OpenGl

Advertisements

How to draw a Triangle in OpenGL

To draw a triangle we need three points and join them to make a triangle . Download source code   void myDisplay(void) { //glColor3f(1.0f, 1.0f, 0.0f); //yellow glColor3f(0.0f, 1.0f, 0.0f); //Green glBegin(GL_TRIANGLES); glVertex2i(220,240); glVertex2i(320,240); glVertex2i(270,340); glEnd(); glFlush(); } glColor3f(0.0f, 1.0f, 0.0f); //Green This line used for color (RGB). glBegin(GL_TRIANGLES); This function is used to create … Continue reading How to draw a Triangle in OpenGL