project Grafkom 3

12 Jan

Bissmillah ini project grafkom selanjutnya check this out !!! ^^…🙂

 

 

#include <gl/glut.h>
void Roket(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_TRIANGLES);
glColor3f(1.0f, 0.0f, 0.0f); glVertex3f(-0.10,  0.30, 0.00);
glColor3f(0.0f, 1.0f, 0.0f); glVertex3f( 0.10,  0.30, 0.00);
glColor3f(0.0f, 0.0f, 1.0f); glVertex3f( 0.00,  0.40, 0.00);
glEnd();
glFlush();

glBegin(GL_POLYGON);
glColor3f (1.0f, 1.0f, 0.8f); glVertex3f ( -0.10, 0.30, 0.00);
glColor3f (0.1f, 1.0f, 0.8f); glVertex3f (  0.10, 0.30, 0.00);
glColor3f (0.1f, 1.0f, 0.0f); glVertex3f (  0.10, 0.30, 0.00);
glColor3f (1.0f, 1.0f, 0.0f); glVertex3f (  0.10, -0.25, 0.00);
glColor3f (0.1f, 1.0f, 0.8f); glVertex3f ( 0.10, -0.25, 0.00);
glColor3f (0.1f, 1.0f, 0.8f); glVertex3f ( -0.10, -0.25, 0.00);
glColor3f (0.0f, 1.0f, 0.0f); glVertex3f ( -0.10, -0.25, 0.00);
glColor3f (0.1f, 1.0f, 1.0f); glVertex3f ( -0.10,  0.30, 0.00);
glEnd();
glFlush();

glPointSize(40.0f);
glBegin(GL_POINTS);
glColor3f(1.0f, .0f, 0.0f);
glVertex3f(0.00, 0.15, 0.0);
glEnd ();
glFlush ();

glLineWidth(3.0f);
glBegin(GL_LINES);
glColor3f(0.0f, 1.0f, 1.0f);
glVertex3f(0.00, 0.40, 0.0);
glVertex3f(0.00, 0.60, 0.0);
glEnd();
glFlush ();

glBegin(GL_POLYGON);
glColor3f (1.0f, 1.0f, 0.8f); glVertex3f ( -0.10, -0.25, 0.00);
glColor3f (0.1f, 1.0f, 0.8f); glVertex3f (  0.10, -0.25, 0.00);
glColor3f (0.1f, 1.0f, 0.0f); glVertex3f (  0.10, -0.25, 0.00);
glColor3f (1.0f, 1.0f, 0.0f); glVertex3f (  0.10, -0.40, 0.00);
glColor3f (0.1f, 1.0f, 0.8f); glVertex3f ( 0.10, -0.40, 0.00);
glColor3f (0.1f, 1.0f, 0.8f); glVertex3f ( -0.10, -0.40, 0.00);
glColor3f (0.0f, 1.0f, 0.0f); glVertex3f ( -0.10, -0.40, 0.00);
glColor3f (0.1f, 1.0f, 1.0f); glVertex3f ( -0.10, -0.25, 0.00);
glEnd();
glFlush();

glBegin(GL_TRIANGLES);
glColor3f(1.0f, 0.0f, 0.0f); glVertex3f(-0.10, -0.25, 0.00);
glColor3f(0.0f, 1.0f, 0.0f); glVertex3f( -0.10, -0.35, 0.00);
glColor3f(0.0f, 0.0f, 1.0f); glVertex3f( -0.25,  -0.35, 0.00);
glEnd();
glFlush();

glBegin(GL_TRIANGLES);
glColor3f(1.0f, 0.0f, 0.0f); glVertex3f( 0.10, -0.25, 0.00);
glColor3f(0.0f, 1.0f, 0.0f); glVertex3f( 0.10, -0.35, 0.00);
glColor3f(0.0f, 0.0f, 1.0f); glVertex3f( 0.25,  -0.35, 0.00);
glEnd();
glFlush();

glLineWidth(3.0f);
glBegin(GL_LINES);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(-0.05, -0.45, 0.0);
glVertex3f(-0.10, -0.60, 0.0);
glEnd();
glFlush ();

glLineWidth(3.0f);
glBegin(GL_LINES);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(-0.03, -0.45, 0.0);
glVertex3f(-0.03, -0.63, 0.0);
glEnd();
glFlush ();

glLineWidth(3.0f);
glBegin(GL_LINES);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(0.03, -0.45, 0.0);
glVertex3f(0.03, -0.63, 0.0);
glEnd();
glFlush ();

glLineWidth(3.0f);
glBegin(GL_LINES);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(0.05, -0.45, 0.0);
glVertex3f(0.10, -0.60, 0.0);
glEnd();
glFlush ();
}
int main(int argc, char* argv[])
{
glutInit(&argc, argv);
glutInitWindowSize(640,480);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA);
glutCreateWindow(“membuat roket”);
glutDisplayFunc(Roket);
glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
glutMainLoop();
return 0;
}

 

kreasi : Tsani..

 

semoga bermanfaat ^^

4 Responses to “project Grafkom 3”

  1. Yukari January 12, 2012 at 9:41 pm #

    sangat” bermanfaat😀 …

  2. tsany January 14, 2012 at 6:27 pm #

    suatu kebanggaan buat saya.. makasih teh…hehehehe

    • bunnythanty January 14, 2012 at 9:34 pm #

      hehe ia sama-sama tsany,, terus belajar ya ^^P

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: