Kamis, 25 Oktober 2012

TUGAS OPENGL


NAMA                  : GYKA KASTANYA
KELAS                    : 3KA 25
NPM                      : 13110065
DOSEN                  : LILY WULANDARI
MATAKULIAH    : GRAFIK KOMPUTER DAN PENGOLAHAN CITRA

TUGAS OPENGL MEMBUAT GARIS VERTIKAL,HORIZONTAL DAN DIAGONAL
1.        
GARIS VERTIKAL
/* OpenGL animation code goes here */
            glClearColor (8.9f, 0.1f, 0.1f, 0.4f);
            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);
        }
    }




1.       
 GARIS HORIZONTAL
/* OpenGL animation code goes here */
            glClearColor (0.5f, 0.7f, 0.3f, 0.6f);
            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.7,0.0,0.0);
            /////////////////////////////////

            glEnd ();
            glPopMatrix ();

            SwapBuffers (hDC);

            Sleep (1);
        }
    }


GARIS DIAGONAL
/* OpenGL animation code goes here */
            glClearColor (0.1f, 0.1f, 0.1f, 0.5f);
            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);
        }
    }






Tidak ada komentar:

Posting Komentar