Jumat, 26 Oktober 2012

Tugas 1 Graf Komputer & Pengolahan Citra - Open GL

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 :


Tidak ada komentar:

Posting Komentar