project grafkom4

12 Jan

ini adalah android GRafKom ^^…

 

#include <gl/glut.h>
void Tugas (void)
{
glClear (GL_COLOR_BUFFER_BIT);
glBegin (GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.07, -0.20, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.07, -0.30, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.07, -0.30, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.12, -0.30, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.12, -0.30, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.12, -0.20, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.12, -0.20, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.07, -0.20, 0.0);
glEnd ();
glFlush ();

glBegin (GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.28, -0.20, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.28, -0.30, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.28, -0.30, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.33, -0.30, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.33, -0.30, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.33, -0.20, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.33, -0.20, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.28, -0.20, 0.0);
glEnd ();
glFlush ();

glBegin (GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.13, -0.20, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.13, -0.40, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.13, -0.40, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.27, -0.40, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.27, -0.40, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.27, -0.20, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.27, -0.20, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.13, -0.20, 0.0);
glEnd ();
glFlush ();

glBegin (GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.15, -0.45, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.15, -0.40, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.15, -0.40, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.18, -0.40, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.18, -0.40, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.18, -0.45, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.18, -0.45, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.15, -0.45, 0.0);
glEnd ();
glFlush ();

glBegin (GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.22, -0.45, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.22, -0.40, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.22, -0.40, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.24, -0.40, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.25, -0.40, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.25, -0.45, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.25, -0.45, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.22, -0.45, 0.0);
glEnd ();
glFlush ();

glBegin (GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.13, -0.15, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.13, -0.18, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.13, -0.18, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.24, -0.18, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.27, -0.18, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.27, -0.15, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.27, -0.15, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.13, -0.15, 0.0);
glEnd ();
glFlush ();

glBegin (GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.13, -0.15, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.27, -0.15, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.27, -0.15, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.20, -0.05, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.20, -0.05, 0.0);
glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(0.13, -0.15, 0.0);
glEnd ();
glFlush ();

glBegin (GL_POLYGON);
glColor3f(0.0f, 0.0f, 0.0f);glVertex3f(0.17, -0.12, 0.0);
glColor3f(0.0f, 0.0f, 0.0f);glVertex3f(0.17, -0.13, 0.0);
glColor3f(0.0f, 0.0f, 0.0f);glVertex3f(0.17, -0.13, 0.0);
glColor3f(0.0f, 0.0f, 0.0f);glVertex3f(0.18, -0.13, 0.0);
glColor3f(0.0f, 0.0f, 0.0f);glVertex3f(0.18, -0.13, 0.0);
glColor3f(0.0f, 0.0f, 0.0f);glVertex3f(0.18, -0.12, 0.0);
glColor3f(0.0f, 0.0f, 0.0f);glVertex3f(0.18, -0.12, 0.0);
glColor3f(0.0f, 0.0f, 0.0f);glVertex3f(0.17, -0.12, 0.0);
glEnd ();
glFlush ();

glBegin (GL_POLYGON);
glColor3f(0.0f, 0.0f, 0.0f);glVertex3f(0.22, -0.12, 0.0);
glColor3f(0.0f, 0.0f, 0.0f);glVertex3f(0.22, -0.13, 0.0);
glColor3f(0.0f, 0.0f, 0.0f);glVertex3f(0.22, -0.13, 0.0);
glColor3f(0.0f, 0.0f, 0.0f);glVertex3f(0.23, -0.13, 0.0);
glColor3f(0.0f, 0.0f, 0.0f);glVertex3f(0.23, -0.13, 0.0);
glColor3f(0.0f, 0.0f, 0.0f);glVertex3f(0.23, -0.12, 0.0);
glColor3f(0.0f, 0.0f, 0.0f);glVertex3f(0.23, -0.12, 0.0);
glColor3f(0.0f, 0.0f, 0.0f);glVertex3f(0.22, -0.12, 0.0);
glEnd ();
glFlush ();

}

int main (int argc, char* argv[])
{
glutInit(&argc,argv);
glutInitWindowSize(480,480);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGBA);
glutCreateWindow(“Kedua”);
glutDisplayFunc(Tugas);
glClearColor(0.0f, 0.0f, 1.0f, 0.0f);
glutMainLoop();
return 0;
}

 

karya : pinki

 

semoga bermanfaat ^^

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: