#include <math.h>
#include <stdio.h>
#include <windows.h>
#include <gl/glut.h>
#include "ReadBMP.h" 

typedef float vec3_t[3]; 
typedef float VertexArray[3];
typedef float NormalArray[3];
typedef float TextureCoordsArray[2];

float	size=5.;
float	theta=.0;
float   door_angle = 30.0;
bool    DOOR = false;
float	thetaDelta=.125;
float	eyeDelta=.125;
float	scale=1.0;
float	scaleDelta=1.125;
double	PI=atan(1.0)*4.0;
char change = 1;
char change2 = 1;

//GLfloat stairs = 0.1f;

int		mouseX = 0;
int		mouseY = 0;
int		mouseState = 0;
int		mouseButton = 0; 
int		projection = 0;
int		depthtest = 1;
int		frontface = 0;
int		compositing = 0;
int		texture = 1;
int		magminfilter = 1;
int		repeating = 1;
int		texturesource=0;
int		windowWidth;
int		windowHeight;

int		lighting=1;
int		lightmodel=1;

vec3_t rot = {0.,0.,0.};
vec3_t eye = {0.,0.,-5.};
vec3_t center = {0.,0.,0.};
vec3_t color[] = {
	{1.0f, 0.0f, 0.0f},		//red
	{0.0f, 1.0f, 0.0f},		//green
	{0.0f, 0.0f, 1.0f},		//blue
	{1.0f, 1.0f, 0.0f},		//yellow
	{1.0f, 0.0f, 1.0f},		//magenta
	{0.0f, 1.0f, 1.0f},		//cyan
	{1.0f, 1.0f, 1.0f},		//white
	{.25f, .25f, .25f},		//dark gray
	{.60f, .40f, .70f},		//barney purple
	{.98f, .625f, .12f},	//pumpkin orange
	{.98f, .04f, .70f},		//pastel pink
	{.75f, .75f, .75f},		//light gray
	{.60f, .40f, .12f},		//brown
	{0.0f, 0.7f, 0.1f}		
};

GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat mat_shininess[] = { 40.0 };
GLfloat light_position[] = { 5.0, 5.0, 5.0, 0.0 };
GLfloat light_ambient[] = { 1.0, 1.0, 1.0, 1.0};
GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0};
GLfloat light_spotDir[] = { -1.0, -1.0, -1.0 };
GLfloat sgenparams[] = {1., 0., 0., 0.};

MyImageStruct	myImage;


int dol=1;
int window=2;
int door=3;
int wallpaper=4;
int bottom=9;

void setupSpotLight()
{
	glLightModelfv(GL_LIGHT_MODEL_AMBIENT,light_ambient);
	glLightfv(GL_LIGHT0,GL_POSITION,light_position);
	glLightfv(GL_LIGHT0,GL_SPECULAR,light_specular);
	glLightfv(GL_LIGHT0,GL_DIFFUSE,light_ambient);
	glLightfv(GL_LIGHT0,GL_SPOT_DIRECTION,light_spotDir);
	glLightf(GL_LIGHT0,GL_SPOT_CUTOFF,30.0f);
	glLightf(GL_LIGHT0,GL_SPOT_EXPONENT,100.0f);
	glMaterialfv(GL_FRONT,GL_SPECULAR,mat_specular);
	glMaterialfv(GL_FRONT,GL_SHININESS,mat_shininess);
}

void setupAmbientLight()
{
	glLightModelfv(GL_LIGHT_MODEL_AMBIENT,light_ambient);
	glLightfv(GL_LIGHT0,GL_POSITION,light_position);
	glMaterialfv(GL_FRONT,GL_SPECULAR,mat_specular);
	glMaterialfv(GL_FRONT,GL_SHININESS,mat_shininess);
}

void hexahedron(float a, float b, float c)
{
	glBegin(GL_POLYGON);
	/*glTexCoord2f(0.0, 0.0);*/ glVertex3f(0, 0, 0);
	/*glTexCoord2f(1.0, 0.0);*/ glVertex3f(a, 0, 0);
	/*glTexCoord2f(1.0, 1.0);*/ glVertex3f(a, 0, -b);
	/*glTexCoord2f(0.0, 1.0);*/ glVertex3f(0, 0, -b);
	glEnd();

	glBegin(GL_POLYGON);
	glVertex3f(0, -c, 0);
	glVertex3f(a, -c, 0);
	glVertex3f(a, -c, -b);
	glVertex3f(0, -c, -b);
	glEnd();

	glBegin(GL_TRIANGLE_STRIP);
	glVertex3f(0, -c, -b);
	glVertex3f(0, 0, -b);
	glVertex3f(a, -c, -b);
	glVertex3f(a, 0, -b);
	glVertex3f(a, -c, 0);
	glVertex3f(a, 0, 0);
	glEnd();

	glBegin(GL_TRIANGLE_STRIP);
	glVertex3f(0, -c, -b);
	glVertex3f(0, 0, -b);
	glVertex3f(0, -c, 0);
	glVertex3f(0, 0, 0);
	glVertex3f(a, -c, 0);
	glVertex3f(a, 0, 0);
	glEnd();
}

void rectangle(float a, float b)
{
	glBegin(GL_POLYGON);
	glVertex3f(0, 0, 0);
	glVertex3f(a, 0, 0);
	glVertex3f(a, -b, 0);
	glVertex3f(0, -b, 0);
	glEnd();
}

void myInit(void)
{
	glClearColor(1.0, 1.0, 1.0, 0.0);


	ReadBMP("dol2.bmp", &myImage); 
	glBindTexture(GL_TEXTURE_2D, 1);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, myImage.Width, myImage.Height, 
		0, GL_RGB, GL_UNSIGNED_BYTE, myImage.Pixels);

	ReadBMP("window.bmp", &myImage); 
	glBindTexture(GL_TEXTURE_2D, 2);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, myImage.Width, myImage.Height, 
		0, GL_RGB, GL_UNSIGNED_BYTE, myImage.Pixels);

	

	ReadBMP("door.bmp", &myImage); 
	glBindTexture(GL_TEXTURE_2D, 3);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, myImage.Width, myImage.Height, 
		0, GL_RGB, GL_UNSIGNED_BYTE, myImage.Pixels);



//========================================================================================

	ReadBMP("wallpaper.bmp", &myImage); 
	glBindTexture(GL_TEXTURE_2D, 4);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, myImage.Width, myImage.Height, 
		0, GL_RGB, GL_UNSIGNED_BYTE, myImage.Pixels);
	
	ReadBMP("wallpaper2.bmp", &myImage); 
	glBindTexture(GL_TEXTURE_2D, 5);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, myImage.Width, myImage.Height, 
		0, GL_RGB, GL_UNSIGNED_BYTE, myImage.Pixels);

	ReadBMP("wallpaper3.bmp", &myImage); 
	glBindTexture(GL_TEXTURE_2D, 6);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, myImage.Width, myImage.Height, 
		0, GL_RGB, GL_UNSIGNED_BYTE, myImage.Pixels);

	ReadBMP("wallpaper4.bmp", &myImage); 
	glBindTexture(GL_TEXTURE_2D, 7);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, myImage.Width, myImage.Height, 
		0, GL_RGB, GL_UNSIGNED_BYTE, myImage.Pixels);

	ReadBMP("wallpaper5.bmp", &myImage); 
	glBindTexture(GL_TEXTURE_2D, 8);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, myImage.Width, myImage.Height, 
		0, GL_RGB, GL_UNSIGNED_BYTE, myImage.Pixels);

//========================================================================================

	ReadBMP("bottom.bmp", &myImage); 
	glBindTexture(GL_TEXTURE_2D, 9);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, myImage.Width, myImage.Height, 
		0, GL_RGB, GL_UNSIGNED_BYTE, myImage.Pixels);

	ReadBMP("bottom2.bmp", &myImage); 
	glBindTexture(GL_TEXTURE_2D, 10);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, myImage.Width, myImage.Height, 
		0, GL_RGB, GL_UNSIGNED_BYTE, myImage.Pixels);

	ReadBMP("bottom3.bmp", &myImage); 
	glBindTexture(GL_TEXTURE_2D, 11);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, myImage.Width, myImage.Height, 
		0, GL_RGB, GL_UNSIGNED_BYTE, myImage.Pixels);

	ReadBMP("bottom4.bmp", &myImage); 
	glBindTexture(GL_TEXTURE_2D, 12);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, myImage.Width, myImage.Height, 
		0, GL_RGB, GL_UNSIGNED_BYTE, myImage.Pixels);

	ReadBMP("bottom5.bmp", &myImage); 
	glBindTexture(GL_TEXTURE_2D, 13);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, myImage.Width, myImage.Height, 
		0, GL_RGB, GL_UNSIGNED_BYTE, myImage.Pixels);

	ReadBMP("flosis.bmp", &myImage); 
	glBindTexture(GL_TEXTURE_2D, 14);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, myImage.Width, myImage.Height, 
		0, GL_RGB, GL_UNSIGNED_BYTE, myImage.Pixels);


	glClearColor(0.0, 0.0, 0.0, 1.0);

	setupAmbientLight();
	glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
	glShadeModel(GL_SMOOTH);
	glEnable(GL_CULL_FACE);
	glEnable(GL_COLOR_MATERIAL);
	glEnable(GL_LIGHTING);
	glEnable(GL_LIGHT0);
	glEnable(GL_LIGHT1);
	glEnable(GL_NORMALIZE);


	glEnable(GL_TEXTURE_2D);
	glEnable(GL_DEPTH_TEST);
	glPolygonMode(GL_BACK, GL_LINE);
	glPolygonMode(GL_FRONT, GL_FILL);
}

void Desk(void)
{
	glPushMatrix();
	/*glEnable(GL_CULL_FACE);
	glBindTexture(GL_TEXTURE_2D, 6);
	glFrontFace(GL_CW);*/
	glColor3f(.84, .74, .06);
	glTranslatef(-4, 0, 0);
	hexahedron(13, 3, 0.5); // 상판
	glColor3f(.34, .74, .06);
	glTranslatef(0, -0.5, 0);
	hexahedron(4.5, 3, 6.4); // 서랍
	glTranslatef(11, 0, 0);
	hexahedron(2, 3, 0.3);
	glTranslatef(0, -2.5, 0);
	hexahedron(2, 3, 0.3);
	glTranslatef(0, -3.6, 0);
	hexahedron(2, 3, 0.3);
	glTranslatef(0, 9.7, 0);
	hexahedron(2, 3, 0.3);
	glTranslatef(0, 3., 0);
	hexahedron(2, 3, 0.3);
	glColor3f(.34, .84, .86);
	glTranslatef(0, 0, 0.3);
	hexahedron(2.3, 0.3, 13);
	glTranslatef(0, 0, -3.3);
	hexahedron(2.3, 0.3, 13);
	glTranslatef(2, 0, 3);
	hexahedron(0.3, 3, 13);
	glPopMatrix();
}

void Chair(void)
{
	glPushMatrix();
	glTranslatef(2, -2, -1);
	glColor3f(.64, .33, .26);
	hexahedron(4, 4, 0.4);
	glTranslatef(0, 4, -3.6);
	hexahedron(4, 0.4, 4);

	glTranslatef(0, -4.4, 3.6);
	hexahedron(0.4, 0.4, 4.5);
	glTranslatef(3.6, 0, 0);
	hexahedron(0.4, 0.4, 4.5);
	glPushMatrix();
	glTranslatef(-3.6, 0, -3.6);
	hexahedron(0.4, 0.4, 4.5);
	glTranslatef(3.6, 0, 0);
	hexahedron(0.4, 0.4, 4.5);
	glPopMatrix();
	glPopMatrix();
}

void Closet(void)
{
	glPushMatrix();
	glColor3f(.17, .26, .75);
	rectangle(8, 18);
	glColor3f(.17, .66, .75);
	glTranslatef(0, 0, -5);
	glPushMatrix();
	rectangle(4, 13); ////////////////// 왼쪽문
	glPopMatrix();
	glTranslatef(4, 0, 0);
	glPushMatrix();
	rectangle(4, 13); ////////////////// 오른쪽문
	glPopMatrix();
	glTranslatef(-4, -13, 4.99);
	glColor3f(.77, .66, .75);
	hexahedron(8, 4.99, 2.5);
	glTranslatef(0, -2.5, 0);
	hexahedron(8, 4.99, 2.5);
	glPopMatrix();
	glPushMatrix();
	glColor3f(.95, .74, .75);
	glTranslatef(-0.05, 0, 0);
	hexahedron(0.1, 5, 18);
	glTranslatef(8.05, 0, 0);
	hexahedron(0.1, 5, 18);
	glTranslatef(-8.1, 0.1, 0);
	hexahedron(8.1, 5, 0.1);
	glPopMatrix();
}

void DinnerTable(void)
{
	glPushMatrix();
	glTranslatef(2, -2, -1);
	glColor3f(.25, .36, .69);
	hexahedron(14, 4, 0.5);
	glTranslatef(0, -0.5, 0);
	hexahedron(0.4, 0.5, 4.5);
	glTranslatef(13.6, 0, 0);
	hexahedron(0.4, 0.4, 4.5);
	glPushMatrix();
	glTranslatef(-13.5, 0, -3.5);
	hexahedron(0.4, 0.5, 4.5);
	glTranslatef(13.6, 0, 0);
	hexahedron(0.4, 0.5, 4.5);
	glPopMatrix();
	glPopMatrix();
}

void Bed(void)
{
	glPushMatrix();
	glColor3f(.37, .35, .2);
	hexahedron(13, 5, 3);
	glTranslatef(-0.5, 2, 0);
	hexahedron(0.5, 5, 5);
	glPopMatrix();
}

void TV(void)
{
	glPushMatrix();
	glColor3f(.235, .754, .21);
	hexahedron(5, 5, 1);
	glTranslatef(0, -1, 0);
	hexahedron(1, 5, 3);
	glTranslatef(4, 0, 0);
	hexahedron(1, 5, 3);
	glTranslatef(-4, -3, 0);
	hexahedron(5, 5, 1);
	glColor3f(.7, .7, .7);
	glTranslatef(1, 3, -5);
	rectangle(3, 3); // 마커 인식
	glPopMatrix();

	/*glBegin(GL_POLYGON);
	glVertex3f(1, -1, -5);
	glVertex3f(4, -1, -5);
	glVertex3f(4, -4, -5);
	glVertex3f(1, -4, -5);
	glEnd();*///////////////////////Squere부분

	glBegin(GL_LINE_STRIP);
	glColor3f(.235, .754, .21);
	glVertex3f(1, 1.5, -2.5);
	glVertex3f(2.5, 0, -2.5);
	glVertex3f(4, 1.5, -2.5);
	glEnd();
}

void house_3()
{
	// 지붕
	glPushMatrix();
	//바닥
	glRotatef(90,1,0,0);
	glRotatef(90,0,0,1);
	glBindTexture(GL_TEXTURE_2D, 14);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[10]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0.45, -0.5, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(2.46, -0.5, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(2.46, 0.3, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(2.15, 0.3, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(2.15, 0.81, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(1.85, 0.79, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(1.85, 1.18, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(1.99, 1.45, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(1.99, 1.75, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(1.85, 2.0, 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(1.85, 2.5, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0.45, 2.5, 1.5);

	glEnd();

	glBindTexture(GL_TEXTURE_2D, 4);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[6]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0.45, -0.5, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(2.46, -0.5, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(2.46, 0.3, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(2.15, 0.3, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(2.15, 0.81, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(1.85, 0.79, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(1.85, 1.18, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(1.99, 1.45, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(1.99, 1.75, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(1.85, 2.0, 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(1.85, 2.5, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0.45, 2.5, 1.5);
	glEnd();
	glPopMatrix();
}


void house_2()
{
	///////////////////////////////////////////////////////////////////////////////////////////////	
	// 2층 ////////////////////////////////////////////////////////////////////////////////////////
	///////////////////////////////////////////////////////////////////////////////////////////////

	glEnable(GL_CULL_FACE);
//glPushMatrix();
	glTranslatef(0.0,0.0,-0.1);
	glPushMatrix();
	//바닥
	glRotatef(90,1,0,0);
	glRotatef(60,0,0,1);

	glTranslatef(0.0,0.4,0.0);
	glBindTexture(GL_TEXTURE_2D, bottom);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[13]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(1.389, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(1.389, 0.9, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.9, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, bottom);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[6]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(1.389, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(1.399, 0.9, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.9, 1.5);
	glEnd();

	glTranslatef(1.34,0.25,0.0);
	glBindTexture(GL_TEXTURE_2D, bottom);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[13]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.75, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(0.2, -0.38, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(0.2, -0.13, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.22, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, bottom);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[6]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.75, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(0.2, -0.38, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(0.2, -0.13, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.22, 1.5);
	glEnd();
	glPopMatrix();
	/////////////////////////////////////////////////////////
	// 벽
	glTranslatef(-0.46,-0.5,0.3);
	glRotatef(30.0,0,1,0);
	glPushMatrix();
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -1., 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.3, -1., 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.3, -0.5, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0., -0.5, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -1., 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.3, -1., 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.3, -0.5, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0., -0.5, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();

	glPushMatrix();
	// 3벽
	glTranslatef(0.25,0.0,0.);
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();
	glPopMatrix();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();

	// 아래_창문
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
	glEnd();

	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
	glEnd();
	// 위_창문
	glTranslatef(0.0,0.11,0.);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
	glEnd();

	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
	glEnd();

	glPushMatrix();
	// 5벽
	//glTranslatef(0.25,0.0,0.);
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// 6벽
	glTranslatef(0.25,0.0,0.);
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// 6벽
	glTranslatef(0.25,-0.11,0.);
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// 4벽
	glTranslatef(0.0,-0.11,0.);
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.4, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.3, -0.4, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.3, -0.39, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.39, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.4, 1.5);
	glTexCoord2f(0.1, 0.0); glVertex3f(0.3, -0.4, 1.5);
	glTexCoord2f(0.1, 0.1); glVertex3f(0.3, -0.39, 1.5);
	glTexCoord2f(0.0, 0.1); glVertex3f(0., -0.39, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// 7벽
	glTranslatef(0.0,-1.1,0.);
	glBindTexture(GL_TEXTURE_2D, wallpaper);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[3]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., 0.71, 1.5);
	glTexCoord2f(0.7, 0.0); glVertex3f(0.3, 0.71, 1.5);
	glTexCoord2f(0.7, 0.7); glVertex3f(0.3, 0.9, 1.5);
	glTexCoord2f(0.0, 0.7); glVertex3f(0., 0.9, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, dol);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[9]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., 0.71, 1.5);
	glTexCoord2f(0.7, 0.0); glVertex3f(0.3, 0.71, 1.5);
	glTexCoord2f(0.7, 0.7); glVertex3f(0.3, 0.9, 1.5);
	glTexCoord2f(0.0, 0.7); glVertex3f(0., 0.9, 1.5);
	glEnd();
	glPopMatrix();

	////// 회전벽
	glTranslatef(-0.45,-0.11,0.2);
	glRotatef(30,0,1,0);
	glPushMatrix();
	//벽
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -1., 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.3, -1., 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.3, -0.5, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0., -0.5, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -1., 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.3, -1., 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.3, -0.5, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0., -0.5, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();

	glPushMatrix();
	// 3벽
	glTranslatef(0.25,0.0,0.);
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();
	glPopMatrix();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();

	// 아래_창문
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
	glEnd();

	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
	glEnd();
	// 위_창문
	glTranslatef(0.0,0.11,0.);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
	glEnd();

	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
	glEnd();

	glPushMatrix();
	// 5벽
	//glTranslatef(0.25,0.0,0.);
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// 6벽
	glTranslatef(0.25,0.0,0.);
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// 6벽
	glTranslatef(0.25,-0.11,0.);
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// 4벽
	glTranslatef(0.0,-0.11,0.);
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.4, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.3, -0.4, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.3, -0.39, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.39, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.4, 1.5);
	glTexCoord2f(0.1, 0.0); glVertex3f(0.3, -0.4, 1.5);
	glTexCoord2f(0.1, 0.1); glVertex3f(0.3, -0.39, 1.5);
	glTexCoord2f(0.0, 0.1); glVertex3f(0., -0.39, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// 7벽
	glTranslatef(0.0,-1.1,0.);
	glBindTexture(GL_TEXTURE_2D, wallpaper);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[3]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., 0.71, 1.5);
	glTexCoord2f(0.7, 0.0); glVertex3f(0.3, 0.71, 1.5);
	glTexCoord2f(0.7, 0.7); glVertex3f(0.3, 0.9, 1.5);
	glTexCoord2f(0.0, 0.7); glVertex3f(0., 0.9, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, dol);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[9]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., 0.71, 1.5);
	glTexCoord2f(0.7, 0.0); glVertex3f(0.3, 0.71, 1.5);
	glTexCoord2f(0.7, 0.7); glVertex3f(0.3, 0.9, 1.5);
	glTexCoord2f(0.0, 0.7); glVertex3f(0., 0.9, 1.5);
	glEnd();
	glPopMatrix();

	glPopMatrix();

	////// 회전벽
	glTranslatef(0.5,0.0,0.05);
	glRotatef(-30,0,1,0);
	glPushMatrix();
	//벽
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -1., 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.3, -1., 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.3, -0.5, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0., -0.5, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -1., 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.3, -1., 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.3, -0.5, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0., -0.5, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();

	glPushMatrix();
	// 3벽
	glTranslatef(0.25,0.0,0.);
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();
	glPopMatrix();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();

	// 아래_창문
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
	glEnd();

	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
	glEnd();
	// 위_창문
	glTranslatef(0.0,0.11,0.);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
	glEnd();

	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
	glEnd();

	glPushMatrix();
	// 5벽
	//glTranslatef(0.25,0.0,0.);
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// 6벽
	glTranslatef(0.25,0.0,0.);
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// 6벽
	glTranslatef(0.25,-0.11,0.);
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// 4벽
	glTranslatef(0.0,-0.11,0.);
	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.4, 1.5);
	glTexCoord2f(0.2, 0.0); glVertex3f(0.3, -0.4, 1.5);
	glTexCoord2f(0.2, 0.2); glVertex3f(0.3, -0.39, 1.5);
	glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.39, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, window);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[5]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.4, 1.5);
	glTexCoord2f(0.1, 0.0); glVertex3f(0.3, -0.4, 1.5);
	glTexCoord2f(0.1, 0.1); glVertex3f(0.3, -0.39, 1.5);
	glTexCoord2f(0.0, 0.1); glVertex3f(0., -0.39, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// 7벽
	glTranslatef(0.0,-1.1,0.);
	glBindTexture(GL_TEXTURE_2D, wallpaper);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[3]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., 0.71, 1.5);
	glTexCoord2f(0.7, 0.0); glVertex3f(0.3, 0.71, 1.5);
	glTexCoord2f(0.7, 0.7); glVertex3f(0.3, 0.9, 1.5);
	glTexCoord2f(0.0, 0.7); glVertex3f(0., 0.9, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, dol);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[9]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., 0.71, 1.5);
	glTexCoord2f(0.7, 0.0); glVertex3f(0.3, 0.71, 1.5);
	glTexCoord2f(0.7, 0.7); glVertex3f(0.3, 0.9, 1.5);
	glTexCoord2f(0.0, 0.7); glVertex3f(0., 0.9, 1.5);
	glEnd();
	glPopMatrix();

	glPopMatrix();

	glPushMatrix();
	// 회전쪽 벽_1
	glRotatef(30,0,1,0);
	glTranslatef(0.06,-0.5,-0.2);
	glBindTexture(GL_TEXTURE_2D, wallpaper);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[3]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(0.4, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(0.4, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, dol);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[9]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(0.4, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(0.4, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// 회전쪽 벽_2
	glRotatef(30,0,1,0);
	glTranslatef(-1.25,-0.5,-0.2);
	glBindTexture(GL_TEXTURE_2D, wallpaper);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[3]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(0.5, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(0.5, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, dol);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[9]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(0.5, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(0.5, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	//왼벽
	glRotatef(-60,0,1,0);
	glTranslatef(-0.1,-0.5,-0.25);
	glBindTexture(GL_TEXTURE_2D, wallpaper);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[3]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(1.4, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(1.4, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, dol);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[9]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(1.4, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(1.4, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	//far
	glRotatef(-150,0,1,0);
	glTranslatef(-1.74,-0.5,-1.41);
	glBindTexture(GL_TEXTURE_2D, wallpaper);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[3]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(3.0, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(3.0, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, dol);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[9]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(3.0, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(3.0, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// right
	glRotatef(-240,0,1,0);
	glTranslatef(-1.9,-0.5,0.24);
	glBindTexture(GL_TEXTURE_2D, wallpaper);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[3]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(2.0, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(2.0, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, dol);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[9]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(2.0, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(2.0, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// 문쪽 벽 near
	glRotatef(30,0,1,0);
	glTranslatef(0.95,-0.5,0.401);
	glBindTexture(GL_TEXTURE_2D, wallpaper);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[3]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(0.8, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(0.8, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, dol);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[9]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(0.8, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(0.8, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// 문쪽 벽_right
	glRotatef(-60,0,1,0);
	glTranslatef(1.401,-0.5,-2.45);
	glBindTexture(GL_TEXTURE_2D, wallpaper);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[3]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(0.5, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(0.5, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, dol);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[9]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(0.5, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(0.5, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// 문
	glRotatef(30,0,1,0);
	glTranslatef(0.5,-0.5,0.1);
	glBindTexture(GL_TEXTURE_2D, wallpaper);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[3]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.3, -0.5, 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.3, 0.2, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0., 0.2, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, dol);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[9]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.0, 0.0); glVertex3f(0.3, -0.5, 1.5);
	glTexCoord2f(1.0, 1.0); glVertex3f(0.3, 0.2, 1.5);
	glTexCoord2f(0.0, 1.0); glVertex3f(0., 0.2, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// 문쪽 벽_left
	glRotatef(-60,0,1,0);
	glTranslatef(1.3,-0.5,-1.95);
	glBindTexture(GL_TEXTURE_2D, wallpaper);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[3]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(0.3, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(0.3, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, dol);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[9]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(0.3, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(0.3, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();
	glPopMatrix();

	glPushMatrix();
	// 문쪽 벽_left_2
	glRotatef(30,0,1,0);
	glTranslatef(0.44,-0.5,0.1);
	glBindTexture(GL_TEXTURE_2D, wallpaper);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[3]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(0.07, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(0.07, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, dol);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[9]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(0.07, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(0.07, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();
	// 문쪽 벽_right_2
	glTranslatef(0.36,0.0,0.0);
	glBindTexture(GL_TEXTURE_2D, wallpaper);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[3]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(0.15, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(0.15, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, dol);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[9]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(1.5, 0.0); glVertex3f(0.15, -0.5, 1.5);
	glTexCoord2f(1.5, 1.5); glVertex3f(0.15, 0.41, 1.5);
	glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
	glEnd();

	// 문쪽 벽_위
	glTranslatef(-0.3,0.7,0.0);
	glBindTexture(GL_TEXTURE_2D, wallpaper);
	glFrontFace(GL_CW);	
	glBegin(GL_POLYGON);
	glColor3fv(color[3]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.7, 0.0); glVertex3f(0.3, -0.5, 1.5);
	glTexCoord2f(0.7, 0.7); glVertex3f(0.3, -0.29, 1.5);
	glTexCoord2f(0.0, 0.7); glVertex3f(0., -0.29, 1.5);
	glEnd();

	glBindTexture(GL_TEXTURE_2D, dol);
	glFrontFace(GL_CCW);
	glBegin(GL_POLYGON);
	glColor3fv(color[9]);
	glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
	glTexCoord2f(0.7, 0.0); glVertex3f(0.3, -0.5, 1.5);
	glTexCoord2f(0.7, 0.7); glVertex3f(0.3, -0.29, 1.5);
	glTexCoord2f(0.0, 0.7); glVertex3f(0., -0.29, 1.5);
	glEnd();
	glPopMatrix();

	glPopMatrix();

}
void myDisplay (void)
{
	glutPostRedisplay();
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glLoadIdentity();

	if(!projection)
		gluLookAt(eye[0], eye[1], eye[2], center[0], center[1], center[2], 0, 1, 0);
	glRotatef(rot[0], 1.0f, 0.0f, 0.0f);
	glRotatef(rot[1], 0.0f, 1.0f, 0.0f);
	glRotatef(rot[2], 0.0f, 0.0f, 1.0f);
	glScalef(scale, scale, scale);

	///////////////////////////////////////////////////////////////////////////////////////////////	
	// 1층 ////////////////////////////////////////////////////////////////////////////////////////
	///////////////////////////////////////////////////////////////////////////////////////////////
	if (change==1)
	{
		glEnable(GL_CULL_FACE);

		glPushMatrix();
		glPushMatrix();
		//벽
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -1., 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.3, -1., 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.3, -0.5, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0., -0.5, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -1., 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.3, -1., 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.3, -0.5, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0., -0.5, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();

		glPushMatrix();
		// 3벽
		glTranslatef(0.25,0.0,0.);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();
		glPopMatrix();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();

		// 아래_창문
		glBindTexture(GL_TEXTURE_2D, window);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[5]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
		glEnd();

		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[5]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
		glEnd();
		// 위_창문
		glTranslatef(0.0,0.11,0.);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[5]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
		glEnd();

		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[5]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
		glEnd();

		glPushMatrix();
		// 5벽
		//glTranslatef(0.25,0.0,0.);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		// 6벽
		glTranslatef(0.25,0.0,0.);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		// 6벽
		glTranslatef(0.25,-0.11,0.);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		// 4벽
		glTranslatef(0.0,-0.11,0.);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.4, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.3, -0.4, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.3, -0.39, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.39, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.4, 1.5);
		glTexCoord2f(0.1, 0.0); glVertex3f(0.3, -0.4, 1.5);
		glTexCoord2f(0.1, 0.1); glVertex3f(0.3, -0.39, 1.5);
		glTexCoord2f(0.0, 0.1); glVertex3f(0., -0.39, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		// 7벽
		glTranslatef(0.0,-1.1,0.);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., 0.71, 1.5);
		glTexCoord2f(0.7, 0.0); glVertex3f(0.3, 0.71, 1.5);
		glTexCoord2f(0.7, 0.7); glVertex3f(0.3, 0.9, 1.5);
		glTexCoord2f(0.0, 0.7); glVertex3f(0., 0.9, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., 0.71, 1.5);
		glTexCoord2f(0.7, 0.0); glVertex3f(0.3, 0.71, 1.5);
		glTexCoord2f(0.7, 0.7); glVertex3f(0.3, 0.9, 1.5);
		glTexCoord2f(0.0, 0.7); glVertex3f(0., 0.9, 1.5);
		glEnd();
		glPopMatrix();

		////// 회전벽
		glTranslatef(-0.45,-0.11,0.2);
		glRotatef(30,0,1,0);
		glPushMatrix();
		//벽
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -1., 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.3, -1., 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.3, -0.5, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0., -0.5, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -1., 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.3, -1., 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.3, -0.5, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0., -0.5, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();

		glPushMatrix();
		// 3벽
		glTranslatef(0.25,0.0,0.);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();
		glPopMatrix();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();

		// 아래_창문
		glBindTexture(GL_TEXTURE_2D, window);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[5]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
		glEnd();

		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[5]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
		glEnd();
		// 위_창문
		glTranslatef(0.0,0.11,0.);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[5]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
		glEnd();

		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[5]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
		glEnd();

		glPushMatrix();
		// 5벽
		//glTranslatef(0.25,0.0,0.);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		// 6벽
		glTranslatef(0.25,0.0,0.);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		// 6벽
		glTranslatef(0.25,-0.11,0.);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		// 4벽
		glTranslatef(0.0,-0.11,0.);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.4, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.3, -0.4, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.3, -0.39, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.39, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.4, 1.5);
		glTexCoord2f(0.1, 0.0); glVertex3f(0.3, -0.4, 1.5);
		glTexCoord2f(0.1, 0.1); glVertex3f(0.3, -0.39, 1.5);
		glTexCoord2f(0.0, 0.1); glVertex3f(0., -0.39, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		// 7벽
		glTranslatef(0.0,-1.1,0.);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., 0.71, 1.5);
		glTexCoord2f(0.7, 0.0); glVertex3f(0.3, 0.71, 1.5);
		glTexCoord2f(0.7, 0.7); glVertex3f(0.3, 0.9, 1.5);
		glTexCoord2f(0.0, 0.7); glVertex3f(0., 0.9, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., 0.71, 1.5);
		glTexCoord2f(0.7, 0.0); glVertex3f(0.3, 0.71, 1.5);
		glTexCoord2f(0.7, 0.7); glVertex3f(0.3, 0.9, 1.5);
		glTexCoord2f(0.0, 0.7); glVertex3f(0., 0.9, 1.5);
		glEnd();
		glPopMatrix();

		glPopMatrix();

		////// 회전벽
		glTranslatef(0.5,0.0,0.05);
		glRotatef(-30,0,1,0);
		glPushMatrix();
		//벽
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -1., 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.3, -1., 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.3, -0.5, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0., -0.5, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -1., 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.3, -1., 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.3, -0.5, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0., -0.5, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();

		glPushMatrix();
		// 3벽
		glTranslatef(0.25,0.0,0.);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();
		glPopMatrix();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();

		// 아래_창문
		glBindTexture(GL_TEXTURE_2D, window);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[5]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
		glEnd();

		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[5]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
		glEnd();
		// 위_창문
		glTranslatef(0.0,0.11,0.);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[5]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
		glEnd();

		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[5]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.25, -0.5, 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.25, -0.4, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0.05, -0.4, 1.5);
		glEnd();

		glPushMatrix();
		// 5벽
		//glTranslatef(0.25,0.0,0.);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		// 6벽
		glTranslatef(0.25,0.0,0.);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		// 6벽
		glTranslatef(0.25,-0.11,0.);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.05, -0.5, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.05, -0.4, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.4, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		// 4벽
		glTranslatef(0.0,-0.11,0.);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.4, 1.5);
		glTexCoord2f(0.2, 0.0); glVertex3f(0.3, -0.4, 1.5);
		glTexCoord2f(0.2, 0.2); glVertex3f(0.3, -0.39, 1.5);
		glTexCoord2f(0.0, 0.2); glVertex3f(0., -0.39, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.4, 1.5);
		glTexCoord2f(0.1, 0.0); glVertex3f(0.3, -0.4, 1.5);
		glTexCoord2f(0.1, 0.1); glVertex3f(0.3, -0.39, 1.5);
		glTexCoord2f(0.0, 0.1); glVertex3f(0., -0.39, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		// 7벽
		glTranslatef(0.0,-1.1,0.);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., 0.71, 1.5);
		glTexCoord2f(0.7, 0.0); glVertex3f(0.3, 0.71, 1.5);
		glTexCoord2f(0.7, 0.7); glVertex3f(0.3, 0.9, 1.5);
		glTexCoord2f(0.0, 0.7); glVertex3f(0., 0.9, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., 0.71, 1.5);
		glTexCoord2f(0.7, 0.0); glVertex3f(0.3, 0.71, 1.5);
		glTexCoord2f(0.7, 0.7); glVertex3f(0.3, 0.9, 1.5);
		glTexCoord2f(0.0, 0.7); glVertex3f(0., 0.9, 1.5);
		glEnd();
		glPopMatrix();

		glPopMatrix();

		glPushMatrix();
		// 회전쪽 벽_1
		glRotatef(30,0,1,0);
		glTranslatef(0.06,-0.5,-0.2);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(0.4, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(0.4, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(0.4, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(0.4, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		// 회전쪽 벽_2
		glRotatef(30,0,1,0);
		glTranslatef(-1.25,-0.5,-0.2);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(0.5, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(0.5, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(0.5, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(0.5, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		//왼벽
		glRotatef(-60,0,1,0);
		glTranslatef(-0.1,-0.5,-0.25);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(1.4, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(1.4, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(1.4, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(1.4, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		//바닥
		glRotatef(90,1,0,0);
		glTranslatef(1.03,-0.7,-0.5);
		glRotatef(60,0,0,1);
		glBindTexture(GL_TEXTURE_2D, bottom);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[1]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(2.0, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(2.0, 2.5, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 2.5, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, bottom);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[7]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(2.0, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(2.0, 2.5, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 2.5, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		//far
		glRotatef(-150,0,1,0);
		glTranslatef(-1.74,-0.5,-1.41);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(3.0, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(3.0, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(3.0, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(3.0, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		// right
		glRotatef(-240,0,1,0);
		glTranslatef(-1.9,-0.5,0.24);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(2.0, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(2.0, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(2.0, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(2.0, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		// 문쪽 벽 near
		glRotatef(30,0,1,0);
		glTranslatef(0.95,-0.5,0.401);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(0.8, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(0.8, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(0.8, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(0.8, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		// 문쪽 벽_right
		glRotatef(-60,0,1,0);
		glTranslatef(1.401,-0.5,-2.45);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(0.5, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(0.5, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(0.5, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(0.5, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		// 문
		//glRotatef(30,0,1,0);
		glPushMatrix();
		glTranslatef(0.1,0.0,-0.3);
		glRotatef(door_angle,0,1,0);
		glTranslatef(0.4,-0.5,0.1);
		glBindTexture(GL_TEXTURE_2D, door);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[12]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.3, -0.5, 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.3, 0.2, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0., 0.2, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, door);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[12]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.0, 0.0); glVertex3f(0.3, -0.5, 1.5);
		glTexCoord2f(1.0, 1.0); glVertex3f(0.3, 0.2, 1.5);
		glTexCoord2f(0.0, 1.0); glVertex3f(0., 0.2, 1.5);
		glEnd();
		glPopMatrix();
		glPopMatrix();

		glPushMatrix();
		// 문쪽 벽_left
		glRotatef(-60,0,1,0);
		glTranslatef(1.3,-0.5,-1.95);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(0.3, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(0.3, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(0.3, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(0.3, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();
		glPopMatrix();

		glPushMatrix();
		// 문쪽 벽_left_2
		glRotatef(30,0,1,0);
		glTranslatef(0.44,-0.5,0.1);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(0.07, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(0.07, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(0.07, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(0.07, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();
		// 문쪽 벽_right_2
		glTranslatef(0.36,0.0,0.0);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(0.15, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(0.15, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(1.5, 0.0); glVertex3f(0.15, -0.5, 1.5);
		glTexCoord2f(1.5, 1.5); glVertex3f(0.15, 0.41, 1.5);
		glTexCoord2f(0.0, 1.5); glVertex3f(0., 0.41, 1.5);
		glEnd();

		// 문쪽 벽_위
		glTranslatef(-0.3,0.7,0.0);
		glBindTexture(GL_TEXTURE_2D, wallpaper);
		glFrontFace(GL_CW);	
		glBegin(GL_POLYGON);
		glColor3fv(color[3]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.7, 0.0); glVertex3f(0.3, -0.5, 1.5);
		glTexCoord2f(0.7, 0.7); glVertex3f(0.3, -0.29, 1.5);
		glTexCoord2f(0.0, 0.7); glVertex3f(0., -0.29, 1.5);
		glEnd();

		glBindTexture(GL_TEXTURE_2D, dol);
		glFrontFace(GL_CCW);
		glBegin(GL_POLYGON);
		glColor3fv(color[9]);
		glTexCoord2f(0.0, 0.0); glVertex3f(0., -0.5, 1.5);
		glTexCoord2f(0.7, 0.0); glVertex3f(0.3, -0.5, 1.5);
		glTexCoord2f(0.7, 0.7); glVertex3f(0.3, -0.29, 1.5);
		glTexCoord2f(0.0, 0.7); glVertex3f(0., -0.29, 1.5);
		glEnd();

		glPopMatrix();

		glTranslatef(0.0,1.4,0.0);
		house_2();
		glPushMatrix();
		glTranslatef(1.75,2.31,-0.5);
		if (change2==2)
		{
			house_3();
		}
		glPopMatrix();

		// 1층 가구=============================================================================

		//glRotatef(28, 0, 1, 0);
		glTranslatef(0.5, 0, 0.1);

		// 책상
		glPushMatrix();
		glTranslatef(-1., -0.65, 0.05);
		glScalef(0.05, 0.05, 0.05);
		Desk();
		glPopMatrix();

		// 의자
		glPushMatrix(); 
		glTranslatef(-.6, -0.65, 0.1);
		glRotatef(180, 0, 1, 0);
		glScalef(0.05, 0.05, 0.05);
		Chair();
		glPopMatrix();

		// 옷장
		glPushMatrix();
		glTranslatef(1.7, -0.13, 1.70);
		glRotatef(180, 0, 1, 0);
		glScalef(0.08, 0.045, 0.025);
		Closet();
		glPopMatrix();

		// 식탁
		glPushMatrix();
		glTranslatef(-0.1, -0.65, 0.95);
		glScalef(0.06, 0.05, 0.08);
		DinnerTable();
		glPopMatrix();
		// 식탁의자2
		glPushMatrix();
		glTranslatef(0.5, -0.65, 0.83);
		glRotatef(180, 0, 1, 0);
		glScalef(0.05, 0.05, 0.05);
		Chair();
		glTranslatef(-5.3, -0, 0);
		Chair();
		glPopMatrix();
		// 식탁의자2
		glRotatef(180, 0, 1, 0);
		glPushMatrix();
		glTranslatef(0.5, -0.65, 0.65);
		glTranslatef(-0.85, 0, -1.2);
		glRotatef(180, 0, 1, 0);
		glScalef(0.05, 0.05, 0.05);
		Chair();
		glTranslatef(-5.3, -0, 0);
		Chair();
		glPopMatrix();

		// 계단 ===============================================================================

		glPushMatrix();
		GLfloat stairs = 0.1f;
		glRotatef(90, 0, 1, 0);
		glScalef(0.5, 0.6, 0.5);
		glTranslatef(-0.25, -1.5, -1.5);
		for (int i = 0; i < 14; i++)
		{
			glColor3f( 1., 0., 0.);
			hexahedron(0.5, 0.1, stairs);
			glTranslatef(0.0, 0.1, 0.1);
			stairs += 0.1f;
		}
		glPopMatrix();

		// 2층 가구=============================================================================

		// 침대
		glPushMatrix();
		glRotatef(180, 0, 1, 0);
		glTranslatef(-1.2, 0.05, .8);
		glScalef(0.05, 0.05, 0.05);
		Bed();
		glPopMatrix();

		// TV 받침
		glPushMatrix();
		glTranslatef(0.6, -0.025, 0.16);
		glScalef(0.04, 0.01, 0.05);
		DinnerTable();
		glPopMatrix();

		// TV
		glPushMatrix();
		glTranslatef(0.85, 0.1, 0.1);
		glScalef(.03, .03, .03);
		TV();
		glPopMatrix();

		//======================================================================================
	}

	glFlush();
	glutSwapBuffers();
}
void myLookAt(int key)
{
	if(key == GLUT_KEY_UP) {
		eye[2] = eye[2]-cos(theta)*eyeDelta;
		eye[0] = eye[0]+sin(theta)*eyeDelta;
	}
	else if(key == GLUT_KEY_DOWN) {
		eye[2] = eye[2]+cos(theta)*eyeDelta;
		eye[0] = eye[0]-sin(theta)*eyeDelta;
	}
	center[2] = eye[2]-cos(theta);
	center[0] = eye[0]+sin(theta);
}

void myResize (int width, int height)
{
    if (!height) return;
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glViewport(0, 0, width, height);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
	if(projection) {
		glOrtho(-size, size, -size, size, -size, size); 
		eye[2] = 0.;
	}
    else {
		gluPerspective(60., (float)width/height, .01, 100.);
		eye[2] = 5.;
		myLookAt(0);
	}
	glMatrixMode(GL_MODELVIEW);
	windowWidth=width;
	windowHeight=height;
}

void mySKeyboard (int key, int x, int y)
{
    switch (key) {
		case GLUT_KEY_UP : break;
		case GLUT_KEY_DOWN : break;
		case GLUT_KEY_LEFT : theta-=thetaDelta; break;
		case GLUT_KEY_RIGHT : theta+=thetaDelta; break;
		default : return;
    }
	myLookAt(key);
	glutPostRedisplay();
}

void myKeyboard (unsigned char key, int x, int y)
{
	switch (key)
	{
		case 'p':
			projection = !projection;
			myResize(windowWidth, windowHeight);
		break;
		case 'd':
			depthtest = !depthtest;
			if(depthtest) glEnable(GL_DEPTH_TEST);
			else glDisable(GL_DEPTH_TEST);
		break;
		case 'f':
			frontface = !frontface;
			if(frontface) glFrontFace(GL_CW);
			else glFrontFace(GL_CCW);
		break;
		case 't':
			texture = !texture;
			if(texture) glEnable(GL_TEXTURE_2D);
			else glDisable(GL_TEXTURE_2D);
		break;
		case 'l':
			lighting = !lighting;
			if(lighting) glEnable(GL_LIGHTING);
			else glDisable(GL_LIGHTING);
			break;
		case 'z':
			scale*=scaleDelta;
		break;
		case 'x':
			scale/=scaleDelta;
		break;
		case 'q':
		case 'Q':
		case 27 :
			exit(0);
			break;



		case '1':
			wallpaper ++;
			if (wallpaper == 9)
			{
				wallpaper = 4;
			}
		break;

		case '2':
			bottom ++;
			if (bottom == 14)
			{
				bottom = 9;
			}
			break;

		case '3':
			{
				if (DOOR==false)
				{
					door_angle+=1.0;
					if(door_angle>=90.0)
					{
						DOOR = true;
					}
				}
				else if (DOOR==true)
				{
					door_angle-=1.0;
					if(door_angle<=30.0)
					{
						DOOR = false;
					}
				}
			}
			break;
	}
	glutPostRedisplay();
}

void myMouse(int btn, int state, int x, int y)
{
	if(btn==GLUT_LEFT_BUTTON && state == GLUT_DOWN) {
		glutIdleFunc(NULL);
		mouseState=state;
		mouseButton=btn;
		mouseX=x;
		mouseY=y;
	}
	else if(btn==GLUT_LEFT_BUTTON && state == GLUT_UP)
		mouseState=-1;
	else return;
	glutPostRedisplay();
}

void myMotion(int x, int y)
{
	if(mouseButton == GLUT_LEFT_BUTTON && mouseState == GLUT_DOWN) {
		rot[1] -= (mouseX - x)/5.;
		rot[0] -= (mouseY - y)/5.;
		glutPostRedisplay();
		mouseX=x;
		mouseY=y;
	}
}

void screen_menu(int value)
{
	int		i;
	char *name = 0;

	switch (value) {
	case '1':
		change = 1;
		change2 = 1;
		break;
	case '2':
		change2 = 2;
		break;
	}
	
	glutPostRedisplay();
}

void main (void)
{
	glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
	glutInitWindowSize(800, 600);
	glutCreateWindow("Modle House");
	glutDisplayFunc(myDisplay);
	glutReshapeFunc(myResize);
	glutKeyboardFunc(myKeyboard);
    glutSpecialFunc(mySKeyboard);
	glutMouseFunc(myMouse);
	glutMotionFunc(myMotion);
	glutCreateMenu(screen_menu);
	glutAddMenuEntry("집 안", '1');
	glutAddMenuEntry("집 밖", '2');
	glutAttachMenu(GLUT_RIGHT_BUTTON);
	myInit();
	glutMainLoop();
}