Exemplo n.º 1
0
void drawMyHouse(GLuint texSet[])
{
	//plot dimension
	//x: -4:4
	//y: 0:12
	//z: -4:4

	glEnable(GL_TEXTURE_2D);

	
	
	drawGround(texSet);
	drawRoof(texSet);

	

	glDisable(GL_TEXTURE_2D);



	//bounding volume
	glPushMatrix();
	glTranslatef(0, 6, 0);
	glScalef(8, 12, 8);	
	glColor3f(1.0, 1.0, 1.0);
	glutWireCube(1);
	glPopMatrix();
	
	
}
Exemplo n.º 2
0
void drawHouse(double xLoc,
               double yLoc,
               double zLoc,
               double xSize,
               double ySize,
               double zSize)
{
  //printf("j");fflush(stdout);
	glPushMatrix();
  glTranslated(xLoc, yLoc, zLoc); // For house
	
	coordinates house;
	house.x = 5.0;
	house.y = 4.0;
	house.z = 4.0;
	
	//glTranslated(-house.x/2.0, house.y/2.0, 0);
	
	int logNum = 8;
	double logOverlap= .1;
	
  //printf("k");fflush(stdout);
	// Wall Zero
	glPushMatrix();
	glTranslated(0,-house.y*logOverlap, 0);
	glRotated(0, 0, 0, 0);
	drawWallWithOpening(house.z, house.x, logNum, house.x*.37, 0, house.x*.63, house.z*.75);
	glPopMatrix();
	//printf("l");fflush(stdout);
	// Wall 1
	glPushMatrix();
	glTranslated(house.x*logOverlap, 0, 0);
	glRotated(-90, 0, 0, 1);
	drawWallWithOpening(house.z, house.y, logNum, house.y*.4, house.z*.4, house.y*.75, house.z*.75);
	glPopMatrix();
	//printf("m");fflush(stdout);
	// Wall 2
	glPushMatrix();
	glTranslated(0, house.y*(logOverlap - 1), 0);
	glRotated(00, 0, 0, 0);
	drawWall(house.z, house.x, logNum);
	glPopMatrix();
  //printf("n");fflush(stdout);
	// Wall 3
	glPushMatrix();
	glTranslated(house.x*(1 - logOverlap), 0, 0);
	glRotated(-90, 0, 0, 1);
	drawWallWithOpening(house.z, house.y, logNum, house.y*.25, house.z*.4, house.y*.6, house.z*.75);
	glPopMatrix();
	//printf("o");fflush(stdout);
	drawRoof(2.0, house);
  //printf("y");fflush(stdout);
	drawFloor(house, logOverlap);
	glPopMatrix();
}
Exemplo n.º 3
0
void drawHouse()
{
  ErrCheck("Before drawHouse"); 
	glPushMatrix();
	
	coordinates house; 
	house.x = 5.0;
	house.y = 3.0; 
	house.z = 4.0; 
	
	glTranslated(-house.x/2.0, 0, house.z/2.0); 
	
	int logNum = 8;
	double logOverlap= .1; 
	
	 
	// Wall Zero
	glPushMatrix();
	glTranslated(0, 0, -house.z*logOverlap); 
	glRotated(0, 0, 0, 0); 
	drawWallWithOpening(house.y, house.x, logNum, house.x*.4, 0, house.x*.6, house.y*.75); 
	
	//drawWall(house.y, house.x, logNum); 
	glPopMatrix(); 
	
	// Wall 1
	glPushMatrix();
	glTranslated(house.x*logOverlap, 0, 0); 
	glRotated(90, 0, 1, 0); 
	drawWallWithOpening(house.y, house.z, logNum, house.z*.4, house.y*.4, house.z*.75, house.y*.75); 
	glPopMatrix(); 
	
	// Wall 2
	glPushMatrix();
	glTranslated(0, 0, house.z*(logOverlap - 1)); 
	glRotated(00, 0, 0, 0); 
	drawWall(house.y, house.x, logNum); 
	glPopMatrix();
		
	// Wall 3 
	glPushMatrix();
	glTranslated(house.x*(1 - logOverlap), 0, 0); 
	glRotated(90, 0, 1, 0); 
	drawWallWithOpening(house.y, house.z, logNum, house.z*.4, house.y*.4, house.z*.75, house.y*.75); 
	//drawWall(house.y, house.z, logNum); 
	glPopMatrix(); 
	
	drawRoof(2.0, house);
	drawFloor(house, logOverlap); 
	glPopMatrix(); 
	ErrCheck("After drawFloor"); 
}
Exemplo n.º 4
0
void display(){
	clearDisplay();
	setupCamera();
	displayLighting();
	//code here
	drawWalls();
	drawRoof();
	drawBase();
	drawDomes();
	drawFloors();
	glPushMatrix();
	{
		glTranslatef(0,4500,0);
		drawSmallBuilding();
		glTranslatef(0,-8200,0);
		glRotatef(180,0,0,1);
		drawSmallBuilding();
	}glPopMatrix();
	drawMainBuildingBigPillers();
	//drawGrid(GRID_SIZE,CAMERA_DISTANCE,canDrawGrid);
	glutSwapBuffers();
}
Exemplo n.º 5
0
void drawHouse(void)
{
	mvstack.push(model_view);
	drawHbase();
	model_view *= Translate(0, 20, 0);
	drawRoof();
	model_view = mvstack.pop();
	
	mvstack.push(model_view);
	set_colour(.84, 0, .05);
	model_view *= Translate(0, -5, 10);
	model_view *= Scale(5, 10, 0.5);
	drawCube();
	model_view = mvstack.pop();

	mvstack.push(model_view);
	set_colour(.8, .8, 0);
	model_view *= Translate(2, -5, 10);
	model_view *= Scale (0.5, 0.5, 0.5);
	drawSphere();
	model_view = mvstack.pop();
}