Tab Menu

Senin, 07 Februari 2011

Membuat Karakter Ω dengan Bahasa C

Mungkin hasilnya belum maksimal, tapi semoga bermanfaat.

image

Berikut listing programnya:

#include <stdlib.h>

#include <glut.h>

void drawOhm (void) {

glClear(GL_COLOR_BUFFER_BIT);

//membuat karakter simbol "Ω"

glLineWidth(100);

glEnable(GL_LINE_SMOOTH);

glBegin(GL_LINE_STRIP);

glVertex2i(-310,-230);

glVertex2i(-100,-230);

glVertex2i(-112,-215);

glVertex2i(-125,-200);

glVertex2i(-135,-190);

glVertex2i(-150,-175);

glVertex2i(-162,-162);

glVertex2i(-175,-150);

glVertex2i(-190,-139);

glVertex2i(-205,-127);

glVertex2i(-220,-110);

glVertex2i(-230,-100);

glVertex2i(-245,-80);

glVertex2i(-253,-70);

glVertex2i(-265,-50);

glVertex2i(-273,-35);

glVertex2i(-278,-20);

glVertex2i(-280,0);

glVertex2i(-281,25);

glVertex2i(-280,50);

glVertex2i(-275,70);

glVertex2i(-267,88);

glVertex2i(-260,105);

glVertex2i(-250,120);

glVertex2i(-235,135);

glVertex2i(-220,150);

glVertex2i(-210,160);

glVertex2i(-200,168);

glVertex2i(-175,185);

glVertex2i(-150,200);

glVertex2i(-130,210);

glVertex2i(-100,220);

glVertex2i(-75,227);

glVertex2i(-50,230);//tengah

glVertex2i(50,230);

glVertex2i(75,227);

glVertex2i(100,220);

glVertex2i(130,210);

glVertex2i(150,200);

glVertex2i(175,185);

glVertex2i(200,168);

glVertex2i(210,160);

glVertex2i(220,150);

glVertex2i(235,135);

glVertex2i(250,120);

glVertex2i(260,105);

glVertex2i(267,88);

glVertex2i(275,70);

glVertex2i(280,50);

glVertex2i(281,25);

glVertex2i(280,0);

glVertex2i(278,-20);

glVertex2i(273,-35);

glVertex2i(265,-50);

glVertex2i(253,-70);

glVertex2i(245,-80);

//http://ingealitalya.co.cc

glVertex2i(230,-100);

glVertex2i(220,-110);

glVertex2i(205,-127);

glVertex2i(190,-139);

glVertex2i(175,-150);

glVertex2i(162,-162);

glVertex2i(150,-175);

glVertex2i(135,-190);

glVertex2i(125,-200);

glVertex2i(112,-215);

glVertex2i(100,-230);

glVertex2i(310,-230);

glEnd();

glFlush();

}

void main(int argc, char **argv) {

glutInit(&argc,argv);

glutInitDisplayMode(GLUT_DEPTH | GLUT_SINGLE | GLUT_RGBA);

glutInitWindowPosition(100,100);

glutInitWindowSize(640,480);

glutCreateWindow("TUGAS Modul CG 2 Kelompok 12");

gluOrtho2D(-320.0,320.0,-240.0,240.0);

glutDisplayFunc(drawOhm);

glutMainLoop();

//http://ingealitalya.co.cc

}

Tidak ada komentar:

Posting Komentar