예제 #1
0
파일: main_file.cpp 프로젝트: kkapitan/Maze
void DrawMaze()
{
	if (cur_layer){
		M.PreviousLayer();
		DrawWalls(cur_layer - 1);
		DrawFloor(cur_layer - 1);
		M.NextLayer();
	}
	if (cur_layer < layers - 1){
		M.NextLayer();
		DrawWalls(cur_layer + 1);
		DrawCeiling(cur_layer + 1);
		M.PreviousLayer();
	}
	DrawLayer(cur_layer);

	
}
예제 #2
0
파일: main_file.cpp 프로젝트: kkapitan/Maze
void Animate()
{
	if (direction != 0){
		double step_limit = 60;
		static double step = 0;
		m_center = glm::vec3(glm::translate(glm::mat4(1.0f), glm::vec3(0, direction * (1 / step_limit) * 4, 0))*glm::vec4(m_center, 1));
		m_eye = glm::vec3(glm::translate(glm::mat4(1.0f), glm::vec3(0, direction * (1 / step_limit) * 4, 0))*glm::vec4(m_eye, 1));
		step++;
		if (step >= step_limit) {
			step = 0;
			cur_layer += direction;
			if (direction == 1) M.NextLayer();
			else M.PreviousLayer();
			direction = 0;
		}
		else {
			DrawElevator(step,step_limit);
		}
	}

}