ElevatorSimulation.zip
ElevatorSimulation.zip
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-06-13 00:18 Elevator Simulation
目录 0 2014-06-13 00:16 Elevator SimulationDebug
文件 242176 2014-06-12 22:11 Elevator SimulationDebugElevator Simulation.exe
文件 2446564 2014-06-12 22:11 Elevator SimulationDebugElevator Simulation.ilk
文件 5811200 2014-06-12 22:11 Elevator SimulationDebugElevator Simulation.pdb
目录 0 2014-06-13 00:16 Elevator SimulationElevator Simulation
文件 3657 2014-06-12 22:11 Elevator SimulationElevator SimulationAnimation.cpp
文件 488 2014-06-12 21:44 Elevator SimulationElevator SimulationAnimation.h
文件 1 2009-08-31 02:32 Elevator SimulationElevator SimulationClassDiagram1.cd
目录 0 2014-06-13 00:16 Elevator SimulationElevator SimulationDebug
文件 21259 2014-06-12 22:11 Elevator SimulationElevator SimulationDebugAnimation.obj
文件 241192 2014-06-12 22:11 Elevator SimulationElevator SimulationDebugCL.read.1.tlog
文件 19090 2014-06-12 22:11 Elevator SimulationElevator SimulationDebugCL.write.1.tlog
文件 667 2014-06-12 14:34 Elevator SimulationElevator SimulationDebugElevator Simulation.exe.embed.manifest
文件 732 2014-06-12 16:59 Elevator SimulationElevator SimulationDebugElevator Simulation.exe.embed.manifest.res
文件 381 2014-06-12 22:11 Elevator SimulationElevator SimulationDebugElevator Simulation.exe.intermediate.manifest
文件 114 2014-06-13 00:16 Elevator SimulationElevator SimulationDebugElevator Simulation.lastbuildstate
文件 1465 2014-06-13 00:16 Elevator SimulationElevator SimulationDebugElevator Simulation.log
文件 59377 2014-06-12 21:44 Elevator SimulationElevator SimulationDebugElevator Simulation.obj
文件 33816576 2014-06-12 16:59 Elevator SimulationElevator SimulationDebugElevator Simulation.pch
文件 85268 2014-06-12 16:59 Elevator SimulationElevator SimulationDebugElevator Simulation.res
文件 58388 2014-06-12 21:44 Elevator SimulationElevator SimulationDebugElevator SimulationDoc.obj
文件 54849 2014-06-12 22:11 Elevator SimulationElevator SimulationDebugElevator SimulationView.obj
文件 228 2014-06-12 14:34 Elevator SimulationElevator SimulationDebugElevator Simulation_manifest.rc
文件 90018 2014-06-12 16:59 Elevator SimulationElevator SimulationDebugMainFrm.obj
文件 16634 2014-06-12 22:11 Elevator SimulationElevator SimulationDebugcl.command.1.tlog
文件 2 2014-06-12 22:11 Elevator SimulationElevator SimulationDebuglink-cvtres.read.1.tlog
文件 2 2014-06-12 22:11 Elevator SimulationElevator SimulationDebuglink-cvtres.write.1.tlog
文件 2 2014-06-12 22:11 Elevator SimulationElevator SimulationDebuglink.8140-cvtres.read.1.tlog
文件 2 2014-06-12 22:11 Elevator SimulationElevator SimulationDebuglink.8140-cvtres.write.1.tlog
文件 2 2014-06-12 22:11 Elevator SimulationElevator SimulationDebuglink.8140.read.1.tlog
............此处省略45个文件信息
#include “StdAfx.h“
#include “Animation.h“
//#include “GLFont.h“
CAnimation::CAnimation(void)
{
eleTopLeftX = -2.0f;
eleTopLeftY = 5.7f;
}
CAnimation::~CAnimation(void)
{
}
// 绘制背景图
void CAnimation::drawBack()
{
GLfloat topLeftX = -6.0f; // 左侧线条位置
GLfloat topLeftY = 4.7f;
GLfloat topRightX = -2.0f; //右侧线条位置
GLfloat topRightY = 4.7f;
glColor3f(000); //黑色
glLineWidth(0.5);
glBegin(GL_QUADS); // 绘制三角形
glVertex3f(-6.0f 5.7f 0.0f); // 左上
glVertex3f( 6.0f 5.7f 0.0f); // 右上
glVertex3f( 6.0f 5.6f 0.0f); // 右下
glVertex3f(-6.0f 5.6f 0.0f);
glEnd();
for(int i = 0; i < 8; i++) //下面八个楼层的位置
{
glBegin(GL_QUADS);
glVertex3f(topLeftX topLeftY 0);
glVertex3f(topRightX topRightY 0);
glVertex3f(topRightX topRightY - 0.1 0);
glVertex3f(topLeftX topLeftY - 0.1 0);
glEnd();
glBegin(GL_QUADS);
glVertex3f(topLeftX * -1 topLeftY 0);
glVertex3f(topRightX * -1 topRightY 0);
glVertex3f(topRightX * -1 topRightY - 0.1 0);
glVertex3f(topLeftX * -1 topLeftY - 0.1 0);
glEnd();
topLeftY -= 1;
topRightY -= 1;
}
glBegin(GL_QUADS); // 绘制三角形
glVertex3f(-6.0f topLeftY 0.0f); // 左上
glVertex3f( 6.0f topLeftY 0.0f); // 右上
glVertex3f( 6.0f topLeftY - 0.1 0.0f); // 右下
glVertex3f(-6.0f topLeftY - 0.1 0.0f);
glEnd();
glBegin(GL_QUADS);
glVertex3f(-2.1 5.7 0);
glVertex3f(-2.0 5.7 0);
glVertex3f(-2.0 -3.4 0);
glVertex3f(-2.1 -3.4 0);
glEnd();
glBegin(GL_QUADS);
glVertex3f(2.1 5.7 0);
glVertex3f(2.0 5.7 0);
glVertex3f(2.0 -3.4 0);
glVertex3f(2.1 -3.4 0);
glEnd();
}
void CAnimation::drawElevator()
{
glColor3f(2552550); //电梯颜色
glBegin(GL_QUADS);
glVertex3f(eleTopLeftX eleTopLeftY 0.0f); //电梯形状
glVertex3f(eleTopLeftX +4 eleTopLeftY 0.0f);
glVertex3f(eleTopLeftX +4 eleTopLeftY - 1 0.0f);
glVertex3f(eleTopLeftX eleTopLeftY - 1 0.0f);
glEnd();
}
void CAnimation::nextFram(int thisFloor int nextFloor)
{
int isDown = 0;
GLfloat temp = 0;
if(thisFloor - nextFloor > 0) //判断电梯运行方向
isDown = 1;
else
isDown = 0;
if(isDown)
{
temp = 5.7 + (nextFloor - 9) * 1 + 0.1 ; //电梯向下运行时的位置变化
if(this->eleTopLeftY >= temp)
this->eleTopLeftY -= 0.04;
}
else
{
temp = 5.7 + (nextFloor - 9) * 1 ; //电梯向上运行时的位置变化
if(this->eleTopLeftY < temp)
this->eleTopLeftY += 0.04;
}
}
void CAnimation::upfloor() //电梯向上运行时,箭头指示的方向
{
glColor3f(000);
glLineWidth(1);
glBegin(GL_QUADS); //左半箭头
glVertex3f(7.1 2.0 1);
glVertex3f(7.0 1.5 1);
glVertex3f(7.0 0.0 1);
glVertex3f(7.1 0.0 1);
glEnd();
glBegin(GL_QUADS); //右半箭头
glVertex3f(7.2 1.5 1);
glVertex3f(7.1 2.0 1);
glVerte
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-06-13 00:18 Elevator Simulation
目录 0 2014-06-13 00:16 Elevator SimulationDebug
文件 242176 2014-06-12 22:11 Elevator SimulationDebugElevator Simulation.exe
文件 2446564 2014-06-12 22:11 Elevator SimulationDebugElevator Simulation.ilk
文件 5811200 2014-06-12 22:11 Elevator SimulationDebugElevator Simulation.pdb
目录 0 2014-06-13 00:16 Elevator SimulationElevator Simulation
文件 3657 2014-06-12 22:11 Elevator SimulationElevator SimulationAnimation.cpp
文件 488 2014-06-12 21:44 Elevator SimulationElevator SimulationAnimation.h
文件 1 2009-08-31 02:32 Elevator SimulationElevator SimulationClassDiagram1.cd
目录 0 2014-06-13 00:16 Elevator SimulationElevator SimulationDebug
文件 21259 2014-06-12 22:11 Elevator SimulationElevator SimulationDebugAnimation.obj
文件 241192 2014-06-12 22:11 Elevator SimulationElevator SimulationDebugCL.read.1.tlog
文件 19090 2014-06-12 22:11 Elevator SimulationElevator SimulationDebugCL.write.1.tlog
文件 667 2014-06-12 14:34 Elevator SimulationElevator SimulationDebugElevator Simulation.exe.em
文件 732 2014-06-12 16:59 Elevator SimulationElevator SimulationDebugElevator Simulation.exe.em
文件 381 2014-06-12 22:11 Elevator SimulationElevator SimulationDebugElevator Simulation.exe.intermediate.manifest
文件 114 2014-06-13 00:16 Elevator SimulationElevator SimulationDebugElevator Simulation.lastbuildstate
文件 1465 2014-06-13 00:16 Elevator SimulationElevator SimulationDebugElevator Simulation.log
文件 59377 2014-06-12 21:44 Elevator SimulationElevator SimulationDebugElevator Simulation.obj
文件 33816576 2014-06-12 16:59 Elevator SimulationElevator SimulationDebugElevator Simulation.pch
文件 85268 2014-06-12 16:59 Elevator SimulationElevator SimulationDebugElevator Simulation.res
文件 58388 2014-06-12 21:44 Elevator SimulationElevator SimulationDebugElevator SimulationDoc.obj
文件 54849 2014-06-12 22:11 Elevator SimulationElevator SimulationDebugElevator SimulationView.obj
文件 228 2014-06-12 14:34 Elevator SimulationElevator SimulationDebugElevator Simulation_manifest.rc
文件 90018 2014-06-12 16:59 Elevator SimulationElevator SimulationDebugMainFrm.obj
文件 16634 2014-06-12 22:11 Elevator SimulationElevator SimulationDebugcl.command.1.tlog
文件 2 2014-06-12 22:11 Elevator SimulationElevator SimulationDebugli
文件 2 2014-06-12 22:11 Elevator SimulationElevator SimulationDebugli
文件 2 2014-06-12 22:11 Elevator SimulationElevator SimulationDebugli
文件 2 2014-06-12 22:11 Elevator SimulationElevator SimulationDebugli
文件 2 2014-06-12 22:11 Elevator SimulationElevator SimulationDebugli
............此处省略45个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)