• Tidak ada hasil yang ditemukan

DAFTAR PUSTAKA. (diakses 1 maret 2016)

N/A
N/A
Protected

Academic year: 2021

Membagikan "DAFTAR PUSTAKA. (diakses 1 maret 2016)"

Copied!
45
0
0

Teks penuh

(1)

2016)

[2] Anonim. www.opengl.org (diakses 1 maret 2016)

[3] Haemel, Nicholas, et al. 2011 . OpenGL super bible : comprehensive tutorial and reference. USA: Pearson Education, Inc.

[4] Shreiner, Dave, et al. 2013. OpenGL programming guide : the official guide to learning OpenGL, version 4.3. USA: Pearson Education, Inc.

[5] http://rosyidah-binti.blogspot.co.id/2013/04/opengl-glut.html, di akses 1 maret 2016)

[6] http://zonageograp.blogspot.co.id/2011/11/pengertian-transportasi.html, (diakses 1 maret 2016).

[7] http://unikomif8.wordpress.com, (diakses 19 mei 2016)

[8] https://taro328.wordpress.com/2010/11/03/fungsi-kode-opengl/( diakses 19 mei 2016)

[9] http://yuniarelfrida.blogspot.co.id/2012/10/membuat-garis-dengan-opengl_26.html (diakses 19 mei 2016)

[10] https://id.wikipedia.org/wiki/Grafika_komputer_3D (diakses 2juni 2016) [11] http://informatika.web.id/sequence-diagram-2.htm( diakses 2juni 2016) [12] http://zonageograp.blogspot.co.id/2011/11/pengertian-transportasi.html,

(2)

#include <stdlib.h> #include <GL/glut.h> float angle = 0;

static float xpoz = 80, ypoz = 0, zpoz = 0,d = -12, e = -5,f = -5, pintu=0; //float pintu = 0.0f; void init(void) { glClearColor (0.3, 0.3, 0.5, 0.0); glOrtho(-12,12,-6,6,-35,35); glEnable(GL_DEPTH_TEST); glShadeModel (GL_SMOOTH); glMatrixMode (GL_PROJECTION); glLoadIdentity (); gluPerspective(80.10,2.2, 1.0, 100.0); glMatrixMode (GL_MODELVIEW); }

void kotak(float x1,float y1,float z1,float x2,float y2,float z2) { //depan glVertex3f(x1,y1,z1); glVertex3f(x2,y1,z1); glVertex3f(x2,y2,z1); glVertex3f(x1,y2,z1); //atas glVertex3f(x1,y2,z1); glVertex3f(x2,y2,z1); glVertex3f(x2,y2,z2); glVertex3f(x1,y2,z2);

(3)

//belakang glVertex3f(x1,y2,z2); glVertex3f(x2,y2,z2); glVertex3f(x2,y1,z2); glVertex3f(x1,y1,z2); //bawah glVertex3f(x1,y1,z2); glVertex3f(x2,y1,z2); glVertex3f(x2,y1,z1); glVertex3f(x1,y1,z1); //samping kiri glVertex3f(x1,y1,z1); glVertex3f(x1,y2,z1); glVertex3f(x1,y2,z2); glVertex3f(x1,y1,z2); //samping kanan glVertex3f(x2,y1,z1); glVertex3f(x2,y2,z1); glVertex3f(x2,y2,z2); glVertex3f(x2,y1,z2); }

void Kubus(float x1,float y1,float x2,float y2,float x3,float y3,float x4,float y4,float z1,float z2,float z3){

//sisi atas glVertex3d(x3,y3,z2); glVertex3d(x4,y4,z2); glVertex3d(x4,y4,z1); glVertex3d(x3,y3,z1); //sisi depan glVertex3d(x1,y1,z2); glVertex3d(x2,y2,z2); glVertex3d(x3,y3,z2);

(4)

glVertex3d(x4,y4,z2); //sisi kanan glVertex3d(x2,y2,z2); glVertex3d(x2,y2,z1); glVertex3d(x3,y3,z1); glVertex3d(x3,y3,z2); //sisi belakang glVertex3d(x1,y1,z1); glVertex3d(x2,y2,z1); glVertex3d(x3,y3,z1); glVertex3d(x4,y4,z1); //sisi kiri glVertex3d(x1,y1,z2); glVertex3d(x1,y1,z1); glVertex3d(x4,y4,z1); glVertex3d(x4,y4,z2); //sisi bawah glVertex3d(x1,y1,z2); glVertex3d(x2,y2,z2); glVertex3d(x2,y2,z1); glVertex3d(x1,y1,z1); }

void Atap1(float x1,float y1,float x2,float y2,float x3,float y3,float x4,float y4,float z1,float z2,float z3)

{ glColor3f(0.3,0.2,0.1);//sisi kanan; glVertex3d(x3,y3,z1); glVertex3d(x3,y3,z2); glVertex3d(x3,y1,z3); glColor3f(0.3,0.2,0.1);//sisi kiri;

(5)

glVertex3d(x4,y4,z2); glVertex3d(x4,y4,z1); glVertex3d(x4,y1,z3); }

void Atap2(float x1,float y1,float x2,float y2,float x3,float y3,float x4,float y4,float z1,float z2,float z3)

{ glColor3f(0.4,0,0.6);//sisi belakang glVertex3d(x4,y4,z1); glVertex3d(x3,y3,z1); glVertex3d(x3,y1,z3); glVertex3d(x4,y1,z3); glColor3f(0.4,0,0.6);//sisi depan; glVertex3d(x3,y3,z2); glVertex3d(x4,y4,z2); glVertex3d(x4,y1,z3); glVertex3d(x3,y1,z3); }

void dinding(float x1,float y1,float z1,float x2,float y2,float z2) {

//depan

glTexCoord2f(0.0, 0.0); glVertex3f(x1,y1,z1); glTexCoord2f(0.0, 1.0);

(6)

glVertex3f(x2,y1,z1); glTexCoord2f(1.0, 1.0); glVertex3f(x2,y2,z1); glTexCoord2f(1.0, 0.0); glVertex3f(x1,y2,z1); //atas glTexCoord2f(0.0, 0.0); glVertex3f(x1,y2,z1); glTexCoord2f(0.0, 1.0); glVertex3f(x2,y2,z1); glTexCoord2f(1.0, 1.0); glVertex3f(x2,y2,z2); glTexCoord2f(1.0, 0.0); glVertex3f(x1,y2,z2); //belakang glTexCoord2f(0.0, 0.0); glVertex3f(x1,y2,z2); glTexCoord2f(0.0, 1.0); glVertex3f(x2,y2,z2); glTexCoord2f(1.0, 1.0); glVertex3f(x2,y1,z2); glTexCoord2f(1.0, 0.0); glVertex3f(x1,y1,z2); //bawah glTexCoord2f(0.0, 0.0); glVertex3f(x1,y1,z2); glTexCoord2f(1.0, 0.0); glVertex3f(x2,y1,z2); glTexCoord2f(1.0, 1.0); glVertex3f(x2,y1,z1); glTexCoord2f(0.0, 1.0); glVertex3f(x1,y1,z1);

(7)

//samping kiri glTexCoord2f(0.0, 0.0); glVertex3f(x1,y1,z1); glTexCoord2f(1.0, 0.0); glVertex3f(x1,y2,z1); glTexCoord2f(1.0, 1.0); glVertex3f(x1,y2,z2); glTexCoord2f(0.0, 1.0); glVertex3f(x1,y1,z2); //samping kanan glTexCoord2f(0.0, 0.0); glVertex3f(x2,y1,z1); glTexCoord2f(1.0, 0.0); glVertex3f(x2,y2,z1); glTexCoord2f(1.0, 1.0); glVertex3f(x2,y2,z2); glTexCoord2f(0.0, 1.0); glVertex3f(x2,y1,z2); } void display(void) {

glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity (); //digunakan untuk me-nonaktifkan/me-reset transformasi sebelumnya

glTranslatef(d,e,f); //digunakan untuk melakukan perpindahan posisi gelombang

glRotatef(xpoz,0,1,0); glRotatef(ypoz,1,0,0); glRotatef(zpoz,0,0,1);

(8)

//BUS //Bodi 1 glColor3f(1.0, 0.8, 0.0); glPushMatrix(); glTranslatef(0.0, 3.8, 0.0); glScalef(4.0, 1.0, 1.5); glutSolidCube(6.0f); glPopMatrix(); //Kaca Belakang glColor3f(0.0, 0.0, 1.0); glPushMatrix(); glTranslatef(-12.0, 5.0, 0.0); glScalef(0.05, 0.5, 1.2); glutSolidCube(6.0f); glPopMatrix(); //Lampu Rem glColor3f(1.0, 0.0, 0.0); glPushMatrix(); glTranslatef(-12.1, 2.0, -3.5); glScalef(0.02, 0.19, 0.08); glutSolidCube(6.0f); glPopMatrix(); glColor3f(1.0, 0.0, 0.0); glPushMatrix(); glTranslatef(-12.1, 2.0, 3.5); glScalef(0.02, 0.19, 0.08); glutSolidCube(6.0f); glPopMatrix();

(9)

//Lampu Depan glColor3f(1.0, 1.0, 1.0); glPushMatrix(); glTranslatef(12.1, 2.0, -3.5); glScalef(0.05, 0.02, 0.1); glutSolidCube(6.0f); glPopMatrix(); glColor3f(1.0, 1.0, 1.0); glPushMatrix(); glTranslatef(12.1, 2.0, 3.5); glScalef(0.05, 0.02, 0.1); glutSolidCube(6.0f); glPopMatrix(); //Kaca Depan glColor3f(0.0, 0.0, 1.0); glPushMatrix(); glTranslatef(12.0, 5.0, 0.0); glScalef(0.05, 0.5, 1.2); glutSolidCube(6.0f); glPopMatrix(); //Kaca pinggir glColor3f(0.0, 0.0, 1.0); glPushMatrix(); glTranslatef(-1.5, 5.0, 4.0); glScalef(3.3, 0.5, 0.2); glutSolidCube(6.0f); glPopMatrix(); glColor3f(0.0, 0.0, 1.0);

(10)

glPushMatrix(); glTranslatef(-1.5, 5.0, -4.0); glScalef(3.3, 0.5, 0.2); glutSolidCube(6.0f); glPopMatrix(); //Pintu Kanan glColor3f(0.5, 0.5, 0.5); glPushMatrix(); glTranslatef(11.1, 3.9, 4.0); glScalef(0.15, 0.8, 0.2); glutSolidCube(6.0f); glPopMatrix(); glPushMatrix(); glColor3f(0.5, 0.5, 0.5); glTranslatef(10.1, 5.1, 4.0); glScalef(0.25, 0.4, 0.2); glutSolidCube(6.0f); glPopMatrix(); //Pintu Kiri glColor3f(0.5, 0.5, 0.5); glPushMatrix(); glTranslatef(11.1, 3.9, -4.0); glScalef(0.15, 0.8, 0.2); glutSolidCube(6.0f); glPopMatrix(); glPushMatrix(); glColor3f(0.5, 0.5, 0.5); glTranslatef(10.1, 5.1, -4.0); glScalef(0.25, 0.4, 0.2); glutSolidCube(6.0f);

(11)

glPopMatrix(); glPushMatrix(); glColor3f(1.0, 1.0, 1.0); glScalef(0.35, 0.35, 0.25); glTranslatef(25.0, 4.5, -19.3); glutSolidTorus(2, 3, 20, 30); glPopMatrix(); //Bodi 2 glColor3f(1.0, 1.0, 0.0); glPushMatrix(); glTranslatef(0.0, 9.8, 0.0); glScalef(3.8, 1.0, 1.5); glutSolidCube(6.0f); glPopMatrix(); //Kaca Belakang glColor3f(0.0, 0.0, 1.0); glPushMatrix(); glTranslatef(-11.4, 9.8, 0.0); glScalef(0.05, 0.5, 1.2); glutSolidCube(6.0f); glPopMatrix(); //Kaca Depan glColor3f(0.0, 0.0, 1.0); glPushMatrix(); glTranslatef(11.4, 9.8, 0.0); glScalef(0.05, 0.5, 1.2); glutSolidCube(6.0f); glPopMatrix();

(12)

//Kaca pinggir glColor3f(0.0, 0.0, 1.0); glPushMatrix(); glTranslatef(0.0, 9.8, 4.0); glScalef(3.3, 0.5, 0.2); glutSolidCube(6.0f); glPopMatrix(); glColor3f(0.0, 0.0, 1.0); glPushMatrix(); glTranslatef(-7.8, 9.8, -4.0); glScalef(1.0, 0.5, 0.2); glutSolidCube(6.0f); glPopMatrix(); glColor3f(0.0, 0.0, 1.0); glPushMatrix(); glTranslatef(7.8, 9.8, -4.0); glScalef(1.0, 0.5, 0.2); glutSolidCube(6.0f); glPopMatrix(); //pintu lantai 2 glColor3f(0.5, 0.3, 0.2); glPushMatrix(); glTranslatef(0.0, 9.8, -4.0); glScalef(1.0, 0.8, 0.2); glutSolidCube(6.0f); glPopMatrix(); //pintu lantai 2

(13)

glColor3f(0.5, 0.0, 0.2); glPushMatrix(); glTranslatef(0.0, 9.8, -4.6); glScalef(0.05, 0.8, 0.005); glutSolidCube(6.0f); glPopMatrix(); //Bodi 3 glColor3f(1.0, 1.0, 1.0); glPushMatrix(); glTranslatef(-5.0, 15.8, 0.0); glScalef(1.8, 1.0, 1.5); glutSolidCube(6.0f); glPopMatrix(); //kaca lantai 3 glColor3f(0.0, 0.0, 1.0); glPushMatrix(); glTranslatef(-4.8, 15.8, -4.5); glScalef(1.5, 0.5, 0.05); glutSolidCube(6.0f); glPopMatrix(); glColor3f(0.0, 0.0, 1.0); glPushMatrix(); glTranslatef(-4.8, 15.8, 4.5); glScalef(1.5, 0.5, 0.05); glutSolidCube(6.0f); glPopMatrix(); //Bodi Jam

(14)

glPushMatrix(); glTranslatef(0.0f, 15.5f, 0.0f); glColor4f(2.0, 2.0, 2.0, 2.0); glScalef(0.89,1.0,0.89); glutSolidCube(6.0f); glPopMatrix(); glPushMatrix(); glTranslatef(0.0f, 12.8f, 0.0f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(1.07,0.08,1.07); glutSolidCube(6.0f); glPopMatrix(); //relief tiang glPushMatrix(); glTranslatef(-2.3f, 15.6f, 0.0f); glColor4f(0.0, 0.0, 0.0, 0.0); glScalef(0.1,1.5,1.8); glutWireCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(2.3f, 15.6f, 0.0f); glColor4f(0.0, 0.0, 0.0, 0.0); glScalef(0.1,1.5,1.8); glutWireCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(0.0f, 15.6f, -2.3f); glColor4f(0.0, 0.0, 0.0, 0.0);

(15)

glScalef(1.8,1.5,0.1); glutWireCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(0.0f, 15.6f, 2.3f); glColor4f(0.0, 0.0, 0.0, 0.0); glScalef(1.8,1.5,0.1); glutWireCube(3.0f); glPopMatrix(); //relief dinding glPushMatrix(); glTranslatef(-1.0f, 14.5f, 0.0f); glColor4f(0.0, 0.0, 0.0, 0.0); glScalef(0.38,0.5,1.8); glutWireCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(1.0f, 14.5f, 0.0f); glColor4f(0.0, 0.0, 0.0, 0.0); glScalef(0.38,0.5,1.8); glutWireCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(0.0f, 14.5f, 1.0f); glColor4f(0.0, 0.0, 0.0, 0.0); glScalef(1.8,0.5,0.38); glutWireCube(3.0f); glPopMatrix();

(16)

glPushMatrix(); glTranslatef(0.0f, 14.5f, -1.0f); glColor4f(0.0, 0.0, 0.0, 0.0); glScalef(1.8,0.5,0.38); glutWireCube(3.0f); glPopMatrix();

//lantai pagar atas glPushMatrix(); glTranslatef(2.5f, 13.5f, 0.0f); glColor4f(0.5, 0.5, 0.0, 0.8); glScalef(2.5,0.08,1.2); glutSolidCube(6.0f); glPopMatrix(); //pagar depan glPushMatrix(); glTranslatef(8.5f, 13.7f, 3.5f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(0.05,0.7,0.05); glutSolidCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(6.25f, 13.7f, 3.5f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(0.05,0.7,0.05); glutSolidCube(3.0f); glPopMatrix(); glPushMatrix();

(17)

glTranslatef(2.5f, 14.2f, 3.5f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(4.0,0.05,0.05); glutSolidCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(2.5f, 14.7f, 3.5f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(4.0,0.05,0.05); glutSolidCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(3.75f, 14.0f, 3.5f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(0.05,0.5,0.05); glutSolidCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(1.5f, 14.0f, 3.5f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(0.05,0.5,0.05); glutSolidCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(-1.25f, 14.0f, 3.5f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(0.05,0.5,0.05); glutSolidCube(3.0f);

(18)

glPopMatrix(); glPushMatrix(); glTranslatef(-3.5f, 14.0f, 3.5f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(0.05,0.5,0.05); glutSolidCube(3.0f); glPopMatrix(); //pagar belakang glPushMatrix(); glTranslatef(8.5f, 13.7f, -3.5f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(0.05,0.7,0.05); glutSolidCube(3.0f); glPopMatrix(); //pintu lt 3 glPushMatrix(); glTranslatef(6.25f, 13.7f, -3.5f); glColor4f(0.8, 0.0, 0.8, 0.8); glScalef(0.05,0.7,0.05); glutSolidCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(5.25f, 13.7f, -3.5f); glColor4f(0.8, 0.0, 0.8, 0.8); glScalef(0.05,0.7,0.05); glutSolidCube(3.0f); glPopMatrix(); //end pintu 3

(19)

glPushMatrix(); glTranslatef(2.5f, 14.7f, -3.5f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(4.0,0.05,0.05); glutSolidCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(2.5f, 14.2f, -3.5f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(4.0,0.05,0.05); glutSolidCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(3.75f, 13.7f, -3.5f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(0.05,0.7,0.05); glutSolidCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(1.5f, 13.7f, -3.5f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(0.05,0.7,0.05); glutSolidCube(3.0f); glPopMatrix(); //pagar kanan glPushMatrix(); glTranslatef(8.5f, 13.7f, 1.25f); glColor4f(0.8, 0.8, 0.8, 0.8);

(20)

glScalef(0.05,0.7,0.05); glutSolidCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(8.5f, 14.2f, 0.0f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(0.05,0.05,2.4); glutSolidCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(8.5f, 14.7f, -0.0f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(0.05,0.05,2.4); glutSolidCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(8.5f, 13.7f, -1.25f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(0.05,0.7,0.05); glutSolidCube(3.0f); glPopMatrix(); //pagar kiri glPushMatrix(); glTranslatef(-3.5f, 14.0f, 1.25f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(0.05,0.5,0.05); glutSolidCube(3.0f); glPopMatrix();

(21)

glPushMatrix(); glTranslatef(-3.5f, 14.2f, 0.0f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(0.05,0.05,2.4); glutSolidCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(-3.5f, 14.7f, -0.0f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(0.05,0.05,2.4); glutSolidCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(-3.5f, 14.0f, -1.25f); glColor4f(0.8, 0.8, 0.8, 0.8); glScalef(0.05,0.5,0.05); glutSolidCube(3.0f); //End Pagar glPushMatrix(); glTranslatef(0.0f, 16.5f, 0.0f); glColor4f(0.0, 0.0, 0.0, 0.0); glScalef(1.4,1.4,27.4); glutWireTorus(0.1f, 0.8f, 12.0f, 12.0f); glPopMatrix(); glPushMatrix(); glTranslatef(0.0f, 16.5f, 0.0f); glRotatef(90, 5, 260, 0);

(22)

glColor4f(0.0, 0.0, 0.0, 0.0); glScalef(1.4,1.4,27.4);

glutWireTorus(0.1f, 0.8f, 12.0f, 12.0f); glPopMatrix();

//jarum jam depan glPushMatrix(); glTranslatef(0.0f, 16.8f, 2.6f); glColor4f(0.0, 0.0, 0.0, 0.0); glScalef(0.01,0.3,0.1); glutWireCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(-0.3f, 16.4f, 2.6f); glColor4f(0.0, 0.0, 0.0, 0.0); glScalef(0.3,0.01,0.1); glutWireCube(3.0f); glPopMatrix();

//jarum jam belakang glPushMatrix(); glTranslatef(0.0f, 16.8f, -2.6f); glColor4f(0.0, 0.0, 0.0, 0.0); glScalef(0.01,0.3,0.1); glutWireCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(0.3f, 16.4f, -2.6f); glColor4f(0.0, 0.0, 0.0, 0.0); glScalef(0.3,0.01,0.1);

(23)

glutWireCube(3.0f); glPopMatrix();

//jarum jam kanan glPushMatrix(); glTranslatef(2.6f, 16.8f, 0.0f); glColor4f(0.0, 0.0, 0.0, 0.0); glScalef(0.1,0.3,0.01); glutWireCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(2.6f, 16.4f, 0.3f); glColor4f(0.0, 0.0, 0.0, 0.0); glScalef(0.1,0.01,0.3); glutWireCube(3.0f); glPopMatrix();

//jarum jam kiri glPushMatrix(); glTranslatef(-2.6f, 16.8f, 0.0f); glColor4f(0.0, 0.0, 0.0, 0.0); glScalef(0.1,0.3,0.01); glutWireCube(3.0f); glPopMatrix(); glPushMatrix(); glTranslatef(-2.6f, 16.4f, -0.3f); glColor4f(0.0, 0.0, 0.0, 0.0); glScalef(0.1,0.01,0.3); glutWireCube(3.0f); glPopMatrix();

(24)

//Terminal glPushMatrix(); glColor4f(0.5f, 0.5f, 0.5f, 1.0f); glScalef(4.0,0.02,4.5); glutSolidCube(9.0f); glPopMatrix(); //Dasar2 glPushMatrix(); glColor3f(0.0, 0.0, 0.0); glTranslatef(0.0, 0.0, 28.5); glScalef(1.5,0.02,1.9); glutSolidCube(9.0f); glPopMatrix(); //Dinding glPushMatrix(); glColor3f(0.5, 0.5, 0.5); glTranslatef(17.8,12, 0); glScalef(0,2.8,4.7); glutSolidCube(9.0f); glPopMatrix(); //Trotoar kanan glPushMatrix(); glColor3f(0.5, 0.5, 0.5); glTranslatef(7.0, 0.0, 28.5); glScalef(0.05,0.1,1.9); glutSolidCube(9.0f); glPopMatrix();

(25)

//Trotoar Kiri glPushMatrix(); glColor3f(0.5, 0.5, 0.5); glTranslatef(-7.0, 0.0, 28.5); glScalef(0.05,0.1,1.9); glutSolidCube(9.0f); glPopMatrix(); //Plang //Tiang kanan glPushMatrix(); glColor4f(0.5f, 0.5f, 0.5f, 1.0f); glTranslatef(7.0, 5.0, 36.0); glScaled(1.0, 20.0 , 0.5); glutSolidCube(0.5f); glPopMatrix(); //Tiang kiri glPushMatrix(); glColor4f(0.5f, 0.5f, 0.5f, 1.0f); glTranslatef(-7.0, 5.0, 36.0); glScaled(1.0, 20.0 , 0.5); glutSolidCube(0.5f); glPopMatrix(); //Plang glPushMatrix(); glColor4f(0.8f, 0.5f, 0.0f, 1.0f); glTranslatef(0.0, 10.0, 36.0); glScaled(30.0, 5.0 , 0.5); glutSolidCube(0.5f); glPopMatrix(); //Ban Belakang

(26)

glPushMatrix(); glColor3f(1.0, 1.0, 1.0); glScalef(0.35, 0.35, 0.25); glTranslatef(25.0, 4.5, 19.3); glutSolidTorus(2, 3, 20, 30); glPopMatrix(); //Velg glPushMatrix(); glColor3f(0.0, 0.0, 0.0); glScalef(0.5, 0.5, 0.5); glTranslatef(17.5, 2.5, 8.0); glutSolidSphere(2, 10, 20); glPopMatrix(); //Velg glPushMatrix(); glColor3f(0.0, 0.0, 0.0); glScalef(0.5, 0.5, 0.5); glTranslatef(-17.5, 2.5, 8.0); glutSolidSphere(2, 10, 20); glPopMatrix(); //Ban Depan glPushMatrix(); glColor3f(1.0, 1.0, 1.0); glScalef(0.35, 0.35, 0.25); glTranslatef(-25.0, 4.5, -19.3); glutSolidTorus(2, 3, 20, 30); glPopMatrix(); //Velg glPushMatrix();

(27)

glColor3f(0.0, 0.0, 0.0); glScalef(0.5, 0.5, 0.5); glTranslatef(17.5, 2.5, -8.0); glutSolidSphere(2, 10, 20); glPopMatrix(); glPushMatrix(); glColor3f(1.0, 1.0, 1.0); glScalef(0.35, 0.35, 0.25); glTranslatef(-25.0, 4.5, 19.3); glutSolidTorus(2, 3, 20, 30); glPopMatrix(); //Velg glPushMatrix(); glColor3f(0.0, 0.0, 0.0); glScalef(0.5, 0.5, 0.5); glTranslatef(-17.5, 2.5, -8.0); glutSolidSphere(2, 10, 20); glPopMatrix(); //END BUS

//Desain Dalem BUS Lantai 3 //lantai glColor3f(1.0, 0.8, 0.3); glPushMatrix(); glTranslatef(60.0, -1.2, -19.0); glScalef(4, 0, 3.5); glutSolidCube(6.0f); glPopMatrix();

(28)

//laptop 1 glPushMatrix(); glTranslated(60, -0.65 ,-18.7); glBegin(GL_QUADS); glColor3f(0.0, 0.0, 0.0); dinding(-10,3,0,-6.3,3.3,2.5); dinding(-10,5.3,0,-6.3,3,0.3); glColor3f(0.0, 0.5, 1.0); dinding(-9.5,3,0,-6.5,5.0,0.35); glEnd(); glPopMatrix(); //laptop 2 glPushMatrix(); glTranslated(64, -0.65 ,-18.7); glBegin(GL_QUADS); glColor3f(0.0, 0.0, 0.0); dinding(-10,3,0,-6.3,3.3,2.5); dinding(-10,5.3,0,-6.3,3,0.3); glColor3f(0.0, 0.5, 1.0); dinding(-9.5,3,0,-6.5,5.0,0.35); glEnd(); glPopMatrix(); //meja 1 glPushMatrix(); glTranslated(60, -3 ,-16.7); glBegin(GL_QUADS); glColor3f(0.0, 0.5, 1.0); dinding(-10,5,0.3,-2,5.3,-3.3); glEnd(); glPopMatrix();

(29)

glPushMatrix(); glTranslated(60, -4.2 ,-16.7); glBegin(GL_QUADS); dinding(-10,3,0,-9.5,6.5,0.3); dinding(-2.5,3,0,-2,6.5,0.3); dinding(-10,3,-3,-9.5,6.5,-3.3); dinding(-2.5,3,-3,-2,6.5,-3.3); glEnd(); glPopMatrix(); //kursi glPushMatrix(); glTranslated(60, -4.5 ,-10.7); glBegin(GL_QUADS); glColor3f(0.2, 0.8, 1.0); dinding(-10,5,0.3,-2,4.8,-3.3); glEnd(); glPopMatrix(); glPushMatrix(); glTranslated(60, -4.2 ,-10.7); glBegin(GL_QUADS); dinding(-10,3,0,-9.5,5,0.3); dinding(-2.5,3,0,-2,5,0.3); dinding(-10,3,-3,-9.5,5,-3.3); dinding(-2.5,3,-3,-2,5,-3.3); glEnd(); glPopMatrix(); //sofa glPushMatrix(); glTranslated(50, -1.2 ,-8.7); glBegin(GL_QUADS);

(30)

glColor3f(0.7, 0.3, 1.0); dinding(9.2,2,-4.2,16.8,3,-19); glEnd(); glPopMatrix(); glPushMatrix(); glTranslated(50, -1.2 ,-8.7); glBegin(GL_QUADS); glColor3f(0.7, 0.3, 0.0); dinding(16.2,0,-19,16.8,1.5,-20); dinding(16.2,0,-4,16.8,1.5,-5); dinding(9,0,-19,9.8,1.5,-20); dinding(9,0,-4,9.8,1.5,-5); //alas dinding(9,1.5,-4,16.8,2,-20); //tempat sandar belakang dinding(9.2,2,-19,16.8,5,-20); glEnd(); glPopMatrix(); glPushMatrix(); glTranslated(50, -1.2 ,-8.7); glBegin(GL_QUADS); dinding(9.3,3,-16.5,13,3.5,-18.7); dinding(13.3,3,-16.5,16.5,3.5,-18.7); glEnd(); glPopMatrix();

//Desain Dalam Bus lantai 2

(31)

glColor3f(0.8, 0.8, 0.1); glPushMatrix(); glTranslatef(30.0, -1.2, -20.95); glScalef(4, 0, 6.5); glutSolidCube(6.0f); glPopMatrix(); //dinding glPushMatrix(); glTranslated(25, 10.25 , -39.95); glBegin(GL_QUADS); glColor3f(0.8, 0.8, 0.1); dinding(17,9,0,-5,-11.5,0); glEnd(); glPopMatrix(); //kursi bisnis 1 glPushMatrix(); glTranslated(40, -4.5 ,-20.7); glBegin(GL_QUADS); glColor3f(0.4, 0.6, 1.0); dinding(-10,5,0.3,-2,4.8,-3.3); glEnd(); glPopMatrix(); glPushMatrix(); glTranslated(40, -4.2 ,-20.7); glBegin(GL_QUADS); dinding(-10,3,0,-9.5,5,0.3); dinding(-2.5,3,0,-2,5,0.3); glColor3f(0.6, 0.1, 0.6); dinding(-10,7,0,-2,5,0.3); glColor3f(0.4, 0.6, 1.0);

(32)

dinding(-10,3,-3,-9.5,5,-3.3); dinding(-2.5,3,-3,-2,5,-3.3); glEnd(); glPopMatrix(); //kursi bisnis 2 glPushMatrix(); glTranslated(30, -4.5 ,-20.7); glBegin(GL_QUADS); glColor3f(0.4, 0.6, 1.0); dinding(-10,5,0.3,-2,4.8,-3.3); glEnd(); glPopMatrix(); glPushMatrix(); glTranslated(30, -4.2 ,-20.7); glBegin(GL_QUADS); dinding(-10,3,0,-9.5,5,0.3); dinding(-2.5,3,0,-2,5,0.3); glColor3f(0.6, 0.1, 0.6); dinding(-10,7,0,-2,5,0.3); glColor3f(0.4, 0.6, 1.0); dinding(-10,3,-3,-9.5,5,-3.3); dinding(-2.5,3,-3,-2,5,-3.3); glEnd(); glPopMatrix(); //kursi bisnis 3 glPushMatrix(); glTranslated(40, -4.5 ,-10.7); glBegin(GL_QUADS); glColor3f(0.4, 0.6, 1.0); dinding(-10,5,0.3,-2,4.8,-3.3);

(33)

glEnd(); glPopMatrix(); glPushMatrix(); glTranslated(40, -4.2 ,-10.7); glBegin(GL_QUADS); dinding(-10,3,0,-9.5,5,0.3); dinding(-2.5,3,0,-2,5,0.3); glColor3f(0.6, 0.1, 0.6); dinding(-10,7,0,-2,5,0.3); glColor3f(0.4, 0.6, 1.0); dinding(-10,3,-3,-9.5,5,-3.3); dinding(-2.5,3,-3,-2,5,-3.3); glEnd(); glPopMatrix(); //kursi bisnis 4 glPushMatrix(); glTranslated(30, -4.5 ,-10.7); glBegin(GL_QUADS); glColor3f(0.4, 0.6, 1.0); dinding(-10,5,0.3,-2,4.8,-3.3); glEnd(); glPopMatrix(); glPushMatrix(); glTranslated(30, -4.2 ,-10.7); glBegin(GL_QUADS); dinding(-10,3,0,-9.5,5,0.3); dinding(-2.5,3,0,-2,5,0.3); glColor3f(0.6, 0.1, 0.6); dinding(-10,7,0,-2,5,0.3); glColor3f(0.4, 0.6, 1.0); dinding(-10,3,-3,-9.5,5,-3.3);

(34)

dinding(-2.5,3,-3,-2,5,-3.3); glEnd(); glPopMatrix(); //TV 1 glPushMatrix(); glTranslated(43, 3 , -38.5); glBegin(GL_QUADS); glColor3f(0.2, 0.2, 0.2); glTexCoord2f(0.0, 0.0); glVertex3f(-9.7,2.3,-0.1); glTexCoord2f(0.0, 1.0); glVertex3f(-5.3,2.3,-0.1); glTexCoord2f(1.0, 1.0); glVertex3f(-5.3,5.1,-0.1); glTexCoord2f(1.0, 0.0); glVertex3f(-9.7,5.1,-0.1); glEnd(); glPopMatrix(); glPushMatrix(); glTranslated(43, 3 , -38.95); glBegin(GL_QUADS); glColor3f(0.0, 0.0, 0.0); dinding(-10,2,0,-5,5.5,0.3); glEnd(); glPopMatrix(); glPushMatrix(); glTranslated(43, 3 , -39.9); glBegin(GL_QUADS);

(35)

glColor3f(0.2, 0.3, 0.6); dinding(-10,3,0,-6.3,3.3,1); glEnd(); glPopMatrix(); //TV 2 glPushMatrix(); glTranslated(33, 3 , -38.5); glBegin(GL_QUADS); glColor3f(0.2, 0.2, 0.2); glTexCoord2f(0.0, 0.0); glVertex3f(-9.7,2.3,-0.1); glTexCoord2f(0.0, 1.0); glVertex3f(-5.3,2.3,-0.1); glTexCoord2f(1.0, 1.0); glVertex3f(-5.3,5.1,-0.1); glTexCoord2f(1.0, 0.0); glVertex3f(-9.7,5.1,-0.1); glEnd(); glPopMatrix(); glPushMatrix(); glTranslated(33, 3 , -38.95); glBegin(GL_QUADS); glColor3f(0.0, 0.0, 0.0); dinding(-10,2,0,-5,5.5,0.3); glEnd(); glPopMatrix(); glPushMatrix(); glTranslated(33, 3 , -39.9);

(36)

glBegin(GL_QUADS); glColor3f(0.2, 0.3, 0.6); dinding(-10,3,0,-6.3,3.3,1); glEnd();

glPopMatrix();

//desain BUS tingkat 1

//lantai glColor3f(0.7, 0.3, 0.3); glPushMatrix(); glTranslatef(30.0, -1.0, 20.95); glScalef(3.9, 0, 5.2); glutSolidCube(6.0f); glPopMatrix(); //kursi 1 glPushMatrix(); glTranslatef(39.5, 0.0, 10); glColor3f(0.8f, 0.4f, 0.1f); glScalef(2.3, 1.5, 7.3); glutSolidCube(1.0f); glPopMatrix(); glPushMatrix(); glTranslatef(40.5, 1.0, 10); glColor3f(0.8f, 0.4f, 0.1f); glScalef(0.3, 1.5, 7.3); glutSolidCube(1.0f); glPopMatrix(); //kursi 2

(37)

glPushMatrix(); glTranslatef(39.5, 0.0, 20); glColor3f(0.8f, 0.4f, 0.1f); glScalef(2.3, 1.5, 7.3); glutSolidCube(1.0f); glPopMatrix(); glPushMatrix(); glTranslatef(40.5, 1.0, 20); glColor3f(0.8f, 0.4f, 0.1f); glScalef(0.3, 1.5, 7.3); glutSolidCube(1.0f); glPopMatrix(); //kursi 3 glPushMatrix(); glTranslatef(39.5, 0.0, 30); glColor3f(0.8f, 0.4f, 0.1f); glScalef(2.3, 1.5, 7.3); glutSolidCube(1.0f); glPopMatrix(); glPushMatrix(); glTranslatef(40.5, 1.0, 30); glColor3f(0.8f, 0.4f, 0.1f); glScalef(0.3, 1.5, 7.3); glutSolidCube(1.0f); glPopMatrix(); //kursi belakang 1 glPushMatrix(); glTranslatef(33.5, 0.0, 34);

(38)

glColor3f(0.8f, 0.4f, 0.1f); glScalef(7.3, 1.5, 2.3); glutSolidCube(1.0f); glPopMatrix(); glPushMatrix(); glTranslatef(33.5, 1.0, 35); glColor3f(0.8f, 0.4f, 0.1f); glScalef(7.3, 1.5, 0.3); glutSolidCube(1.0f); glPopMatrix(); //kursi belakang 2 glPushMatrix(); glTranslatef(27.5, 0.0, 34); glColor3f(0.8f, 0.4f, 0.1f); glScalef(7.3, 1.5, 2.3); glutSolidCube(1.0f); glPopMatrix(); glPushMatrix(); glTranslatef(27.5, 1.0, 35); glColor3f(0.8f, 0.4f, 0.1f); glScalef(7.3, 1.5, 0.3); glutSolidCube(1.0f); glPopMatrix(); //kursi ngadep 1 glPushMatrix(); glTranslatef(31.5, 0.0, 10.0); glColor3f(0.8f, 0.4f, 0.1f); glScalef(5.3, 1.5, 7.3);

(39)

glutSolidCube(1.0f); glPopMatrix(); glPushMatrix(); glTranslatef(31.5, 1.0, 10.0); glColor3f(0.8f, 0.7f, 0.1f); glScalef(0.3, 1.5, 7.3); glutSolidCube(1.0f); glPopMatrix(); //1 glPushMatrix(); glTranslatef(31.5, 0.0, 18.0); glColor3f(0.8f, 0.4f, 0.1f); glScalef(5.3, 1.5, 7.3); glutSolidCube(1.0f); glPopMatrix(); glPushMatrix(); glTranslatef(31.5, 1.0, 18.0); glColor3f(0.8f, 0.7f, 0.1f); glScalef(0.3, 1.5, 7.3); glutSolidCube(1.0f); glPopMatrix(); //2 glPushMatrix(); glTranslatef(31.5, 0.0, 26.0); glColor3f(0.8f, 0.4f, 0.1f); glScalef(5.3, 1.5, 7.3); glutSolidCube(1.0f); glPopMatrix();

(40)

glPushMatrix(); glTranslatef(31.5, 1.0, 26.0); glColor3f(0.8f, 0.7f, 0.1f); glScalef(0.3, 1.5, 7.3); glutSolidCube(1.0f); glPopMatrix();

//kursi ngadep tengah glPushMatrix(); glTranslatef(21.5, 0.0, 10); glColor3f(0.8f, 0.4f, 0.1f); glScalef(2.3, 1.5, 7.3); glutSolidCube(1.0f); glPopMatrix(); glPushMatrix(); glTranslatef(20.5, 1.0, 10); glColor3f(0.8f, 0.4f, 0.1f); glScalef(0.3, 1.5, 7.3); glutSolidCube(1.0f); glPopMatrix(); //1 glPushMatrix(); glTranslatef(21.5, 0.0, 20); glColor3f(0.8f, 0.4f, 0.1f); glScalef(2.3, 1.5, 7.3); glutSolidCube(1.0f); glPopMatrix(); glPushMatrix();

(41)

glTranslatef(20.5, 1.0, 20); glColor3f(0.8f, 0.4f, 0.1f); glScalef(0.3, 1.5, 7.3); glutSolidCube(1.0f); glPopMatrix(); //2 glPushMatrix(); glTranslatef(21.5, 0.0, 30); glColor3f(0.8f, 0.4f, 0.1f); glScalef(2.3, 1.5, 7.3); glutSolidCube(1.0f); glPopMatrix(); glPushMatrix(); glTranslatef(20.5, 1.0, 30); glColor3f(0.8f, 0.4f, 0.1f); glScalef(0.3, 1.5, 7.3); glutSolidCube(1.0f); glPopMatrix(); glutSwapBuffers();

//Fungsi berikutnya adalah glutSwapBuffers(), yaitu digunakan untuk menukar bagian belakan buffer menjadi buffer layar (screen buffer). //Dalam modus double-buffered, perintah menggambar pada layar, tetapi menggambar pada buffer belakang layar.

//Pada saat ingin menampilkan gambar, gambar yang berada di buffer belakang layar dipindahkan ke buffer layar, sehingga menghasilkan animasi yang sempurna

}

void keyboard(unsigned char key, int x, int y) {

(42)

switch (key) {

// These will allow you to force some extra rotation by pressing the 'x,n,y,m,z' key. case 'x': xpoz=xpoz+5; if (xpoz>360) xpoz=0; glutPostRedisplay(); break; case 'c': xpoz=xpoz-5; if (xpoz>360) xpoz=0; glutPostRedisplay(); break; case 'y': ypoz=ypoz+5; if (ypoz>360) ypoz=90; glutPostRedisplay(); break; case 'u': ypoz=ypoz-5; if (ypoz>360) ypoz=0; glutPostRedisplay(); break; case 'z': zpoz = zpoz+5; if (zpoz>360) zpoz=0; glutPostRedisplay(); break; case 'w': e = e - 1; glutPostRedisplay(); break;

(43)

case 's': e = e + 1; glutPostRedisplay(); break; case 'a': d = d + 1; glutPostRedisplay(); break; case 'd': d = d - 1; glutPostRedisplay(); break; case 'q': f = f + 1; glutPostRedisplay(); break; case 'e': f = f - 1; glutPostRedisplay(); break;

case 27:; //Tekan ESC untuk exit exit(0);

} }

int main(int argc, char** argv) {

glutInit(&argc, argv);

glutInitDisplayMode (GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);

glutInitWindowSize (1024, 720); glutInitWindowPosition (100, 100); glutCreateWindow("Tugas Akhir");

(44)

init (); glutDisplayFunc(display); glutKeyboardFunc(keyboard); glutMainLoop(); return 0; }

(45)

Referensi

Dokumen terkait

Hasil perhitungan ketepatan prediksi di atas menunjukkan bahwa apabila Diklat structural ASN di Sekretariat Daerah Kota Bitung dapat ditingkatkan sebesar nilai score

Gambar 9 Sebaran jumlah populasi rentan, infeksi , dan sembuh pada Model 3 dalam satu tahun simulasi. (a)

Bertitik tolak dari pemikiran tersebut, Jurusan Ekonomi Islam - Fakultas Ekonomi dan Bisnis Islam UIN Imam Bonjol Padang melakukan upaya untuk menghimpun berbagai pendapat,

SMB atau Server Message Block adalah protokol untuk transfer file dilingkungan Windows yang berada pada layer …… dalam TCP/IP model.. Physical address dari Network Interface Card

Perlakuan yang diberikan pada kelinci terdiri dari terapi pioglitazone 1,4 mg/kgBB/hari dan perlakuan pemberian pare hijau varietas pare ayam dalam bentuk fruit pulp

Hasil Post-Test kelas eksperimen lebih tinggi di banding kelas kontrol disebabkan tidak lepas dari kelebihan-kelebihan penerapan model pembelajaran SAVI Shoimin

Pada Agustus 2010, penduduk yang bekerja sebagai buruh/karyawan/pegawai masih mendominasi struktur ketenagakerjaan Kepri menurut status pekerjaan utamanya, yaitu

Hasil penelitian mendapatkan sebagian besar pekerja (77,1%) tidak produktif, terutama dipengaruhi oleh faktor lingkungan fisik yang tidak memenuhi syarat, yaitu iklim