TUGAS OPENGL


  • GARIS VERTICAL


/* OpenGL animation code goes here */
            glClearColor (8.1f, 0.1f, 0.1f, 0.7f);
            glClear (GL_COLOR_BUFFER_BIT);

            glPushMatrix ();
            glClearColor(1,1,1,0);
            glColor3f(1,1,1); //

            glBegin(GL_LINES);
            glVertex3f(0,0,-0.0);
            glVertex3f(0.0,130.0,0.0);
            /////////////////////////////////

            glEnd ();
            glPopMatrix ();

            SwapBuffers (hDC);

            Sleep (1);
        }
    }

OUTPUT VERTICAL :



  • GARIS HORIZONTAL


/* OpenGL animation code goes here */
            glClearColor (0.1f, 0.1f, 0.9f, 0.9f);
            glClear (GL_COLOR_BUFFER_BIT);

            glPushMatrix ();
            glClearColor(1,1,1,0);
            glColor3f(1,1,1); //

            glBegin(GL_LINES);
            glVertex3f(0,0,-0.0);
            glVertex3f(0.3,0.0,0.0);
            /////////////////////////////////

            glEnd ();
            glPopMatrix ();

            SwapBuffers (hDC);

            Sleep (1);
        }
    }

OUTPUT HORIZONTAL :


  • GARIS DIAGONAL


/* OpenGL animation code goes here */
            glClearColor (9.1f, 0.1f, 0.1f, 0.1f);
            glClear (GL_COLOR_BUFFER_BIT);

            glPushMatrix ();
            glClearColor(1,1,1,0);
            glColor3f(1,1,1); //

            glBegin(GL_LINES);
            glVertex3f(0,0,-0.0);
            glVertex3f(0.9,0.9,0.0);
            /////////////////////////////////

            glEnd ();
            glPopMatrix ();

            SwapBuffers (hDC);

            Sleep (1);
        }
    }

OUTPUT DIAGONAL :




1 comments:

Diny Fahmila mengatakan...

Kita juga mempunyai jurnal mengenai OpenGL, silahkan dihubungi dan dibaca. Berikut linknya:
http://repository.gunadarma.ac.id/bitstream/123456789/3308/1/Teknik%20Cube%20Mapping%20.pdf
Semoga bermanfaat ;)

Posting Komentar

 
Theme Edited by Bekasi Cyber Community