Selasa, 13 November 2012

Hanya sebuah bintang yang dibuat dari rangkaian huruf :D

#include <stdlib.h>
#include <glut.h>

void bintang(){
glBegin(GL_POLYGON);
glColor3f(1,1,0);
glVertex2f(0,0);
glVertex2f(50,150);
glVertex2f(100,0);
glVertex2f(250,0);
glVertex2f(130,-100);
glVertex2f(200,-250);
glVertex2f(50,-150);
glVertex2f(-100,-250);
glVertex2f(-25,-100);
glVertex2f(-175,0);
glEnd();
}

void renderScene(void){
glClear(GL_COLOR_BUFFER_BIT);
glPushMatrix();
glScalef(1.5,1.5,0);
bintang();
glPopMatrix();
glFlush();
}

void main(int argc,char **argv){
glutInit(&argc,argv);
glutInitWindowPosition(100,100);
glutInitWindowSize(480,480);
glutCreateWindow("BINTANG BINTANG");
gluOrtho2D(-480.,480.,-480.,480.);
glutDisplayFunc(renderScene);
glutMainLoop();
}

4 komentar

mantaff gan...
izin cb..


mmpir gan..
http://pcomtricks.blogspot.com

REPLY

perintah yang ini co eror ??
void main(int argc,char **argv){

REPLY

errornya gimana gan?

REPLY

Hoshiora . 2017 Copyright. All rights reserved. Designed by Blogger Template | Free Blogger Templates