Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include <GL/gl.h>
- #include <GL/glu.h>
- #include <GL/glut.h>
- #include <stdlib.h>
- static int slices = 25;
- static int stacks = 25;
- float ratio;
- float yCord = -2.5;
- float zCord = -60.0;
- float RotateX = -30.0f;
- float RotationSpeedX = 0.0f;
- float RotateY = 30.0f;
- float RotationSpeedY = 0.0f;
- float KecRot = 0.0f;
- float KecRot2 = 0.0f;
- float LightZ = 26.0f;
- float LightX = 0.0f;
- float LightY = 15.0f;
- GLfloat light_ambient[] = { 0.0f, 0.0f, 0.0f, 1.0f };
- GLfloat light_diffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f };
- GLfloat light_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
- GLfloat light_position[] = { LightX, LightY, LightZ, 0.0f };
- GLfloat mat_ambient[] = { 0.7f, 0.7f, 0.7f, 1.0f };
- GLfloat mat_diffuse[] = { 0.8f, 0.8f, 0.8f, 1.0f };
- GLfloat mat_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
- GLfloat high_shininess[] = { 100.0f };
- static void resize(int width, int height) {
- const float ar = (float)width / (float)height;
- glViewport(0, 0, width, height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(-ar, ar, -1.0, 1.0, 2.0, 100.0);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- }
- void keyboard(unsigned char key, int x, int y) {
- switch (key) {
- case 27:
- exit(0);
- break;
- glutPostRedisplay();
- }
- }
- void specialkeys(int key, int x, int y) {
- switch (key) {
- case GLUT_KEY_LEFT:
- RotationSpeedX += 0.07;
- if (RotationSpeedX >= 1.0)
- RotationSpeedX = 1.0;
- break;
- case GLUT_KEY_RIGHT:
- RotationSpeedX -= 0.07;
- if (RotationSpeedX <= -1.0)
- RotationSpeedX = -1.0;
- break;
- case GLUT_KEY_UP:
- zCord += 0.2;
- if (zCord >= -10.0)
- zCord = -10.0;
- break;
- case GLUT_KEY_DOWN:
- zCord -= 0.1;
- if (zCord <= -60.0)
- zCord = -60.0;
- break;
- case GLUT_KEY_END:
- RotationSpeedY -= 0.07;
- if (RotationSpeedY <= -1.0)
- RotationSpeedY = -1.0;
- break;
- case GLUT_KEY_HOME:
- RotationSpeedY += 0.07;
- if (RotationSpeedY >= 1.0)
- RotationSpeedY = 1.0;
- break;
- case GLUT_KEY_PAGE_DOWN:
- yCord += 0.1f;
- if (yCord >= 15.0)
- yCord = 15.0;
- break;
- case GLUT_KEY_PAGE_UP:
- yCord -= 0.1;
- if (yCord <= -15.0)
- yCord = -15.0;
- break;
- default:
- break;
- }
- glutPostRedisplay();
- }
- void sumbu(void) {
- glColor3f(1.0, 0.0, 0.0);
- glBegin(GL_LINES);
- glVertex3f(-30.0, 0.0, 0.0);
- glVertex3f(30.0, 0.0, 0.0);
- glEnd();
- glColor3f(0.0, 1.0, 0.0);
- glBegin(GL_LINES);
- glVertex3f(0.0, 10, 0.0);
- glVertex3f(0.0, -10.0, 0.0);
- glEnd();
- glColor3f(0.0, 0.0, 1.0);
- glBegin(GL_LINES);
- glVertex3f(0.0, 0.0, -30.0);
- glVertex3f(0.0, 0.0, 30.0);
- glEnd();
- }
- static void display(void) {
- gluLookAt(1.0, 10.0, 15.0, 0.0, 0.0, 5.0, 0.0, 10.0, 0.0);
- const double t = glutGet(GLUT_ELAPSED_TIME) / 10000.0;
- const double t2 = glutGet(GLUT_ELAPSED_TIME) / 20.0;
- const double a = t * 90.0, b = t / 2, c = t / 10, d = t2 * 90;
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glLoadIdentity();
- glTranslatef(0.0, yCord, zCord);
- glTranslatef(0.0, yCord, 0.0);
- glRotatef(RotateX, 0, 1.0, 0);
- glRotatef(RotateY, 1.0, 0, 0);
- RotateX += RotationSpeedX;
- RotateY += RotationSpeedY;
- glPushMatrix();
- sumbu();
- glPopMatrix();
- ////////////////////////////////////////LANTAI Kemas Risman Fauzan - 10116313
- //Pondasi lantai
- glPushMatrix();
- glTranslated(0.0, 0.1, 0.0);
- glScaled(60.0, 0.5, 30.0);
- glColor3d(0.0, 0.0, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //lantai
- glPushMatrix();
- glTranslated(0.0, 0.4, 0.0);
- glScaled(60.0, 0.1, 30.0);
- glColor3d(1.0, 1.0, 1.0);
- glutSolidCube(1);
- glPopMatrix();
- ///////////////////////////////////////TEMBOK - KEMAS RISMAN 10116313
- //tembok 1 sumbu z
- glPushMatrix();
- glTranslated(-29.5, 7.5, 4.5);
- glScaled(1.0, 14.0, 21.0);
- glColor3d(1.0, 1.0, 1.0);
- glutSolidCube(1);
- glPopMatrix();
- //tembok 2 sumbu x
- glPushMatrix();
- glTranslated(-27.0, 7.5, -5.5);
- glScaled(5.0, 14.0, 1.0);
- glColor3d(1.0, 1.0, 1.0);
- glutSolidCube(1);
- glPopMatrix();
- //tembok 3 sumbu z
- glPushMatrix();
- glTranslated(-25.0, 7.5, -6.5);
- glScaled(1.0, 14.0, 2.0);
- glColor3d(1.0, 1.0, 1.0);
- glutSolidCube(1);
- glPopMatrix();
- //tembok 4 sumbu z atas
- glPushMatrix();
- glTranslated(-25.0, 13.0, -10.5);
- glScaled(1.0, 3.0, 6.0);
- glColor3d(1.0, 1.0, 1.0);
- glutSolidCube(1);
- glPopMatrix();
- //tembok 5 sumbu z
- glPushMatrix();
- glTranslated(-25.0, 7.5, -14.0);
- glScaled(1.0, 14.0, 2.0);
- glColor3d(1.0, 1.0, 1.0);
- glutSolidCube(1);
- glPopMatrix();
- //tembok 6 sumbu x
- glPushMatrix();
- glTranslated(2.5, 7.5, -14.5);
- glScaled(55.0, 14.0, 1.0);
- glColor3d(1.0, 1.0, 1.0);
- glutSolidCube(1);
- glPopMatrix();
- //tembok 7 sumbu z
- glPushMatrix();
- glTranslated(29.5, 7.5, 0.0);
- glScaled(1.0, 14.0, 30.0);
- glColor3d(1.0, 1.0, 1.0);
- glutSolidCube(1);
- glPopMatrix();
- //tembok 8 sumbu z
- glPushMatrix();
- glTranslated(10.0, 7.5, -12.0);
- glScaled(1.0, 14.0, 6.0);
- glColor3d(1.0, 1.0, 1.0);
- glutSolidCube(1);
- glPopMatrix();
- //tembok 9 sumbu x
- glPushMatrix();
- glTranslated(19.5, 3.5, -3.5);
- glScaled(20.0, 6.0, 1.0);
- glColor3d(1.0, 1.0, 1.0);
- glutSolidCube(1);
- glPopMatrix();
- //tembok 10 sumbu z
- glPushMatrix();
- glTranslated(10.0, 3.5, 3.5);
- glScaled(1.0, 6.0, 13.0);
- glColor3d(1.0, 1.0, 1.0);
- glutSolidCube(1);
- glPopMatrix();
- ///////////////////////////////////////PINTU - HEDDY CAHYA FIRDAUS 10116309
- /// Pintu Pertama
- //bingkai pintu utama 1
- glPushMatrix();
- glTranslated(-25.0, 6.0, -7.6);
- glScaled(1.0, 11.0, 0.2);
- glColor3d(0.0, 0.0, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //bingkai pintu utama 2
- glPushMatrix();
- glTranslated(-25.0, 11.4, -10.3);
- glScaled(1.0, 0.2, 5.4);
- glColor3d(0.0, 0.0, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //bingkai pintu utama 3
- glPushMatrix();
- glTranslated(-25.0, 6.0, -12.9);
- glScaled(1.0, 11.0, 0.2);
- glColor3d(0.0, 0.0, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //pintu utama
- glPushMatrix();
- glTranslated(-22.5, 5.8, -9.0);
- glRotated(-70, 0, 50, 0);
- glScaled(1.0, 11.0, 5.3);
- glColor3d(1.0, 0.4, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //teskstur pintu utama 1
- glPushMatrix();
- glTranslated(-22.5, 8.3, -9.0);
- glRotated(-70, 0, 50, 0);
- glScaled(1.3, 4.5, 4.0);
- glColor3d(1.0, 0.5, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //teskstur pintu utama 2
- glPushMatrix();
- glTranslated(-22.5, 3.3, -9.0);
- glRotated(-70, 0, 50, 0);
- glScaled(1.3, 4.5, 4.0);
- glColor3d(1.0, 0.5, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //gagang pintu utama 1
- glPushMatrix();
- glTranslated(-20.7, 5.8, -10.5);
- glScaled(0.3, 0.3, 0.3);
- glColor3d(0.2, 0.2, 0.2);
- glutSolidSphere(1, slices, stacks);
- glPopMatrix();
- //gagang pintu utama 2
- glPushMatrix();
- glTranslated(-20.0, 5.8, -9.0);
- glScaled(0.3, 0.3, 0.3);
- glColor3d(0.2, 0.2, 0.2);
- glutSolidSphere(1, slices, stacks);
- glPopMatrix();
- /// Pintu Kedua
- //pintu utama
- glPushMatrix();
- glTranslated(12.0, 5.8, -9.0);
- glRotated(-70, 0, 50, 0);
- glScaled(1.0, 11.0, 5.3);
- glColor3d(0,0,128);
- glutSolidCube(1);
- glPopMatrix();
- //teskstur pintu utama 1
- glPushMatrix();
- glTranslated(12.0, 8.3, -9.0);
- glRotated(-70, 0, 50, 0);
- glScaled(1.3, 4.5, 4.0);
- glColor3d(255,255,255);
- glutSolidCube(1);
- glPopMatrix();
- //teskstur pintu utama 2
- glPushMatrix();
- glTranslated(12.0, 3.3, -9.0);
- glRotated(-70, 0, 50, 0);
- glScaled(1.3, 4.5, 4.0);
- glColor3d(255,255,255);
- glutSolidCube(1);
- glPopMatrix();
- //gagang pintu utama 1
- glPushMatrix();
- glTranslated(14.0, 5.8, -10.5);
- glScaled(0.3, 0.3, 0.3);
- glColor3d(0.2, 0.2, 0.2);
- glutSolidSphere(1, slices, stacks);
- glPopMatrix();
- //gagang pintu utama 2
- glPushMatrix();
- glTranslated(14.0, 5.8, -9.0);
- glScaled(0.3, 0.3, 0.3);
- glColor3d(0.2, 0.2, 0.2);
- glutSolidSphere(1, slices, stacks);
- glPopMatrix();
- ///////////////////////////////////////KESET - HEDDY CAHYA FIRDAUS 10116309
- //Keset Pintu Sebelah Kiri
- glPushMatrix();
- glTranslated(-23.0, 0.5, -11.5);
- glScaled(2.5, 0.1, 3.0);
- glColor3d(0.0, 0.0, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //Keset Kamar Mandi
- glPushMatrix();
- glTranslated(11.0, 0.5, -6.5);
- glScaled(2.5, 0.1, 3.0);
- glColor3d(15.0, 15.0, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- ///////////////////////////////////////MESIN CUCI - ASEP TONI 10116308
- //Mesin Cuci
- glPushMatrix();
- glTranslated(-27.0, 3.5, 13.0);
- glScaled(4.0, 6.0, 4.0);
- glColor3d(0.686, 0.933, 0.93);
- glutSolidCube(1);
- glPopMatrix();
- //bulat mesin cuci
- glPushMatrix();
- glTranslated(-24.9, 3.5, 13.0);
- glScaled(0.0, 2.0, 2.0);
- glColor3d(1, 1, 1);
- glutSolidSphere(1,slices,stacks);
- glPopMatrix();
- //bulat mesin cuci
- glPushMatrix();
- glTranslated(-25.5, 2.5, 13.0);
- glScaled(0.2, 0.2, 0.2);
- glColor3d(0.0, 0.0, 0.0);
- glutSolidSphere(1,slices,stacks);
- glPopMatrix();
- //bulat mesin cuci tombol 1
- glPushMatrix();
- glTranslated(-25.0, 5.5, 11.6);
- glScaled(0.2, 0.2, 0.2);
- glColor3d(0, 1, 1);
- glutSolidSphere(1,slices,stacks);
- glPopMatrix();
- ///////////////////////////////////////DAPUR SET - ASEP TONI 10116308
- //kompor
- glPushMatrix();
- glTranslated(-26.5, 5.5, 6.5);
- glScaled(1.5, 0.0, 1.5);
- glColor3d(1, 1, 1);
- glutSolidSphere(1,slices,stacks);
- glPopMatrix();
- //Dapur Set
- glPushMatrix();
- glTranslated(-27.0, 2.5, 3.0);
- glScaled(4.0, 5.5, 15.5);
- glColor3d(0.196, 0.804, 0.196);
- glutSolidCube(1);
- glPopMatrix();
- //Dapur Set Pintu 1
- glPushMatrix();
- glTranslated(-25.3, 2.8, 9.0);
- glScaled(1.0, 3.0, 2.5);
- glColor3d(0.498, 1.000, 0.000);
- glutSolidCube(1);
- glPopMatrix();
- //Dapur Set Pintu Gagang 1
- glPushMatrix();
- glTranslated(-25.0, 3.8, 9.0);
- glScaled(1.0, 0.2, 1.8);
- glColor3d(0.000, 0.392, 0.000);
- glutSolidCube(1);
- glPopMatrix();
- //Dapur Set Pintu 2
- glPushMatrix();
- glTranslated(-25.3, 2.8, 6.0);
- glScaled(1.0, 3.0, 2.5);
- glColor3d(0.498, 1.000, 0.000);
- glutSolidCube(1);
- glPopMatrix();
- //Dapur Set Pintu Gagang 2
- glPushMatrix();
- glTranslated(-25.0, 3.8, 6.0);
- glScaled(1.0, 0.2, 1.8);
- glColor3d(0.000, 0.392, 0.000);
- glutSolidCube(1);
- glPopMatrix();
- //Dapur Set Pintu 3
- glPushMatrix();
- glTranslated(-25.3, 2.8, 3.0);
- glScaled(1.0, 3.0, 2.5);
- glColor3d(0.498, 1.000, 0.000);
- glutSolidCube(1);
- glPopMatrix();
- //Dapur Set Pintu Gagang 3
- glPushMatrix();
- glTranslated(-25.0, 3.8, 3.0);
- glScaled(1.0, 0.2, 1.8);
- glColor3d(0.000, 0.392, 0.000);
- glutSolidCube(1);
- glPopMatrix();
- //pintu tinggi
- glPushMatrix();
- glTranslated(-27.0, 7.5, -1.5);
- glScaled(4.0, 5.5, 6.5);
- glColor3d(0.196, 0.804, 0.196);
- glutSolidCube(1);
- glPopMatrix();
- //Dapur Set Pintu 4
- glPushMatrix();
- glTranslated(-25.3, 8.0, 0.0);
- glScaled(1.0, 3.0, 2.5);
- glColor3d(0.498, 1.000, 0.000);
- glutSolidCube(1);
- glPopMatrix();
- //Dapur Set Pintu Gagang 4
- glPushMatrix();
- glTranslated(-25.0, 8.2, -0.8);
- glScaled(0.28, 0.28, 0.28);
- glColor3d(0.2, 0.2, 0.2);
- glutSolidSphere(1, slices, stacks);
- glPopMatrix();
- //Dapur Set Pintu 5
- glPushMatrix();
- glTranslated(-25.3, 8.0, -3.0);
- glScaled(1.0, 3.0, 2.5);
- glColor3d(0.498, 1.000, 0.000);
- glutSolidCube(1);
- glPopMatrix();
- //Dapur Set Pintu Gagang 5
- glPushMatrix();
- glTranslated(-25.0, 8.2, -2.2);
- glScaled(0.28, 0.28, 0.28);
- glColor3d(0.2, 0.2, 0.2);
- glutSolidSphere(1, slices, stacks);
- glPopMatrix();
- //Dapur Set Pintu 6
- glPushMatrix();
- glTranslated(-25.3, 3.5, 0.0);
- glScaled(1.0, 4.5, 2.5);
- glColor3d(0.498, 1.000, 0.000);
- glutSolidCube(1);
- glPopMatrix();
- //Dapur Set Pintu Gagang 6
- glPushMatrix();
- glTranslated(-25.0, 3.8, -0.8);
- glScaled(0.28, 0.28, 0.28);
- glColor3d(0.2, 0.2, 0.2);
- glutSolidSphere(1, slices, stacks);
- glPopMatrix();
- //Dapur Set Pintu 7
- glPushMatrix();
- glTranslated(-25.3, 3.5, -3.0);
- glScaled(1.0, 4.5, 2.5);
- glColor3d(0.498, 1.000, 0.000);
- glutSolidCube(1);
- glPopMatrix();
- //Dapur Set Pintu Gagang 7
- glPushMatrix();
- glTranslated(-25.0, 3.8, -2.2);
- glScaled(0.28, 0.28, 0.28);
- glColor3d(0.2, 0.2, 0.2);
- glutSolidSphere(1, slices, stacks);
- glPopMatrix();
- ///////////////////////////////////////INTERIOR KAMAR - RIZALU ILMAN 10116304
- //Alas Kasur
- glPushMatrix();
- glTranslated(17.5, 1.0, 3.5);
- glScaled(8.3, 1.5, 13.0);
- glColor3d(1.0, 0.4, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //Kasur
- glPushMatrix();
- glTranslated(17.5, 2.5, 3.5);
- glScaled(8.0, 1.5, 13.0);
- glColor3d(1.0, 1.0, 1.0);
- glutSolidCube(1);
- glPopMatrix();
- //Bantal 1
- glPushMatrix();
- glTranslated(19.5, 3.5, -1.8);
- glScaled(2.0, 0.5, 1.3);
- glColor3d(0.502, 0.000, 0.000);
- glutSolidSphere(1, slices, stacks);
- glPopMatrix();
- //Bantal 2
- glPushMatrix();
- glTranslated(15.5, 3.5, -1.8);
- glScaled(2.0, 0.5, 1.3);
- glColor3d(0.502, 0.000, 0.000);
- glutSolidSphere(1, slices, stacks);
- glPopMatrix();
- //Guling 1
- glPushMatrix();
- glTranslated(15.8, 3.5, 3.0);
- glScaled(0.5, 0.5, 3.5);
- glColor3d(0.502, 0.000, 0.000);
- glutSolidSphere(1, slices, stacks);
- glPopMatrix();
- //Guling 2
- glPushMatrix();
- glTranslated(19.5, 3.5, 3.0);
- glScaled(0.5, 0.5, 3.5);
- glColor3d(0.502, 0.000, 0.000);
- glutSolidSphere(1, slices, stacks);
- glPopMatrix();
- //Selimut
- glPushMatrix();
- glTranslated(17.5, 3.4, 8.5);
- glScaled(8.4, 0.2, 3.0);
- glColor3d(0.502, 0.000, 0.000);
- glutSolidCube(1);
- glPopMatrix();
- //Selimut sisi 1
- glPushMatrix();
- glTranslated(13.4, 2.6, 8.5);
- glScaled(0.2, 1.7, 3.0);
- glColor3d(0.502, 0.000, 0.000);
- glutSolidCube(1);
- glPopMatrix();
- //Selimut sisi 2
- glPushMatrix();
- glTranslated(21.6, 2.6, 8.5);
- glScaled(0.2, 1.7, 3.0);
- glColor3d(0.502, 0.000, 0.000);
- glutSolidCube(1);
- glPopMatrix();
- //Meja Samping Kasur
- glPushMatrix();
- glTranslated(11.9, 1.5, -2.5);
- glScaled(2.9, 3.0, 2.0);
- glColor3d(1.0, 0.4, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //Tekstur Meja Samping Kasur 1
- glPushMatrix();
- glTranslated(11.9, 3.5, -3.0);
- glScaled(2.9, 1.0, 0.3);
- glColor3d(1.0, 0.4, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //Tekstur Meja Samping Kasur 2
- glPushMatrix();
- glTranslated(11.9, 3.0, -2.0);
- glScaled(2.9, 0.3, 2.3);
- glColor3d(1.0, 0.4, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //lampu Dinding 1
- glPushMatrix();
- glTranslated(11.9, 4.7, -2.7);
- glScaled(0.3, 0.3, 0.8);
- glColor3d(0.0, 0.0, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //lampu Dinding 2
- glPushMatrix();
- glTranslated(11.9, 4.7, -2.3);
- glScaled(0.4, 1.5, 0.4);
- glColor3d(1.0, 1.0, 1.0);
- glutSolidCube(1);
- glPopMatrix();
- //Lemari
- glPushMatrix();
- glTranslated(28.0, 5.5, 2.5);
- glScaled(3.5, 10.0, 11.0);
- glColor3d(1.0, 0.4, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //Tekstur Lemari 1
- glPushMatrix();
- glTranslated(26.2, 5.5, -0.1);
- glScaled(0.1, 9.0, 4.7);
- glColor3d(1.0, 0.5, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //Tekstur Lemari 2
- glPushMatrix();
- glTranslated(26.2, 5.5, 5.1);
- glScaled(0.1, 9.0, 4.7);
- glColor3d(1.0, 0.5, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //gagang pintu Lemari 1
- glPushMatrix();
- glTranslated(26.0, 5.5, 3.2);
- glScaled(0.3, 0.3, 0.3);
- glColor3d(0.2, 0.2, 0.2);
- glutSolidSphere(1, slices, stacks);
- glPopMatrix();
- //gagang pintu Lemari 2
- glPushMatrix();
- glTranslated(26.0, 5.5, 1.8);
- glScaled(0.3, 0.3, 0.3);
- glColor3d(0.2, 0.2, 0.2);
- glutSolidSphere(1, slices, stacks);
- glPopMatrix();
- //Meja kamar
- glPushMatrix();
- glTranslated(28.0, 3.3, 11.5);
- glScaled(2.0, 0.3, 7.0);
- glColor3d(1.0, 0.4, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //Kaki Meja kamar 1
- glPushMatrix();
- glTranslated(28.0, 2.0, 8.0);
- glScaled(2.0, 3.0, 0.3);
- glColor3d(1.0, 0.4, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //Kaki Meja kamar 2
- glPushMatrix();
- glTranslated(28.0, 2.0, 14.9);
- glScaled(2.0, 3.0, 0.2);
- glColor3d(1.0, 0.4, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //Rak Dinding 1
- glPushMatrix();
- glTranslated(28.7, 7.0, 10.0);
- glScaled(1.5, 0.2, 4.0);
- glColor3d(1.0, 0.4, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //Rak Dinding 1
- glPushMatrix();
- glTranslated(28.7, 6.6, 13.3);
- glScaled(1.5, 0.2, 3.0);
- glColor3d(1.0, 0.4, 0.0);
- glutSolidCube(1);
- glPopMatrix();
- //Karpet
- glPushMatrix();
- glTranslated(17.5, 0.5, 12.7);
- glScaled(8.5, 0.1, 3.5);
- glColor3d(0.000, 0.000, 0.502);
- glutSolidCube(1);
- glPopMatrix();
- /////////////////////////////////////RUANG TAMU - MUHAMMAD ILHAM 10116297
- //alas tv
- glPushMatrix();
- glTranslated(5.0, 1.0, -12.0);
- glScaled(8.0, 1, 6.0);
- glColor3d(1.000, 0.980, 0.980);
- glutSolidCube(1);
- glPopMatrix();
- //rak samping alas tv
- glPushMatrix();
- glTranslated(-1.0, 2.0, -12.0);
- glScaled(8.0, 1, 6.0);
- glColor3d(0.596, 0.984, 0.596);
- glutSolidCube(1);
- glPopMatrix();
- //box kiri atas rak samping alas tv
- glPushMatrix();
- glTranslated(-3.0, 7.0, -12.0);
- glScaled(2.0, 2, 3.0);
- glColor3d(1.000, 0.980, 0.980);
- glutSolidCube(1);
- glPopMatrix();
- //box kiri atas rak samping alas tv tutup
- glPushMatrix();
- glTranslated(-3.0, 7.0, -10.5);
- glScaled(2.0, 2, 0.1);
- glColor3d(0.596, 0.984, 0.596);
- glutSolidCube(1);
- glPopMatrix();
- //box kanan atas rak samping alas tv
- glPushMatrix();
- glTranslated(0.0, 7.0, -12.0);
- glScaled(2.0, 2, 3.0);
- glColor3d(1.000, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- //box kanan atas rak samping alas tv tuutp
- glPushMatrix();
- glTranslated(0.0, 7.0, -10.5);
- glScaled(2.0, 2, 0.1);
- glColor3d(0.596, 0.984, 0.596); // hijau
- glutSolidCube(1);
- glPopMatrix();
- //rak atas tv atas
- glPushMatrix();
- glTranslated(5.0, 8.0, -12.0);
- glScaled(5.0, 0.2, 6.0);
- glColor3d(0.596, 0.984, 0.596); // hijau
- glutSolidCube(1);
- glPopMatrix();
- //rak atas tv bawah
- glPushMatrix();
- glTranslated(5.0, 6.0, -12.0);
- glScaled(5.0, 0.2, 6.0);
- glColor3d(1.000, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- //tv
- glPushMatrix();
- glTranslated(6.0, 3.5, -9.8);
- glScaled(4.7, 2.7, 0.1);
- glColor3d(0.000, 0.000, 0.000);
- glutSolidCube(1);
- glPopMatrix();
- //tv border
- glPushMatrix();
- glTranslated(6.0, 3.5, -10.0);
- glScaled(5.0, 3, 0.5);
- glColor3d(1.000, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- //tv bracket
- glPushMatrix();
- glTranslated(6.0, 2.0, -10.0);
- glScaled(0.7, 1, 0.3);
- glColor3d(0.000, 0.000, 0.000);
- glutSolidCube(1);
- glPopMatrix();
- //karpet depan tv
- glPushMatrix();
- glTranslated(3.7, 0.5, 2);
- glScaled(10.0, 0.07, 10);
- glColor3d(0.545, 0.000, 0.000); //merah tua
- glutSolidCube(1);
- glPopMatrix();
- //meja pada karpet
- glPushMatrix();
- glTranslated(3.7, 0.6, 0);
- glScaled(4, 1.3, 4);
- glColor3d(1.0, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- //sofa utama
- //tengah
- glPushMatrix();
- glTranslated(3.7, 1.7, 5);
- glScaled(8, 1, 3);
- glColor3d(1.000, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- //kanan
- glPushMatrix();
- glTranslated(8.2, 1.9, 5);
- glScaled(1, 3, 3);
- glColor3d(1.000, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- //kiri
- glPushMatrix();
- glTranslated(-0.8, 1.9, 5);
- glScaled(1, 3, 3);
- glColor3d(1.000, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- //atas belakang
- glPushMatrix();
- glTranslated(3.7, 2.9, 6.15);
- glScaled(8, 1.3, 0.7);
- glColor3d(1.000, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- /////////////////////////////////////RUANG TAMU - MUHAMMAD ILHAM 10116297
- //alas tv
- glPushMatrix();
- glTranslated(5.0, 1.0, -12.0);
- glScaled(8.0, 1, 6.0);
- glColor3d(1.000, 0.980, 0.980);
- glutSolidCube(1);
- glPopMatrix();
- //rak samping alas tv
- glPushMatrix();
- glTranslated(-1.0, 2.0, -12.0);
- glScaled(8.0, 1, 6.0);
- glColor3d(0.596, 0.984, 0.596);
- glutSolidCube(1);
- glPopMatrix();
- //box kiri atas rak samping alas tv
- glPushMatrix();
- glTranslated(-3.0, 7.0, -12.0);
- glScaled(2.0, 2, 3.0);
- glColor3d(1.000, 0.980, 0.980);
- glutSolidCube(1);
- glPopMatrix();
- //box kiri atas rak samping alas tv tutup
- glPushMatrix();
- glTranslated(-3.0, 7.0, -10.5);
- glScaled(2.0, 2, 0.1);
- glColor3d(0.596, 0.984, 0.596);
- glutSolidCube(1);
- glPopMatrix();
- //box kanan atas rak samping alas tv
- glPushMatrix();
- glTranslated(0.0, 7.0, -12.0);
- glScaled(2.0, 2, 3.0);
- glColor3d(1.000, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- //box kanan atas rak samping alas tv tuutp
- glPushMatrix();
- glTranslated(0.0, 7.0, -10.5);
- glScaled(2.0, 2, 0.1);
- glColor3d(0.596, 0.984, 0.596); // hijau
- glutSolidCube(1);
- glPopMatrix();
- //rak atas tv atas
- glPushMatrix();
- glTranslated(5.0, 8.0, -12.0);
- glScaled(5.0, 0.2, 6.0);
- glColor3d(0.596, 0.984, 0.596); // hijau
- glutSolidCube(1);
- glPopMatrix();
- //rak atas tv bawah
- glPushMatrix();
- glTranslated(5.0, 6.0, -12.0);
- glScaled(5.0, 0.2, 6.0);
- glColor3d(1.000, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- //tv
- glPushMatrix();
- glTranslated(6.0, 3.5, -9.8);
- glScaled(4.7, 2.7, 0.1);
- glColor3d(0.000, 0.000, 0.000);
- glutSolidCube(1);
- glPopMatrix();
- //tv border
- glPushMatrix();
- glTranslated(6.0, 3.5, -10.0);
- glScaled(5.0, 3, 0.5);
- glColor3d(1.000, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- //tv bracket
- glPushMatrix();
- glTranslated(6.0, 2.0, -10.0);
- glScaled(0.7, 1, 0.3);
- glColor3d(0.000, 0.000, 0.000);
- glutSolidCube(1);
- glPopMatrix();
- //karpet depan tv
- glPushMatrix();
- glTranslated(3.7, 0.5, 2);
- glScaled(10.0, 0.07, 10);
- glColor3d(0.545, 0.000, 0.000); //merah tua
- glutSolidCube(1);
- glPopMatrix();
- //meja pada karpet
- glPushMatrix();
- glTranslated(3.7, 1.5, 0);
- glScaled(4, 1.7, 4);
- glColor3d(1.0, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- //sofa utama
- //tengah
- glPushMatrix();
- glTranslated(3.7, 1.7, 5);
- glScaled(8, 1, 3);
- glColor3d(1.000, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- //kanan
- glPushMatrix();
- glTranslated(8.2, 1.9, 5);
- glScaled(1, 3, 3);
- glColor3d(1.000, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- //kiri
- glPushMatrix();
- glTranslated(-0.8, 1.9, 5);
- glScaled(1, 3, 3);
- glColor3d(1.000, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- //atas belakang
- glPushMatrix();
- glTranslated(3.7, 2.9, 6.15);
- glScaled(8, 1.3, 0.7);
- glColor3d(1.000, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- //sofa kecil
- //tengah
- glPushMatrix();
- glTranslated(-6.5, 1.7, 0);
- glScaled(3, 1, 3);
- glColor3d(1.000, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- //kanan
- glPushMatrix();
- glTranslated(-6.5, 1.9, 2);
- glScaled(3, 3, 1);
- glColor3d(1.000, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- //kiri
- glPushMatrix();
- glTranslated(-6.5, 1.9, -1.7);
- glScaled(3, 3, 1);
- glColor3d(1.000, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- //atas belakang
- glPushMatrix();
- glTranslated(-7.6, 2.9, 0.2);
- glScaled(1, 1.3, 2.8);
- glColor3d(1.000, 0.980, 0.980); //putih tulang
- glutSolidCube(1);
- glPopMatrix();
- ///////////////////////////////////////WC KAMAR MANDI - KEMAS RISMAN 10116313
- //Bak Mandi 1 sumbu z
- glPushMatrix();
- glTranslated(21.5, 2.0, -11.3);
- glScaled(0.5, 4.0, 7.0);
- glColor3d(1.0, 1.0, 1.0);
- glutSolidCube(1);
- glPopMatrix();
- //Bak Mandi 2 sumbu x
- glPushMatrix();
- glTranslated(25.5, 2.0, -8.0);
- glScaled(8.0, 4.0, 0.5);
- glColor3d(1.0, 1.0, 1.0);
- glutSolidCube(1);
- glPopMatrix();
- //Alas WC
- glPushMatrix();
- glTranslated(27.0, 0.8, -6.0);
- glScaled(5.0, 1.0, 4.3);
- glColor3d(1.0, 1.0, 1.0);
- glutSolidCube(1);
- glPopMatrix();
- glutSwapBuffers();
- glutPostRedisplay();
- }
- int main(int argc, char* argv[]) {
- glutInit(&argc, argv);
- glutInitWindowSize(800, 600);
- glutInitWindowPosition(200, 100);
- glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
- glutCreateWindow("Kelompok Apartemen");
- glutReshapeFunc(resize);
- glutDisplayFunc(display);
- glutKeyboardFunc(keyboard);
- glutSpecialFunc(specialkeys);
- glClearColor(1, 1, 1, 1);
- glEnable(GL_CULL_FACE);
- glCullFace(GL_BACK);
- glEnable(GL_DEPTH_TEST);
- glDepthFunc(GL_LESS);
- glEnable(GL_LIGHT0);
- glEnable(GL_NORMALIZE);
- glEnable(GL_COLOR_MATERIAL);
- glEnable(GL_LIGHTING);
- glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
- glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
- glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
- glLightfv(GL_LIGHT0, GL_POSITION, light_position);
- glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
- glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
- glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
- glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess);
- glutMainLoop();
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement