Tulis aja dulu, siapa tahu orang lain butuh :-)

MEMBUAT CHECKERBOARD MENGGUNAKAN CODE BLOCKS

Membuat checkerboard menggunakan code blocks. Silahkan yang mau bermain catur. Hehehehe. bo ongan kok. cuman gambar digital. tidak nyata. Ayoooo belajar komputer grafik. Ilmu menguatkan otak kita dalam menghayal bentuk-bentuk untuk diterapkan dalam komputer. Silahkan yang mau minta scriptnya, ada di bawah ini:

void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,1.0,0.0);
//DIAGONAL TENGAH KE ATAS 3
glRecti(0, 0, 10, 10);
glRecti(20, 0, 30, 10);

glRecti(40, 0, 50, 10);
glRecti(60, 0, 70, 10);
glRecti(0, 20, 10, 30);
glRecti(0, 40, 10, 50);
glRecti(0, 60, 10, 70);
glTranslated(10, 10, 0);
glRecti(0, 60, 10, 70);
//DIAGONAL TENGAH KE ATAS 2
glRecti(0, 0, 10, 10);
glRecti(20, 0, 30, 10);
glRecti(40, 0, 50, 10);
glRecti(60, 0, 70, 10);
glRecti(0, 20, 10, 30);
glRecti(0, 40, 10, 50);
glTranslated(10, 10, 0);
glRecti(0, 0, 10, 10);
glRecti(20, 0, 30, 10);
glRecti(40, 0, 50, 10);
glRecti(60, 0, 70, 10);
glRecti(0, 20, 10, 30);
glRecti(0, 40, 10, 50);
glTranslated(10, 10, 0);
glRecti(0, 0, 10, 10);
glRecti(20, 0, 30, 10);
glRecti(40, 0, 50, 10);
glRecti(60, 0, 70, 10);
glRecti(0, 20, 10, 30);
glRecti(0, 40, 10, 50);
glTranslated(10, 10, 0);
glRecti(0, 40, 10, 50);
//DIAGONAL TENGAH KE ATAS 1
glRecti(0, 0, 10, 10);
glRecti(20, 0, 30, 10);
glRecti(40, 0, 50, 10);
glRecti(60, 0, 70, 10);
glRecti(0, 20, 10, 30);
glTranslated(10, 10, 0);
glRecti(0, 0, 10, 10);
glRecti(20, 0, 30, 10);
glRecti(40, 0, 50, 10);
glRecti(60, 0, 70, 10);
glRecti(0, 20, 10, 30);
glTranslated(10, 10, 0);
glRecti(0, 0, 10, 10);
glRecti(20, 0, 30, 10);
glRecti(40, 0, 50, 10);
glRecti(60, 0, 70, 10);
glRecti(0, 20, 10, 30);
glTranslated(10, 10, 0);
glRecti(0, 0, 10, 10);
glRecti(20, 0, 30, 10);
glRecti(40, 0, 50, 10);
glRecti(60, 0, 70, 10);
glRecti(0, 20, 10, 30);
glTranslated(10, 10, 0);
glRecti(0, 0, 10, 10);
glRecti(20, 0, 30, 10);
glRecti(40, 0, 50, 10);
glRecti(60, 0, 70, 10);
glRecti(0, 20, 10, 30);
glTranslated(10, 10, 0);
glRecti(0, 20, 10, 30);
//DIAGONAL TENGAH KE 4
glRecti(0, 0, 10, 10);
glRecti(20, 0, 30, 10);
glRecti(40, 0, 50, 10);
glRecti(60, 0, 70, 10);
glTranslated(10, 10, 0);
glRecti(60, 0, 70, 10);
//DIAGONAL TENGAH 3
glRecti(0, 0, 10, 10);
glRecti(20, 0, 30, 10);
glRecti(40, 0, 50, 10);
glTranslated(10, 10, 0);
glRecti(0, 0, 10, 10);
glRecti(20, 0, 30, 10);
glRecti(40, 0, 50, 10);
glTranslated(10, 10, 0);
glRecti(0, 0, 10, 10);
glRecti(20, 0, 30, 10);
glRecti(40, 0, 50, 10);
glTranslated(10, 10, 0);
glRecti(40, 0, 50, 10);
//DIAGONAL TENGAH 2
glRecti(0, 0, 10, 10);
glRecti(20, 0, 30, 10);
glTranslated(10, 10, 0);
glRecti(0, 0, 10, 10);
glRecti(20, 0, 30, 10);
glTranslated(10, 10, 0);
glRecti(0, 0, 10, 10);
glRecti(20, 0, 30, 10);
glTranslated(10, 10, 0);
glRecti(0, 0, 10, 10);
glRecti(20, 0, 30, 10);
glTranslated(10, 10, 0);
glRecti(0, 0, 10, 10);
glRecti(20, 0, 30, 10);
glTranslated(10, 10, 0);
glRecti(20, 0, 30, 10);
//DIAGONAL TENGAH 1
glRecti(0,0, 10, 10);
glTranslated(10.0, 10.0, 0);
glRecti(0, 0, 10, 10);
glTranslated(10.0, 10.0, 0);
glRecti(0, 0, 10, 10);
glTranslated(10.0, 10.0, 0);
glRecti(0, 0, 10, 10);
glTranslated(10.0, 10.0, 0);
glRecti(0, 0, 10, 10);
glTranslated(10.0, 10.0, 0);
glRecti(0, 0, 10, 10);
glTranslated(10.0, 10.0, 0);
glRecti(0, 0, 10, 10);
glTranslated(10.0, 10.0, 0);
glRecti(0, 0, 10, 10);
glTranslated(10.0, 10.0, 0);
glRecti(0, 0, 10, 10);
glFlush();
}
Share:

0 komentar:

Post a Comment

ARCHIEV

VISITORS

free counters

FRIENDS

Blog Archive