OPEN GL DEV C++ LOGO PERTAMINA

pagi untuk semua warga bloger indonesia yang menjalani aktifiasnya masing-masing dan selalu ingin belajar dan terus berkembang untuk terus memanfaatkan waktunya setiap hari dengan hal-hal yang positif, ini adalah tugas praktikum, tugas membuat logo, disini membuat logo sederhana dengan aplikasi dev dan glut logo yang bersimbolis logo pertamini, pelajari lagi ya jangan langsung di copy paste wk, wk, wk. salam hormat untuk blogger indonesia.


#include<GL/glut.h>
GLfloat xRotated, yRotated, zRotated;
void Display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0,0.0,-4.0);
glRotatef(xRotated,1.0,0.0,0.0);
glRotatef(yRotated,0.0,1.0,0.0);
glRotatef(zRotated,0.0,0.0,1.0);
glScalef(2.0,1.0,1.0);
//DEPAN
glBegin(GL_POLYGON); //merah
glColor3f(1.0,0.0,0.0);
glVertex3f(0.3,0.05,0.0);
glVertex3f(0.8,0.05,0.0);
glVertex3f(0.5,0.55,0.0);
glVertex3f(0.0,0.55,0.0);
glEnd();
glBegin(GL_POLYGON); //hijau
glColor3f(0.0,1.0,0.0);
glVertex3f(0.3,-0.05,0.0);
glVertex3f(0.8,-0.05,0.0);
glVertex3f(0.5,-0.55,0.0);
glVertex3f(0.0,-0.55,0.0);
glEnd();
glBegin(GL_POLYGON); //biru
glColor3f(0.0,0.3,1.0);
glVertex3f(0.2,-0.05,0.0);
glVertex3f(-0.25,-0.05,0.0);
glVertex3f(-0.7,-0.8,0.0);
glVertex3f(-0.25,-0.8,0.0);
glEnd();
//BELAKANG
glBegin(GL_POLYGON); //merah
glColor3f(1.0,0.0,0.0);
glVertex3f(0.3,0.05,0.3);
glVertex3f(0.8,0.05,0.3);
glVertex3f(0.5,0.55,0.3);
glVertex3f(0.0,0.55,0.3);
glEnd();
glBegin(GL_POLYGON); //hijau
glColor3f(0.0,1.0,0.0);
glVertex3f(0.3,-0.05,0.3);
glVertex3f(0.8,-0.05,0.3);
glVertex3f(0.5,-0.55,0.3);
glVertex3f(0.0,-0.55,0.3);
glEnd();
glBegin(GL_POLYGON); //biru
glColor3f(0.0,0.3,1.0);
glVertex3f(0.2,-0.05,0.3);
glVertex3f(-0.25,-0.05,0.3);
glVertex3f(-0.7,-0.8,0.3);
glVertex3f(-0.25,-0.8,0.3);
glEnd();
//SAMPING merah
glBegin(GL_POLYGON); //merah
glColor3f(0.8,0.0,0.0);
glVertex3f(0.3,0.05,0.0);
glVertex3f(0.3,0.05,0.3);
glVertex3f(0.8,0.05,0.3);
glVertex3f(0.8,0.05,0.0);
glEnd();
glBegin(GL_POLYGON); //merah
glColor3f(0.8,0.0,0.0);
glVertex3f(0.5,0.55,0.0);
glVertex3f(0.5,0.55,0.3);
glVertex3f(0.0,0.55,0.3);
glVertex3f(0.0,0.55,0.0);
glEnd();
glBegin(GL_POLYGON); //merah
glColor3f(0.8,0.0,0.0);
glVertex3f(0.3,0.05,0.0);
glVertex3f(0.3,0.05,0.3);
glVertex3f(0.0,0.55,0.3);
glVertex3f(0.0,0.55,0.0);
glEnd();
glBegin(GL_POLYGON); //merah
glColor3f(0.8,0.0,0.0);
glVertex3f(0.5,0.55,0.0);
glVertex3f(0.5,0.55,0.3);
glVertex3f(0.8,0.05,0.3);
glVertex3f(0.8,0.05,0.0);
glEnd();
//Samping Hijau
glBegin(GL_POLYGON); //hijau
glColor3f(0.0,0.8,0.0);
glVertex3f(0.3,-0.05,0.0);
glVertex3f(0.3,-0.05,0.3);
glVertex3f(0.8,-0.05,0.3);
glVertex3f(0.8,-0.05,0.0);
glEnd();
glBegin(GL_POLYGON); //hijau
glColor3f(0.0,0.8,0.0);
glVertex3f(0.5,-0.55,0.0);
glVertex3f(0.5,-0.55,0.3);
glVertex3f(0.0,-0.55,0.3);
glVertex3f(0.0,-0.55,0.0);
glEnd();
glBegin(GL_POLYGON); //hijau
glColor3f(0.0,0.8,0.0);
glVertex3f(0.3,-0.05,0.0);
glVertex3f(0.3,-0.05,0.3);
glVertex3f(0.0,-0.55,0.3);
glVertex3f(0.0,-0.55,0.0);
glEnd();
glBegin(GL_POLYGON); //hijau
glColor3f(0.0,0.8,0.0);
glVertex3f(0.5,-0.55,0.0);
glVertex3f(0.5,-0.55,0.3);
glVertex3f(0.8,-0.05,0.3);
glVertex3f(0.8,-0.05,0.0);
glEnd();
//Samping Biru
glBegin(GL_POLYGON); //biru
glColor3f(0.0,0.0,1.0);
glVertex3f(0.2,-0.05,0.0);
glVertex3f(0.2,-0.05,0.3);
glVertex3f(-0.25,-0.05,0.3);
glVertex3f(-0.25,-0.05,0.0);
glEnd();
glBegin(GL_POLYGON); //biru
glColor3f(0.0,0.0,1.0);
glVertex3f(-0.7,-0.8,0.0);
glVertex3f(-0.7,-0.8,0.3);
glVertex3f(-0.25,-0.8,0.3);
glVertex3f(-0.25,-0.8,0.0);
glEnd();
glBegin(GL_POLYGON); //biru
glColor3f(0.0,0.0,1.0);
glVertex3f(0.2,-0.05,0.0);
glVertex3f(0.2,-0.05,0.3);
glVertex3f(-0.25,-0.8,0.3);
glVertex3f(-0.25,-0.8,0.0);
glEnd();
glBegin(GL_POLYGON); //biru
glColor3f(0.0,0.0,1.0);
glVertex3f(-0.25,-0.05,0.3);
glVertex3f(-0.25,-0.05,0.0);
glVertex3f(-0.7,-0.8,0.0);
glVertex3f(-0.7,-0.8,0.3);
glEnd();
glEnd();
glFlush();
glutSwapBuffers();
}
void Reshape(int x, int y)
{
if (y==0||x==0)return;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(40.0,(GLdouble)x/(GLdouble)y,0.5,20.0);
glMatrixMode(GL_MODELVIEW);
glViewport(0,0,x,y);
}
void Idle(void)
{
xRotated +=0.0;//mengatur kecepatan rotasi bergerak
yRotated +=1.0;
zRotated +=0.0;
Display();
}
int main (int argc, char**argv){
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB);
glutInitWindowSize(680,460);
glutCreateWindow("UAS");
xRotated= yRotated= zRotated= 0.0;
glClearColor(1.0, 1.0, 1.0, 1.0);
glutDisplayFunc(Display);
glutReshapeFunc(Reshape);
glutIdleFunc(Idle);
glutMainLoop();
return 0;
}

Komentar

Postingan populer dari blog ini

MEMBUAT WEBSITE INTERFACE RUMAH SAKIT PART 2

OPEN GL DEV C++ LOGO MARBORO