Cara membuat huruf "g" menggunakan OpenGL.
huruf "g" ini dibuat menggunakan primitive GL_LINE_STRIP

Hasil eksekusi:


Lihat Kodenya....


#include "stdlib.h"
#include "gl/glut.h"
void drawPoliline(){ glLineWidth(5); glBegin(GL_LINE_STRIP); glVertex2d (40,5); glVertex2d (40,40); glVertex2d (40,47); glVertex2d (40,40); glVertex2d (36,45); glVertex2d (30,50); glVertex2d (25,54); glVertex2d (20,56); glVertex2d (15,58); glVertex2d (10,59); glVertex2d (-10,59); glVertex2d (-15,57); glVertex2d (-20,55); glVertex2d (-25,52); glVertex2d (-30,48); glVertex2d (-35,42); glVertex2d (-36,40); glVertex2d (-38,37); glVertex2d (-39,33); glVertex2d (-40,30); glVertex2d (-40,15); glVertex2d (-38,10); glVertex2d (-35,5); glVertex2d (-29,0); glVertex2d (-25,-3); glVertex2d (-20,-5); glVertex2d (-15,-6); glVertex2d (-10,-7); glVertex2d (10,-7); glVertex2d (15,-6); glVertex2d (20,-5); glVertex2d (25,-3); glVertex2d (30,-1); glVertex2d (40,2); glVertex2d (40,5); glVertex2d (40,-20); glVertex2d (39,-24); glVertex2d (38,-28); glVertex2d (37,-30); glVertex2d (35,-32); glVertex2d (32,-35); glVertex2d (30,-37); glVertex2d (25,-40); glVertex2d (20,-43); glVertex2d (15,-45); glVertex2d (10,-46); glVertex2d (-15,-46); glVertex2d (-20,-44); glVertex2d (-25,-42); glVertex2d (-30,-38); glVertex2d (-35,-34); glVertex2d (-40,-27); glEnd(); glFlush(); } void main(int argc,char **argv){ glutInit(&argc,argv); glutInitWindowSize(200,200); glutCreateWindow("huruf g"); gluOrtho2D(-200.,200.,-200.,200.); glutDisplayFunc(drawPoliline); glutMainLoop(); }

Selamat Mencobaaaa....!!
Baca Selengkapnya...

2 komentar:

Bangdos mengatakan...

G untuk gulpi ya?? wkwkwkwk.. Thanks ya... Hahaha.

Alivi Nur Rosida mengatakan...

jiaaaaaaaaaaahhhh....
PD banget gulpi ini...
hahahahaha..

About

- alivi -