- 浏览: 343480 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
CFJAVA:
分析的真仔细,拜读了!
深入剖析SolrCloud(三) -
cc3514772b:
目前也在使用solr ,想跟lz交流下。。
深入剖析SolrCloud(三)
《基于MFC的OpenGL编程》Part 19 Creating a Virtual Reality Walkthrough Application
本文是整个系列文章的最后一篇,将创建一个完整的虚拟office应用程序(如图所示)来做为ending.
1,在CCY457OpenGLView类中加入下述变量,用来保存office内各个物体的显示列表
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->//DisplayListNames
GLuintm_SceneList;
GLuintm_ComputerList;
GLuintm_ChairList;
GLuintm_BlindsList;
GLuintm_MonitorList;
GLuintm_BooksList;
GLuintm_PhoneList;
GLuintm_DoorList;
GLuintm_SceneList;
GLuintm_ComputerList;
GLuintm_ChairList;
GLuintm_BlindsList;
GLuintm_MonitorList;
GLuintm_BooksList;
GLuintm_PhoneList;
GLuintm_DoorList;
2,创建房间内部场景
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->
//CreatetheDisplayListfortheScene
voidCCY457OpenGLView::CreateSceneList()
{
m_SceneList=glGenLists(1);
glNewList(m_SceneList,GL_COMPILE);
/******************SetupLighting**********************/
SetupLighting();
/***************DrawtheScene*************************/
//DrawtheWalls
DrawWalls();
//DrawtheWallTops,SidesandDesks
DrawWallTopsAndSides();
//Drawthedesks
DrawDesks();
//Drawthecomputers
DrawComputers();
//DrawtheChairs
DrawChairs();
//DrawtheBlinds
DrawBlinds();
//DrawPhones
DrawPhones();
//DrawFloorandCeiling
DrawFloorAndCeiling();
glEndList();
}
//CreatetheDisplayListfortheScene
voidCCY457OpenGLView::CreateSceneList()
{
m_SceneList=glGenLists(1);
glNewList(m_SceneList,GL_COMPILE);
/******************SetupLighting**********************/
SetupLighting();
/***************DrawtheScene*************************/
//DrawtheWalls
DrawWalls();
//DrawtheWallTops,SidesandDesks
DrawWallTopsAndSides();
//Drawthedesks
DrawDesks();
//Drawthecomputers
DrawComputers();
//DrawtheChairs
DrawChairs();
//DrawtheBlinds
DrawBlinds();
//DrawPhones
DrawPhones();
//DrawFloorandCeiling
DrawFloorAndCeiling();
glEndList();
}
3,从Obj文件中加载各个物件的3D模型
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->//LoadalltheModelsfromtheFilesoftype.obj
voidCCY457OpenGLView::LoadModelsFromFiles()
{
GLfloatscalefactor=0.0;
//LoadComputerfromfile
GLMmodel*object1;
object1=glmReadOBJ("Data/models/computer.obj");
if(!scalefactor)
{
scalefactor=glmUnitize(object1);
}
else
{
glmScale(object1,scalefactor);
}
glmScale(object1,1.5);
/*buildadisplaylist*/
m_ComputerList=glmList(object1,GLM_SMOOTH);
/*nukeit,wedon'tneeditanymore*/
glmDelete(object1);
//LoadChairFromFile
GLMmodel*object2;
scalefactor=0.0;
object2=glmReadOBJ("Data/models/chair04.obj");
if(!scalefactor)
{
scalefactor=glmUnitize(object2);
}
else
{
glmScale(object2,scalefactor);
}
glmScale(object2,2.5);
/*buildadisplaylist*/
m_ChairList=glmList(object2,GLM_SMOOTH);
/*nukeit,wedon'tneeditanymore*/
glmDelete(object2);
//LoadBlindsObjectFromFile
GLMmodel*object3;
scalefactor=0.0;
object3=glmReadOBJ("Data/models/blinds.obj");
if(!scalefactor)
{
scalefactor=glmUnitize(object3);
}
else
{
glmScale(object3,scalefactor);
}
glmScale(object3,1.0);
/*buildadisplaylist*/
m_BlindsList=glmList(object3,GLM_SMOOTH);
/*nukeit,wedon'tneeditanymore*/
glmDelete(object3);
//LoadBooksObjectfromfile
GLMmodel*object4;
scalefactor=0.0;
object4=glmReadOBJ("Data/models/books.obj");
if(!scalefactor)
{
scalefactor=glmUnitize(object4);
}
else
{
glmScale(object4,scalefactor);
}
glmScale(object4,1.2);
/*buildadisplaylist*/
m_BooksList=glmList(object4,GLM_SMOOTH);
/*nukeit,wedon'tneeditanymore*/
glmDelete(object4);
//LoadMonitorfromfile
GLMmodel*object5;
scalefactor=0.0;
object5=glmReadOBJ("Data/models/samsung.obj");
if(!scalefactor)
{
scalefactor=glmUnitize(object5);
}
else
{
glmScale(object5,scalefactor);
}
glmScale(object5,0.20);
/*buildadisplaylist*/
m_MonitorList=glmList(object5,GLM_SMOOTH);
/*nukeit,wedon'tneeditanymore*/
glmDelete(object5);
//LoadPhoneObjectfromfile
GLMmodel*object6;
scalefactor=0.0;
object6=glmReadOBJ("Data/models/phone.obj");
if(!scalefactor)
{
scalefactor=glmUnitize(object6);
}
else
{
glmScale(object6,scalefactor);
}
glmScale(object6,0.08);
/*buildadisplaylist*/
m_PhoneList=glmList(object6,GLM_SMOOTH);
/*nukeit,wedon'tneeditanymore*/
glmDelete(object6);
}
voidCCY457OpenGLView::LoadModelsFromFiles()
{
GLfloatscalefactor=0.0;
//LoadComputerfromfile
GLMmodel*object1;
object1=glmReadOBJ("Data/models/computer.obj");
if(!scalefactor)
{
scalefactor=glmUnitize(object1);
}
else
{
glmScale(object1,scalefactor);
}
glmScale(object1,1.5);
/*buildadisplaylist*/
m_ComputerList=glmList(object1,GLM_SMOOTH);
/*nukeit,wedon'tneeditanymore*/
glmDelete(object1);
//LoadChairFromFile
GLMmodel*object2;
scalefactor=0.0;
object2=glmReadOBJ("Data/models/chair04.obj");
if(!scalefactor)
{
scalefactor=glmUnitize(object2);
}
else
{
glmScale(object2,scalefactor);
}
glmScale(object2,2.5);
/*buildadisplaylist*/
m_ChairList=glmList(object2,GLM_SMOOTH);
/*nukeit,wedon'tneeditanymore*/
glmDelete(object2);
//LoadBlindsObjectFromFile
GLMmodel*object3;
scalefactor=0.0;
object3=glmReadOBJ("Data/models/blinds.obj");
if(!scalefactor)
{
scalefactor=glmUnitize(object3);
}
else
{
glmScale(object3,scalefactor);
}
glmScale(object3,1.0);
/*buildadisplaylist*/
m_BlindsList=glmList(object3,GLM_SMOOTH);
/*nukeit,wedon'tneeditanymore*/
glmDelete(object3);
//LoadBooksObjectfromfile
GLMmodel*object4;
scalefactor=0.0;
object4=glmReadOBJ("Data/models/books.obj");
if(!scalefactor)
{
scalefactor=glmUnitize(object4);
}
else
{
glmScale(object4,scalefactor);
}
glmScale(object4,1.2);
/*buildadisplaylist*/
m_BooksList=glmList(object4,GLM_SMOOTH);
/*nukeit,wedon'tneeditanymore*/
glmDelete(object4);
//LoadMonitorfromfile
GLMmodel*object5;
scalefactor=0.0;
object5=glmReadOBJ("Data/models/samsung.obj");
if(!scalefactor)
{
scalefactor=glmUnitize(object5);
}
else
{
glmScale(object5,scalefactor);
}
glmScale(object5,0.20);
/*buildadisplaylist*/
m_MonitorList=glmList(object5,GLM_SMOOTH);
/*nukeit,wedon'tneeditanymore*/
glmDelete(object5);
//LoadPhoneObjectfromfile
GLMmodel*object6;
scalefactor=0.0;
object6=glmReadOBJ("Data/models/phone.obj");
if(!scalefactor)
{
scalefactor=glmUnitize(object6);
}
else
{
glmScale(object6,scalefactor);
}
glmScale(object6,0.08);
/*buildadisplaylist*/
m_PhoneList=glmList(object6,GLM_SMOOTH);
/*nukeit,wedon'tneeditanymore*/
glmDelete(object6);
}
4,创建各个具体物件的代码:
创建各个物体
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->voidCCY457OpenGLView::DrawPentagonTable()
{
glBegin(GL_TRIANGLES);
//TableTop
glNormal3f(0.0f,1.0f,0.0f);
//LightBrown
glColor3f(0.7f,0.6f,0.55f);
glVertex3f(-0.75f,0.3f,-0.05f);
glVertex3f(-0.05f,0.3f,-0.05f);
glVertex3f(-0.75f,0.3f,-0.45f);
glVertex3f(-0.75f,0.3f,-0.45f);
glVertex3f(-0.05f,0.3f,-0.05f);
glVertex3f(-0.45f,0.3f,-0.75f);
glVertex3f(-0.45f,0.3f,-0.75f);
glVertex3f(-0.05f,0.3f,-0.05f);
glVertex3f(-0.05f,0.3f,-0.75f);
//TableFront
glColor3f(0.9f,0.9f,0.8f);
glVertex3f(-0.75f,0.25f,-0.45f);
glVertex3f(-0.75f,0.3f,-0.45f);
glVertex3f(-0.45f,0.3f,-0.75f);
glVertex3f(-0.75f,0.25f,-0.45f);
glVertex3f(-0.45f,0.3f,-0.75f);
glVertex3f(-0.45f,0.25f,-0.75f);
glEnd();
glDisable(GL_LIGHTING);
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
glPolygonOffset(1.0f,-3.0f);
glEnable(GL_POLYGON_OFFSET_LINE);
//FrontEdge
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-0.75f,0.25f,-0.45f);
glVertex3f(-0.75f,0.3f,-0.45f);
glVertex3f(-0.45f,0.3f,-0.75f);
glVertex3f(-0.45f,0.25f,-0.75f);
glEnd();
glEnable(GL_LIGHTING);
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
glEnable(GL_POLYGON_OFFSET_LINE);
}
voidCCY457OpenGLView::DrawWalls()
{
//DrawtheWallsforwhichFrontFacescanbeculled
//CullFrontFaces
//EnableCulling
glEnable(GL_CULL_FACE);
//CullFrontFaces
glCullFace(GL_FRONT);
glBegin(GL_TRIANGLES);
//DrawtheBackWall
//DefineBackWallNormal
glNormal3f(0.0f,0.0f,1.0f);
//DefineBackWallMaterial-LightGrey
glColor3f(0.75f,0.75f,0.75f);
//BackWallTriangles
glVertex3f(0.0f,0.0f,0.0f);
glVertex3f(0.0f,1.0f,0.0f);
glVertex3f(-5.5f,1.0f,0.0f);
glVertex3f(0.0f,0.0f,0.0f);
glVertex3f(-5.5f,1.0f,0.0f);
glVertex3f(-5.5f,0.0f,0.0f);
//BackWallThickness
glVertex3f(-0.0f,0.0f,-0.05f);
glVertex3f(-0.0f,1.0f,-0.05f);
glVertex3f(-5.5f,1.0f,-0.05f);
glVertex3f(-0.0f,0.0f,-0.05f);
glVertex3f(-5.5f,1.0f,-0.05f);
glVertex3f(-5.5f,0.0f,-0.05f);
//DrawtheRightWall
//DefineRightWallNormal
glNormal3f(1.0f,0.0f,0.0f);
//DefineRightWallMaterial-LightBrown
glColor3f(0.7f,0.6f,0.55f);
//RightWallTriangles
glVertex3f(0.0f,0.0f,-0.05f);
glVertex3f(0.0f,0.0f,-2.95f);
glVertex3f(0.0f,0.6f,-0.05f);
glVertex3f(0.0f,0.0f,-2.95f);
glVertex3f(0.0f,0.6f,-2.95f);
glVertex3f(0.0f,0.6f,-0.05f);
//RightWallThickness
glVertex3f(-0.05f,0.0f,-0.05f);
glVertex3f(-0.05f,0.0f,-2.95f);
glVertex3f(-0.05f,0.6f,-0.05f);
glVertex3f(-0.05f,0.0f,-2.95f);
glVertex3f(-0.05f,0.6f,-2.95f);
glVertex3f(-0.05f,0.6f,-0.05f);
//DrawtheLeftWall
//DefineLeftWallNormal
glNormal3f(-1.0f,0.0f,0.0f);
//LeftWallTriangles
glVertex3f(-5.5f,0.0f,-0.05f);
glVertex3f(-5.5f,1.0f,-0.05f);
glVertex3f(-5.5f,1.0f,-2.95f);
glVertex3f(-5.5f,0.0f,-0.05f);
glVertex3f(-5.5f,1.0f,-2.95f);
glVertex3f(-5.5f,0.0f,-2.95f);
//LeftWallThickness
glVertex3f(-5.45f,0.0f,-0.05f);
glVertex3f(-5.45f,1.0f,-0.05f);
glVertex3f(-5.45f,1.0f,-2.95f);
glVertex3f(-5.45f,0.0f,-0.05f);
glVertex3f(-5.45f,1.0f,-2.95f);
glVertex3f(-5.45f,0.0f,-2.95f);
glEnd();
//DrawthePillar
//CullBackFacesforPillar
glCullFace(GL_BACK);
//Right
glBegin(GL_POLYGON);
glVertex3f(-3.2f,0.0f,-1.5f);
glVertex3f(-3.2f,1.0f,-1.5f);
glVertex3f(-3.2f,1.0f,-1.0f);
glVertex3f(-3.2f,0.0f,-1.0f);
glEnd();
//Left
glBegin(GL_POLYGON);
glVertex3f(-3.7f,0.0f,-1.5f);
glVertex3f(-3.7f,0.0f,-1.0f);
glVertex3f(-3.7f,1.0f,-1.0f);
glVertex3f(-3.7f,1.0f,-1.5f);
glEnd();
//Front
glBegin(GL_POLYGON);
glVertex3f(-3.2f,0.0f,-1.5f);
glVertex3f(-3.7f,0.0f,-1.5f);
glVertex3f(-3.7f,1.0f,-1.5f);
glVertex3f(-3.2f,1.0f,-1.5f);
glEnd();
//Back
glBegin(GL_POLYGON);
glVertex3f(-3.2f,0.0f,-1.0f);
glVertex3f(-3.2f,1.0f,-1.0f);
glVertex3f(-3.7f,1.0f,-1.0f);
glVertex3f(-3.7f,0.0f,-1.0f);
glEnd();
//Drawtheedges
glColor3f(0.0f,0.0f,0.0f);
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
//Right
glBegin(GL_POLYGON);
glVertex3f(-3.2f,0.0f,-1.5f);
glVertex3f(-3.2f,1.0f,-1.5f);
glVertex3f(-3.2f,1.0f,-1.0f);
glVertex3f(-3.2f,0.0f,-1.0f);
glEnd();
//Left
glBegin(GL_POLYGON);
glVertex3f(-3.7f,0.0f,-1.5f);
glVertex3f(-3.7f,0.0f,-1.0f);
glVertex3f(-3.7f,1.0f,-1.0f);
glVertex3f(-3.7f,1.0f,-1.5f);
glEnd();
//Front
glBegin(GL_POLYGON);
glVertex3f(-3.2f,0.0f,-1.5f);
glVertex3f(-3.7f,0.0f,-1.5f);
glVertex3f(-3.7f,1.0f,-1.5f);
glVertex3f(-3.2f,1.0f,-1.5f);
glEnd();
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
glColor3f(0.7f,0.6f,0.55f);
//DrawthewallsforwhichNofacescanbeculled
glDisable(GL_CULL_FACE);
glBegin(GL_TRIANGLES);
//DrawtheFrontRightWall
//DefineFrontRightWallNormal
glNormal3f(0.0f,0.0f,-1.0f);
//FrontRightWallTriangles
glVertex3f(0.0f,0.0f,-3.0f);
glVertex3f(-3.5f,0.0f,-3.0f);
glVertex3f(0.0f,0.6f,-3.0f);
glVertex3f(-3.5f,0.0f,-3.0f);
glVertex3f(-3.5f,0.6f,-3.0f);
glVertex3f(0.0f,0.6f,-3.0f);
//FrontRightWallThickness
glVertex3f(0.0f,0.0f,-2.95f);
glVertex3f(-3.5f,0.0f,-2.95f);
glVertex3f(0.0f,0.6f,-2.95f);
glVertex3f(-3.5f,0.0f,-2.95f);
glVertex3f(-3.5f,0.6f,-2.95f);
glVertex3f(0.0f,0.6f,-2.95f);
//DrawtheFrontLeftWall
//FrontLeftWallTriangles
glVertex3f(-4.0f,0.0f,-3.0f);
glVertex3f(-5.5f,0.0f,-3.0f);
glVertex3f(-4.0f,0.6f,-3.0f);
glVertex3f(-5.5f,0.0f,-3.0f);
glVertex3f(-5.5f,0.6f,-3.0f);
glVertex3f(-4.0f,0.6f,-3.0f);
//FrontLeftWallThickness
glVertex3f(-4.0f,0.0f,-2.95f);
glVertex3f(-5.5f,0.0f,-2.95f);
glVertex3f(-4.0f,0.6f,-2.95f);
glVertex3f(-5.5f,0.0f,-2.95f);
glVertex3f(-5.5f,0.6f,-2.95f);
glVertex3f(-4.0f,0.6f,-2.95f);
glEnd();
}
voidCCY457OpenGLView::DrawWallTopsAndSides()
{
//CullBackFaces
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glBegin(GL_TRIANGLES);
//DefineNormals
glNormal3f(0.0f,1.0f,0.0f);
//DefineMaterial-LightBrown
glColor3f(0.7f,0.6f,0.55f);
//BackWallTop
glVertex3f(0.0f,1.0f,0.0f);
glVertex3f(0.0f,1.0f,-0.05f);
glVertex3f(-5.5f,1.0f,0.0f);
glVertex3f(0.0f,1.0f,-0.05f);
glVertex3f(-5.5f,1.0f,-0.05f);
glVertex3f(-5.5f,1.0f,0.0f);
//RightWallTop
glVertex3f(0.0f,0.6f,-0.05f);
glVertex3f(-0.05f,0.6f,-2.95f);
glVertex3f(-0.05f,0.6f,-0.05f);
glVertex3f(0.0f,0.6f,-0.05f);
glVertex3f(0.0f,0.6f,-2.95f);
glVertex3f(-0.05f,0.6f,-2.95f);
//LeftWallTop
glVertex3f(-5.45f,1.0f,-0.05f);
glVertex3f(-5.5f,1.0f,-2.95f);
glVertex3f(-5.5f,1.0f,-0.05f);
glVertex3f(-5.45f,1.0f,-0.05f);
glVertex3f(-5.45f,1.0f,-2.95f);
glVertex3f(-5.5f,1.0f,-2.95f);
//LeftWallSide
glNormal3f(0.0f,0.0f,-1.0f);
glVertex3f(-5.45f,1.0f,-2.95f);
glVertex3f(-5.5f,0.0f,-2.95f);
glVertex3f(-5.5f,1.0f,-2.95f);
glVertex3f(-5.45f,1.0f,-2.95f);
glVertex3f(-5.45f,0.0f,-2.95f);
glVertex3f(-5.5f,0.0f,-2.95f);
//FrontRightWallTop
glVertex3f(0.0f,0.6f,-2.95f);
glVertex3f(0.0f,0.6f,-3.0f);
glVertex3f(-3.5f,0.6f,-2.95f);
glVertex3f(0.0f,0.6f,-3.0f);
glVertex3f(-3.5f,0.6,-3.0f);
glVertex3f(-3.5f,0.6f,-2.95f);
//FrontLeftWallTop
glVertex3f(-4.0f,0.6,-2.95f);
glVertex3f(-4.0f,0.6f,-3.0f);
glVertex3f(-5.5f,0.6f,-2.95f);
glVertex3f(-4.0f,0.6f,-3.0f);
glVertex3f(-5.5f,0.6,-3.0f);
glVertex3f(-5.5f,0.6f,-2.95f);
//FrontRightWallLeftSide
glNormal3f(-1.0f,0.0f,0.0f);
glVertex3f(-3.5f,0.6f,-2.95f);
glVertex3f(-3.5f,0.6f,-3.0f);
glVertex3f(-3.5f,0.0f,-2.95f);
glVertex3f(-3.5f,0.6f,-3.0f);
glVertex3f(-3.5f,0.0f,-3.0f);
glVertex3f(-3.5f,0.0f,-2.95f);
//FrontRightWallRightSide
glNormal3f(1.0f,0.0f,0.0f);
glVertex3f(0.0f,0.0f,-3.0f);
glVertex3f(0.0f,0.6f,-2.95f);
glVertex3f(0.0f,0.0f,-2.95f);
glVertex3f(0.0f,0.0f,-3.0f);
glVertex3f(0.0f,0.6f,-3.0f);
glVertex3f(0.0f,0.6f,-2.95f);
//FrontLeftWallSide
glNormal3f(1.0f,0.0f,0.0f);
glVertex3f(-4.0f,0.6f,-3.0f);
glVertex3f(-4.0f,0.6f,-2.95f);
glVertex3f(-4.0f,0.0f,-3.0f);
glVertex3f(-4.0f,0.6f,-2.95f);
glVertex3f(-4.0f,0.0f,-2.95f);
glVertex3f(-4.0f,0.0f,-3.0f);
}
voidCCY457OpenGLView::DrawDesks()
{
//Desks
//DrawtheFrontLongDesk
glNormal3f(0.0f,1.0f,0.0f);
//Brown
glColor3f(0.7f,0.6f,0.55f);
glVertex3f(-3.5f,0.3f,-2.55f);
glVertex3f(-0.75f,0.3f,-2.55f);
glVertex3f(-3.5f,0.3f,-2.95f);
glVertex3f(-3.5f,0.3f,-2.95f);
glVertex3f(-0.75f,0.3f,-2.55f);
glVertex3f(-0.75f,0.3f,-2.95f);
//DrawtheFrontLongDeskThickness
glVertex3f(-3.5f,0.25f,-2.55f);
glVertex3f(-0.75f,0.25f,-2.55f);
glVertex3f(-3.5f,0.25f,-2.95f);
glVertex3f(-3.5f,0.25f,-2.95f);
glVertex3f(-0.75f,0.25f,-2.55f);
glVertex3f(-0.75f,0.25f,-2.95f);
//DrawtheFrontLongDeskFront
glNormal3f(0.0f,0.0f,1.0f);
glColor3f(0.9f,0.9f,0.8f);
glVertex3f(-0.75f,0.25f,-2.55f);
glVertex3f(-0.75f,0.3f,-2.55f);
glVertex3f(-3.5f,0.25f,-2.55f);
glVertex3f(-3.5f,0.25f,-2.55f);
glVertex3f(-0.75f,0.3f,-2.55f);
glVertex3f(-3.5f,0.3f,-2.55f);
//DrawtheFrontLongDeskSide
glNormal3f(-1.0f,0.0f,0.0f);
glVertex3f(-3.5f,0.25f,-2.55f);
glVertex3f(-3.5f,0.3f,-2.55f);
glVertex3f(-3.5f,0.25f,-2.95f);
glVertex3f(-3.5f,0.25f,-2.95f);
glVertex3f(-3.5f,0.3f,-2.55f);
glVertex3f(-3.5f,0.3f,-2.95f);
//DrawtheFrontShortDesk
glNormal3f(0.0f,1.0f,0.0f);
glColor3f(0.7f,0.6f,0.55f);
glVertex3f(-4.75f,0.3f,-2.55f);
glVertex3f(-4.0f,0.3f,-2.55f);
glVertex3f(-4.75f,0.3f,-2.95f);
glVertex3f(-4.75f,0.3f,-2.95f);
glVertex3f(-4.0f,0.3f,-2.55f);
glVertex3f(-4.0f,0.3f,-2.95f);
//DrawtheFrontShortDeskThickness
glVertex3f(-4.75f,0.25f,-2.55f);
glVertex3f(-4.0f,0.25f,-2.55f);
glVertex3f(-4.75f,0.25f,-2.95f);
glVertex3f(-4.75f,0.25f,-2.95f);
glVertex3f(-4.0f,0.25f,-2.55f);
glVertex3f(-4.0f,0.25f,-2.95f);
//DrawtheFrontShortDeskFrontThickness
glNormal3f(0.0f,0.0f,1.0f);
glColor3f(0.9f,0.9f,0.8f);
glVertex3f(-4.0f,0.25f,-2.55f);
glVertex3f(-4.0f,0.3f,-2.55f);
glVertex3f(-4.75f,0.3f,-2.55f);
glVertex3f(-4.0f,0.25f,-2.55f);
glVertex3f(-4.75f,0.3f,-2.55f);
glVertex3f(-4.75f,0.25f,-2.55f);
//DrawtheFrontShortDeskSideThickness
glNormal3f(1.0f,0.0f,0.0f);
glColor3f(0.9f,0.9f,0.8f);
glVertex3f(-4.0f,0.25f,-2.95f);
glVertex3f(-4.0f,0.3f,-2.95f);
glVertex3f(-4.0f,0.3f,-2.55f);
glVertex3f(-4.0f,0.25f,-2.95f);
glVertex3f(-4.0f,0.3f,-2.55f);
glVertex3f(-4.0f,0.25f,-2.55f);
//DrawtheRightMiddleDesk
glNormal3f(0.0f,1.0f,0.0f);
glColor3f(0.7f,0.6f,0.55f);
glVertex3f(-0.45f,0.3f,-0.75f);
glVertex3f(-0.05f,0.3f,-0.75f);
glVertex3f(-0.45f,0.3f,-2.25f);
glVertex3f(-0.45f,0.3f,-2.25f);
glVertex3f(-0.05f,0.3f,-0.75f);
glVertex3f(-0.05f,0.3f,-2.25f);
//DrawtheRightMiddleDeskThickness
glVertex3f(-0.45f,0.25f,-0.75f);
glVertex3f(-0.05f,0.25f,-0.75f);
glVertex3f(-0.45f,0.25f,-2.25f);
glVertex3f(-0.45f,0.25f,-2.25f);
glVertex3f(-0.05f,0.25f,-0.75f);
glVertex3f(-0.05f,0.25f,-2.25f);
//DrawtheRightMiddleDeskFront
glNormal3f(-1.0f,0.0f,0.0f);
glColor3f(0.9f,0.9f,0.8f);
glVertex3f(-0.45f,0.25f,-0.75f);
glVertex3f(-0.45f,0.3f,-0.75f);
glVertex3f(-0.45f,0.25f,-2.25f);
glVertex3f(-0.45f,0.25f,-2.25f);
glVertex3f(-0.45f,0.3f,-0.75f);
glVertex3f(-0.45f,0.3f,-2.25f);
//DrawtheLeftMiddleDesk
glNormal3f(0.0f,1.0f,0.0f);
glColor3f(0.7f,0.6f,0.55f);
glVertex3f(-5.45f,0.3f,-1.15f);
glVertex3f(-5.05f,0.3f,-1.15f);
glVertex3f(-5.45f,0.3f,-2.25f);
glVertex3f(-5.45f,0.3f,-2.25f);
glVertex3f(-5.05f,0.3f,-1.15f);
glVertex3f(-5.05f,0.3f,-2.25f);
//DrawtheLeftMiddleDeskThickness
glVertex3f(-5.45f,0.25f,-1.15f);
glVertex3f(-5.05f,0.25f,-1.15f);
glVertex3f(-5.45f,0.25f,-2.25f);
glVertex3f(-5.45f,0.25f,-2.25f);
glVertex3f(-5.05f,0.25f,-1.15f);
glVertex3f(-5.05f,0.25f,-2.25f);
//DrawtheLeftMiddleDeskFrontPortion
glNormal3f(1.0f,0.0f,0.0f);
glColor3f(0.9f,0.9f,0.8f);
glVertex3f(-5.05f,0.25f,-1.15f);
glVertex3f(-5.05f,0.3f,-2.25f);
glVertex3f(-5.05f,0.3f,-1.15f);
glVertex3f(-5.05f,0.25f,-1.15f);
glVertex3f(-5.05f,0.25f,-2.25f);
glVertex3f(-5.05f,0.3f,-2.25f);
//DrawtheBackWallDesk
glNormal3f(0.0f,1.0f,0.0f);
glColor3f(0.7f,0.6f,0.55f);
glVertex3f(-5.45f,0.3f,-0.05f);
glVertex3f(-0.75f,0.3f,-0.05f);
glVertex3f(-5.45f,0.3f,-0.45f);
glVertex3f(-5.45f,0.3f,-0.45f);
glVertex3f(-0.75f,0.3f,-0.05f);
glVertex3f(-0.75f,0.3f,-0.45f);
//DrawtheBackWallDeskThickness
glVertex3f(-5.45f,0.25f,-0.05f);
glVertex3f(-0.75f,0.25f,-0.05f);
glVertex3f(-5.45f,0.25f,-0.45f);
glVertex3f(-5.45f,0.25f,-0.45f);
glVertex3f(-0.75f,0.25f,-0.05f);
glVertex3f(-0.75f,0.25f,-0.45f);
//DrawtheBackWallDeskFrontThickness
glNormal3f(0.0f,0.0f,-1.0f);
glColor3f(0.9f,0.9f,0.8f);
glVertex3f(-0.75f,0.25f,-0.45f);
glVertex3f(-5.45f,0.25f,-0.45f);
glVertex3f(-5.45f,0.3f,-0.45f);
glVertex3f(-0.75f,0.25f,-0.45f);
glVertex3f(-5.45f,0.3f,-0.45f);
glVertex3f(-0.75f,0.3f,-0.45f);
glEnd();
//DeskFrontandSideEdges
glDisable(GL_LIGHTING);
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
glPolygonOffset(1.0f,-3.0f);
glEnable(GL_POLYGON_OFFSET_LINE);
glEnable(GL_POLYGON_SMOOTH);
//FrontDeskFront
glBegin(GL_POLYGON);
glNormal3f(0.0f,0.0f,1.0f);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-0.75f,0.25f,-2.55f);
glVertex3f(-0.75f,0.3f,-2.55f);
glVertex3f(-3.5f,0.3f,-2.55f);
glVertex3f(-3.5f,0.25f,-2.55);
glEnd();
//FrontDeskSide
glBegin(GL_POLYGON);
glNormal3f(-1.0f,0.0f,0.0f);
glVertex3f(-3.5f,0.25f,-2.55f);
glVertex3f(-3.5f,0.3f,-2.55f);
glVertex3f(-3.5f,0.3f,-2.95f);
glVertex3f(-3.5f,0.25f,-2.95f);
glEnd();
//RightDeskFront
glBegin(GL_POLYGON);
glNormal3f(-1.0f,0.0f,0.0f);
glVertex3f(-0.45f,0.25f,-0.75f);
glVertex3f(-0.45f,0.3f,-0.75f);
glVertex3f(-0.45f,0.3f,-2.25f);
glVertex3f(-0.45f,0.25f,-2.25f);
glEnd();
//DrawtheFrontShortDeskFrontThickness
glBegin(GL_POLYGON);
glNormal3f(0.0f,0.0f,1.0f);
glVertex3f(-4.0f,0.25f,-2.55f);
glVertex3f(-4.0f,0.3f,-2.55f);
glVertex3f(-4.75f,0.3f,-2.55f);
glVertex3f(-4.75f,0.25f,-2.55f);
glEnd();
//DrawtheFrontShortDeskSideThickness
glBegin(GL_POLYGON);
glNormal3f(1.0f,0.0f,0.0f);
glVertex3f(-4.0f,0.25f,-2.95f);
glVertex3f(-4.0f,0.3f,-2.95f);
glVertex3f(-4.0f,0.3f,-2.55f);
glVertex3f(-4.0f,0.25f,-2.55f);
glEnd();
//DrawtheLeftMiddleDeskFrontPortion
glBegin(GL_POLYGON);
glNormal3f(1.0f,0.0f,0.0f);
glVertex3f(-5.05f,0.25f,-2.25f);
glVertex3f(-5.05f,0.3f,-2.25f);
glVertex3f(-5.05f,0.3f,-1.15f);
glVertex3f(-5.05f,0.25f,-1.15f);
glEnd();
//Drawtheback
glBegin(GL_POLYGON);
glNormal3f(0.0f,0.0f,-1.0f);
glVertex3f(-0.75f,0.25f,-0.45f);
glVertex3f(-5.45f,0.25f,-0.45f);
glVertex3f(-5.45f,0.3f,-0.45f);
glVertex3f(-0.75f,0.3f,-0.45f);
glEnd();
glDisable(GL_POLYGON_OFFSET_LINE);
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
glEnable(GL_LIGHTING);
glDisable(GL_POLYGON_SMOOTH);
//ComputerTables
//DrawtheBackComputerTable
DrawPentagonTable();
//DrawtheFrontRightComputerTable
glPushMatrix();
glTranslatef(0.0f,0.0f,-3.00f);
glRotatef(90.0f,0.0f,1.0f,0.0f);
DrawPentagonTable();
glPopMatrix();
//DrawtheFrontLeftComputerTable
glPushMatrix();
glTranslatef(-5.5,0.0f,-3.0f);
glRotatef(180.0f,0.0f,1.0f,0.0f);
DrawPentagonTable();
glPopMatrix();
}
voidCCY457OpenGLView::DrawComputers()
{
//Computers
//DrawtheBackLeftCornerComputer
//SetColortoLightGrey
glColor3f(0.35,0.35f,0.35f);
glPushMatrix();
glTranslatef(-0.5f,0.42f,-0.4f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(-145.0f,0.0f,0.0f,1.0f);
glCallList(m_ComputerList);
glPopMatrix();
glPushMatrix();
glTranslatef(-2.0f,0.42f,-0.25f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(180.0f,0.0f,0.0f,1.0f);
glCallList(m_ComputerList);
glPopMatrix();
glPushMatrix();
glTranslatef(-3.5f,0.42f,-0.25f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(180.0f,0.0f,0.0f,1.0f);
glCallList(m_ComputerList);
glPopMatrix();
//FrontLeftComputer1
glPushMatrix();
glTranslatef(-0.5f,0.42f,-2.6f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(-45.0f,0.0f,0.0f,1.0f);
glCallList(m_ComputerList);
glPopMatrix();
//FrontLeftComputer2
glPushMatrix();
glTranslatef(-2.0f,0.42f,-2.75f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glCallList(m_ComputerList);
glPopMatrix();
//FrontRight
glPushMatrix();
glTranslatef(-5.1f,0.42f,-2.6);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(45.0f,0.0f,0.0f,1.0f);
glCallList(m_ComputerList);
glPopMatrix();
}
voidCCY457OpenGLView::DrawChairs()
{
glColor3f(0.28f,0.21f,0.0f);
//BackLeftChair
glPushMatrix();
glTranslatef(-0.7f,0.2f,-0.7f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(10.0f,0.0f,0.0f,1.0f);
glCallList(m_ChairList);
glPopMatrix();
//BackRight1
glPushMatrix();
glTranslatef(-2.0f,0.2f,-0.7f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(-30.0f,0.0f,0.0f,1.0f);
glCallList(m_ChairList);
glPopMatrix();
//BackRight2
glPushMatrix();
glTranslatef(-3.5f,0.2f,-0.7f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(-30.0f,0.0f,0.0f,1.0f);
glCallList(m_ChairList);
glPopMatrix();
//FrontLeft1
glPushMatrix();
glTranslatef(-0.7f,0.2f,-2.3f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(110.0f,0.0f,0.0f,1.0f);
glCallList(m_ChairList);
glPopMatrix();
//FrontLeft2
glPushMatrix();
glTranslatef(-2.0f,0.2f,-2.3f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(150.0f,0.0f,0.0f,1.0f);
glCallList(m_ChairList);
glPopMatrix();
//FrontRight
glPushMatrix();
glTranslatef(-4.8f,0.2f,-2.3f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(-170.0f,0.0f,0.0f,1.0f);
glCallList(m_ChairList);
glPopMatrix();
}
voidCCY457OpenGLView::DrawBlinds()
{
glColor3f(0.97f,0.84f,0.72f);
//DrawtheBlindsObject1
glPushMatrix();
glTranslatef(-0.8f,0.7f,-0.1f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glCallList(m_BlindsList);
glPopMatrix();
//DrawtheBlindsObject2
glPushMatrix();
glTranslatef(-1.8f,0.7f,-0.1f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glCallList(m_BlindsList);
glPopMatrix();
//DrawtheBlindsObject2
glPushMatrix();
glTranslatef(-3.8f,0.7f,-0.1f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glCallList(m_BlindsList);
glPopMatrix();
//DrawtheBlindsObject2
glPushMatrix();
glTranslatef(-4.8f,0.7f,-0.1f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glCallList(m_BlindsList);
glPopMatrix();
}
voidCCY457OpenGLView::DrawPhones()
{
//Drawthephones
glColor3f(0.49f,0.35,0.25f);
glPushMatrix();
glTranslatef(-0.25f,0.35f,-1.5f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(-90.0f,0.0f,0.0f,1.0f);
glCallList(m_PhoneList);
glPopMatrix();
}
voidCCY457OpenGLView::DrawFloorAndCeiling()
{
//DrawFloor
glEnable(GL_TEXTURE_2D);
glCullFace(GL_BACK);
glBindTexture(GL_TEXTURE_2D,m_Texture[1]);
//DrawCeiling
glBegin(GL_POLYGON);
glNormal3f(0.0f,-1.0f,0.0f);
glColor3f(1.0f,1.0f,1.0f);
glTexCoord2f(0.0f,5.0f);
glVertex3f(0.0f,1.0f,-3.0f);
glTexCoord2f(0.0f,0.0f);
glVertex3f(0.0f,1.0f,0.0f);
glTexCoord2f(5.0f,0.0f);
glVertex3f(-5.5f,1.0f,0.0f);
glTexCoord2f(5.0f,5.0f);
glVertex3f(-5.5f,1.0f,-3.0f);
glEnd();
glBindTexture(GL_TEXTURE_2D,m_Texture[0]);
glBegin(GL_POLYGON);
glNormal3f(0.0f,1.0f,0.0f);
glColor3f(1.0f,1.0f,1.0f);
glTexCoord2f(0.0f,0.0f);
glVertex3f(0.0f,0.0f,-3.0f);
glTexCoord2f(20.0f,0.0f);
glVertex3f(-5.5f,0.0f,-3.0f);
glTexCoord2f(20.0f,20.0f);
glVertex3f(-5.5f,0.0f,0.0f);
glTexCoord2f(0.0f,20.0f);
glVertex3f(0.0f,0.0f,0.0f);
glEnd();
glDisable(GL_TEXTURE_2D);
}
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->voidCCY457OpenGLView::DrawPentagonTable()
{
glBegin(GL_TRIANGLES);
//TableTop
glNormal3f(0.0f,1.0f,0.0f);
//LightBrown
glColor3f(0.7f,0.6f,0.55f);
glVertex3f(-0.75f,0.3f,-0.05f);
glVertex3f(-0.05f,0.3f,-0.05f);
glVertex3f(-0.75f,0.3f,-0.45f);
glVertex3f(-0.75f,0.3f,-0.45f);
glVertex3f(-0.05f,0.3f,-0.05f);
glVertex3f(-0.45f,0.3f,-0.75f);
glVertex3f(-0.45f,0.3f,-0.75f);
glVertex3f(-0.05f,0.3f,-0.05f);
glVertex3f(-0.05f,0.3f,-0.75f);
//TableFront
glColor3f(0.9f,0.9f,0.8f);
glVertex3f(-0.75f,0.25f,-0.45f);
glVertex3f(-0.75f,0.3f,-0.45f);
glVertex3f(-0.45f,0.3f,-0.75f);
glVertex3f(-0.75f,0.25f,-0.45f);
glVertex3f(-0.45f,0.3f,-0.75f);
glVertex3f(-0.45f,0.25f,-0.75f);
glEnd();
glDisable(GL_LIGHTING);
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
glPolygonOffset(1.0f,-3.0f);
glEnable(GL_POLYGON_OFFSET_LINE);
//FrontEdge
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-0.75f,0.25f,-0.45f);
glVertex3f(-0.75f,0.3f,-0.45f);
glVertex3f(-0.45f,0.3f,-0.75f);
glVertex3f(-0.45f,0.25f,-0.75f);
glEnd();
glEnable(GL_LIGHTING);
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
glEnable(GL_POLYGON_OFFSET_LINE);
}
voidCCY457OpenGLView::DrawWalls()
{
//DrawtheWallsforwhichFrontFacescanbeculled
//CullFrontFaces
//EnableCulling
glEnable(GL_CULL_FACE);
//CullFrontFaces
glCullFace(GL_FRONT);
glBegin(GL_TRIANGLES);
//DrawtheBackWall
//DefineBackWallNormal
glNormal3f(0.0f,0.0f,1.0f);
//DefineBackWallMaterial-LightGrey
glColor3f(0.75f,0.75f,0.75f);
//BackWallTriangles
glVertex3f(0.0f,0.0f,0.0f);
glVertex3f(0.0f,1.0f,0.0f);
glVertex3f(-5.5f,1.0f,0.0f);
glVertex3f(0.0f,0.0f,0.0f);
glVertex3f(-5.5f,1.0f,0.0f);
glVertex3f(-5.5f,0.0f,0.0f);
//BackWallThickness
glVertex3f(-0.0f,0.0f,-0.05f);
glVertex3f(-0.0f,1.0f,-0.05f);
glVertex3f(-5.5f,1.0f,-0.05f);
glVertex3f(-0.0f,0.0f,-0.05f);
glVertex3f(-5.5f,1.0f,-0.05f);
glVertex3f(-5.5f,0.0f,-0.05f);
//DrawtheRightWall
//DefineRightWallNormal
glNormal3f(1.0f,0.0f,0.0f);
//DefineRightWallMaterial-LightBrown
glColor3f(0.7f,0.6f,0.55f);
//RightWallTriangles
glVertex3f(0.0f,0.0f,-0.05f);
glVertex3f(0.0f,0.0f,-2.95f);
glVertex3f(0.0f,0.6f,-0.05f);
glVertex3f(0.0f,0.0f,-2.95f);
glVertex3f(0.0f,0.6f,-2.95f);
glVertex3f(0.0f,0.6f,-0.05f);
//RightWallThickness
glVertex3f(-0.05f,0.0f,-0.05f);
glVertex3f(-0.05f,0.0f,-2.95f);
glVertex3f(-0.05f,0.6f,-0.05f);
glVertex3f(-0.05f,0.0f,-2.95f);
glVertex3f(-0.05f,0.6f,-2.95f);
glVertex3f(-0.05f,0.6f,-0.05f);
//DrawtheLeftWall
//DefineLeftWallNormal
glNormal3f(-1.0f,0.0f,0.0f);
//LeftWallTriangles
glVertex3f(-5.5f,0.0f,-0.05f);
glVertex3f(-5.5f,1.0f,-0.05f);
glVertex3f(-5.5f,1.0f,-2.95f);
glVertex3f(-5.5f,0.0f,-0.05f);
glVertex3f(-5.5f,1.0f,-2.95f);
glVertex3f(-5.5f,0.0f,-2.95f);
//LeftWallThickness
glVertex3f(-5.45f,0.0f,-0.05f);
glVertex3f(-5.45f,1.0f,-0.05f);
glVertex3f(-5.45f,1.0f,-2.95f);
glVertex3f(-5.45f,0.0f,-0.05f);
glVertex3f(-5.45f,1.0f,-2.95f);
glVertex3f(-5.45f,0.0f,-2.95f);
glEnd();
//DrawthePillar
//CullBackFacesforPillar
glCullFace(GL_BACK);
//Right
glBegin(GL_POLYGON);
glVertex3f(-3.2f,0.0f,-1.5f);
glVertex3f(-3.2f,1.0f,-1.5f);
glVertex3f(-3.2f,1.0f,-1.0f);
glVertex3f(-3.2f,0.0f,-1.0f);
glEnd();
//Left
glBegin(GL_POLYGON);
glVertex3f(-3.7f,0.0f,-1.5f);
glVertex3f(-3.7f,0.0f,-1.0f);
glVertex3f(-3.7f,1.0f,-1.0f);
glVertex3f(-3.7f,1.0f,-1.5f);
glEnd();
//Front
glBegin(GL_POLYGON);
glVertex3f(-3.2f,0.0f,-1.5f);
glVertex3f(-3.7f,0.0f,-1.5f);
glVertex3f(-3.7f,1.0f,-1.5f);
glVertex3f(-3.2f,1.0f,-1.5f);
glEnd();
//Back
glBegin(GL_POLYGON);
glVertex3f(-3.2f,0.0f,-1.0f);
glVertex3f(-3.2f,1.0f,-1.0f);
glVertex3f(-3.7f,1.0f,-1.0f);
glVertex3f(-3.7f,0.0f,-1.0f);
glEnd();
//Drawtheedges
glColor3f(0.0f,0.0f,0.0f);
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
//Right
glBegin(GL_POLYGON);
glVertex3f(-3.2f,0.0f,-1.5f);
glVertex3f(-3.2f,1.0f,-1.5f);
glVertex3f(-3.2f,1.0f,-1.0f);
glVertex3f(-3.2f,0.0f,-1.0f);
glEnd();
//Left
glBegin(GL_POLYGON);
glVertex3f(-3.7f,0.0f,-1.5f);
glVertex3f(-3.7f,0.0f,-1.0f);
glVertex3f(-3.7f,1.0f,-1.0f);
glVertex3f(-3.7f,1.0f,-1.5f);
glEnd();
//Front
glBegin(GL_POLYGON);
glVertex3f(-3.2f,0.0f,-1.5f);
glVertex3f(-3.7f,0.0f,-1.5f);
glVertex3f(-3.7f,1.0f,-1.5f);
glVertex3f(-3.2f,1.0f,-1.5f);
glEnd();
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
glColor3f(0.7f,0.6f,0.55f);
//DrawthewallsforwhichNofacescanbeculled
glDisable(GL_CULL_FACE);
glBegin(GL_TRIANGLES);
//DrawtheFrontRightWall
//DefineFrontRightWallNormal
glNormal3f(0.0f,0.0f,-1.0f);
//FrontRightWallTriangles
glVertex3f(0.0f,0.0f,-3.0f);
glVertex3f(-3.5f,0.0f,-3.0f);
glVertex3f(0.0f,0.6f,-3.0f);
glVertex3f(-3.5f,0.0f,-3.0f);
glVertex3f(-3.5f,0.6f,-3.0f);
glVertex3f(0.0f,0.6f,-3.0f);
//FrontRightWallThickness
glVertex3f(0.0f,0.0f,-2.95f);
glVertex3f(-3.5f,0.0f,-2.95f);
glVertex3f(0.0f,0.6f,-2.95f);
glVertex3f(-3.5f,0.0f,-2.95f);
glVertex3f(-3.5f,0.6f,-2.95f);
glVertex3f(0.0f,0.6f,-2.95f);
//DrawtheFrontLeftWall
//FrontLeftWallTriangles
glVertex3f(-4.0f,0.0f,-3.0f);
glVertex3f(-5.5f,0.0f,-3.0f);
glVertex3f(-4.0f,0.6f,-3.0f);
glVertex3f(-5.5f,0.0f,-3.0f);
glVertex3f(-5.5f,0.6f,-3.0f);
glVertex3f(-4.0f,0.6f,-3.0f);
//FrontLeftWallThickness
glVertex3f(-4.0f,0.0f,-2.95f);
glVertex3f(-5.5f,0.0f,-2.95f);
glVertex3f(-4.0f,0.6f,-2.95f);
glVertex3f(-5.5f,0.0f,-2.95f);
glVertex3f(-5.5f,0.6f,-2.95f);
glVertex3f(-4.0f,0.6f,-2.95f);
glEnd();
}
voidCCY457OpenGLView::DrawWallTopsAndSides()
{
//CullBackFaces
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glBegin(GL_TRIANGLES);
//DefineNormals
glNormal3f(0.0f,1.0f,0.0f);
//DefineMaterial-LightBrown
glColor3f(0.7f,0.6f,0.55f);
//BackWallTop
glVertex3f(0.0f,1.0f,0.0f);
glVertex3f(0.0f,1.0f,-0.05f);
glVertex3f(-5.5f,1.0f,0.0f);
glVertex3f(0.0f,1.0f,-0.05f);
glVertex3f(-5.5f,1.0f,-0.05f);
glVertex3f(-5.5f,1.0f,0.0f);
//RightWallTop
glVertex3f(0.0f,0.6f,-0.05f);
glVertex3f(-0.05f,0.6f,-2.95f);
glVertex3f(-0.05f,0.6f,-0.05f);
glVertex3f(0.0f,0.6f,-0.05f);
glVertex3f(0.0f,0.6f,-2.95f);
glVertex3f(-0.05f,0.6f,-2.95f);
//LeftWallTop
glVertex3f(-5.45f,1.0f,-0.05f);
glVertex3f(-5.5f,1.0f,-2.95f);
glVertex3f(-5.5f,1.0f,-0.05f);
glVertex3f(-5.45f,1.0f,-0.05f);
glVertex3f(-5.45f,1.0f,-2.95f);
glVertex3f(-5.5f,1.0f,-2.95f);
//LeftWallSide
glNormal3f(0.0f,0.0f,-1.0f);
glVertex3f(-5.45f,1.0f,-2.95f);
glVertex3f(-5.5f,0.0f,-2.95f);
glVertex3f(-5.5f,1.0f,-2.95f);
glVertex3f(-5.45f,1.0f,-2.95f);
glVertex3f(-5.45f,0.0f,-2.95f);
glVertex3f(-5.5f,0.0f,-2.95f);
//FrontRightWallTop
glVertex3f(0.0f,0.6f,-2.95f);
glVertex3f(0.0f,0.6f,-3.0f);
glVertex3f(-3.5f,0.6f,-2.95f);
glVertex3f(0.0f,0.6f,-3.0f);
glVertex3f(-3.5f,0.6,-3.0f);
glVertex3f(-3.5f,0.6f,-2.95f);
//FrontLeftWallTop
glVertex3f(-4.0f,0.6,-2.95f);
glVertex3f(-4.0f,0.6f,-3.0f);
glVertex3f(-5.5f,0.6f,-2.95f);
glVertex3f(-4.0f,0.6f,-3.0f);
glVertex3f(-5.5f,0.6,-3.0f);
glVertex3f(-5.5f,0.6f,-2.95f);
//FrontRightWallLeftSide
glNormal3f(-1.0f,0.0f,0.0f);
glVertex3f(-3.5f,0.6f,-2.95f);
glVertex3f(-3.5f,0.6f,-3.0f);
glVertex3f(-3.5f,0.0f,-2.95f);
glVertex3f(-3.5f,0.6f,-3.0f);
glVertex3f(-3.5f,0.0f,-3.0f);
glVertex3f(-3.5f,0.0f,-2.95f);
//FrontRightWallRightSide
glNormal3f(1.0f,0.0f,0.0f);
glVertex3f(0.0f,0.0f,-3.0f);
glVertex3f(0.0f,0.6f,-2.95f);
glVertex3f(0.0f,0.0f,-2.95f);
glVertex3f(0.0f,0.0f,-3.0f);
glVertex3f(0.0f,0.6f,-3.0f);
glVertex3f(0.0f,0.6f,-2.95f);
//FrontLeftWallSide
glNormal3f(1.0f,0.0f,0.0f);
glVertex3f(-4.0f,0.6f,-3.0f);
glVertex3f(-4.0f,0.6f,-2.95f);
glVertex3f(-4.0f,0.0f,-3.0f);
glVertex3f(-4.0f,0.6f,-2.95f);
glVertex3f(-4.0f,0.0f,-2.95f);
glVertex3f(-4.0f,0.0f,-3.0f);
}
voidCCY457OpenGLView::DrawDesks()
{
//Desks
//DrawtheFrontLongDesk
glNormal3f(0.0f,1.0f,0.0f);
//Brown
glColor3f(0.7f,0.6f,0.55f);
glVertex3f(-3.5f,0.3f,-2.55f);
glVertex3f(-0.75f,0.3f,-2.55f);
glVertex3f(-3.5f,0.3f,-2.95f);
glVertex3f(-3.5f,0.3f,-2.95f);
glVertex3f(-0.75f,0.3f,-2.55f);
glVertex3f(-0.75f,0.3f,-2.95f);
//DrawtheFrontLongDeskThickness
glVertex3f(-3.5f,0.25f,-2.55f);
glVertex3f(-0.75f,0.25f,-2.55f);
glVertex3f(-3.5f,0.25f,-2.95f);
glVertex3f(-3.5f,0.25f,-2.95f);
glVertex3f(-0.75f,0.25f,-2.55f);
glVertex3f(-0.75f,0.25f,-2.95f);
//DrawtheFrontLongDeskFront
glNormal3f(0.0f,0.0f,1.0f);
glColor3f(0.9f,0.9f,0.8f);
glVertex3f(-0.75f,0.25f,-2.55f);
glVertex3f(-0.75f,0.3f,-2.55f);
glVertex3f(-3.5f,0.25f,-2.55f);
glVertex3f(-3.5f,0.25f,-2.55f);
glVertex3f(-0.75f,0.3f,-2.55f);
glVertex3f(-3.5f,0.3f,-2.55f);
//DrawtheFrontLongDeskSide
glNormal3f(-1.0f,0.0f,0.0f);
glVertex3f(-3.5f,0.25f,-2.55f);
glVertex3f(-3.5f,0.3f,-2.55f);
glVertex3f(-3.5f,0.25f,-2.95f);
glVertex3f(-3.5f,0.25f,-2.95f);
glVertex3f(-3.5f,0.3f,-2.55f);
glVertex3f(-3.5f,0.3f,-2.95f);
//DrawtheFrontShortDesk
glNormal3f(0.0f,1.0f,0.0f);
glColor3f(0.7f,0.6f,0.55f);
glVertex3f(-4.75f,0.3f,-2.55f);
glVertex3f(-4.0f,0.3f,-2.55f);
glVertex3f(-4.75f,0.3f,-2.95f);
glVertex3f(-4.75f,0.3f,-2.95f);
glVertex3f(-4.0f,0.3f,-2.55f);
glVertex3f(-4.0f,0.3f,-2.95f);
//DrawtheFrontShortDeskThickness
glVertex3f(-4.75f,0.25f,-2.55f);
glVertex3f(-4.0f,0.25f,-2.55f);
glVertex3f(-4.75f,0.25f,-2.95f);
glVertex3f(-4.75f,0.25f,-2.95f);
glVertex3f(-4.0f,0.25f,-2.55f);
glVertex3f(-4.0f,0.25f,-2.95f);
//DrawtheFrontShortDeskFrontThickness
glNormal3f(0.0f,0.0f,1.0f);
glColor3f(0.9f,0.9f,0.8f);
glVertex3f(-4.0f,0.25f,-2.55f);
glVertex3f(-4.0f,0.3f,-2.55f);
glVertex3f(-4.75f,0.3f,-2.55f);
glVertex3f(-4.0f,0.25f,-2.55f);
glVertex3f(-4.75f,0.3f,-2.55f);
glVertex3f(-4.75f,0.25f,-2.55f);
//DrawtheFrontShortDeskSideThickness
glNormal3f(1.0f,0.0f,0.0f);
glColor3f(0.9f,0.9f,0.8f);
glVertex3f(-4.0f,0.25f,-2.95f);
glVertex3f(-4.0f,0.3f,-2.95f);
glVertex3f(-4.0f,0.3f,-2.55f);
glVertex3f(-4.0f,0.25f,-2.95f);
glVertex3f(-4.0f,0.3f,-2.55f);
glVertex3f(-4.0f,0.25f,-2.55f);
//DrawtheRightMiddleDesk
glNormal3f(0.0f,1.0f,0.0f);
glColor3f(0.7f,0.6f,0.55f);
glVertex3f(-0.45f,0.3f,-0.75f);
glVertex3f(-0.05f,0.3f,-0.75f);
glVertex3f(-0.45f,0.3f,-2.25f);
glVertex3f(-0.45f,0.3f,-2.25f);
glVertex3f(-0.05f,0.3f,-0.75f);
glVertex3f(-0.05f,0.3f,-2.25f);
//DrawtheRightMiddleDeskThickness
glVertex3f(-0.45f,0.25f,-0.75f);
glVertex3f(-0.05f,0.25f,-0.75f);
glVertex3f(-0.45f,0.25f,-2.25f);
glVertex3f(-0.45f,0.25f,-2.25f);
glVertex3f(-0.05f,0.25f,-0.75f);
glVertex3f(-0.05f,0.25f,-2.25f);
//DrawtheRightMiddleDeskFront
glNormal3f(-1.0f,0.0f,0.0f);
glColor3f(0.9f,0.9f,0.8f);
glVertex3f(-0.45f,0.25f,-0.75f);
glVertex3f(-0.45f,0.3f,-0.75f);
glVertex3f(-0.45f,0.25f,-2.25f);
glVertex3f(-0.45f,0.25f,-2.25f);
glVertex3f(-0.45f,0.3f,-0.75f);
glVertex3f(-0.45f,0.3f,-2.25f);
//DrawtheLeftMiddleDesk
glNormal3f(0.0f,1.0f,0.0f);
glColor3f(0.7f,0.6f,0.55f);
glVertex3f(-5.45f,0.3f,-1.15f);
glVertex3f(-5.05f,0.3f,-1.15f);
glVertex3f(-5.45f,0.3f,-2.25f);
glVertex3f(-5.45f,0.3f,-2.25f);
glVertex3f(-5.05f,0.3f,-1.15f);
glVertex3f(-5.05f,0.3f,-2.25f);
//DrawtheLeftMiddleDeskThickness
glVertex3f(-5.45f,0.25f,-1.15f);
glVertex3f(-5.05f,0.25f,-1.15f);
glVertex3f(-5.45f,0.25f,-2.25f);
glVertex3f(-5.45f,0.25f,-2.25f);
glVertex3f(-5.05f,0.25f,-1.15f);
glVertex3f(-5.05f,0.25f,-2.25f);
//DrawtheLeftMiddleDeskFrontPortion
glNormal3f(1.0f,0.0f,0.0f);
glColor3f(0.9f,0.9f,0.8f);
glVertex3f(-5.05f,0.25f,-1.15f);
glVertex3f(-5.05f,0.3f,-2.25f);
glVertex3f(-5.05f,0.3f,-1.15f);
glVertex3f(-5.05f,0.25f,-1.15f);
glVertex3f(-5.05f,0.25f,-2.25f);
glVertex3f(-5.05f,0.3f,-2.25f);
//DrawtheBackWallDesk
glNormal3f(0.0f,1.0f,0.0f);
glColor3f(0.7f,0.6f,0.55f);
glVertex3f(-5.45f,0.3f,-0.05f);
glVertex3f(-0.75f,0.3f,-0.05f);
glVertex3f(-5.45f,0.3f,-0.45f);
glVertex3f(-5.45f,0.3f,-0.45f);
glVertex3f(-0.75f,0.3f,-0.05f);
glVertex3f(-0.75f,0.3f,-0.45f);
//DrawtheBackWallDeskThickness
glVertex3f(-5.45f,0.25f,-0.05f);
glVertex3f(-0.75f,0.25f,-0.05f);
glVertex3f(-5.45f,0.25f,-0.45f);
glVertex3f(-5.45f,0.25f,-0.45f);
glVertex3f(-0.75f,0.25f,-0.05f);
glVertex3f(-0.75f,0.25f,-0.45f);
//DrawtheBackWallDeskFrontThickness
glNormal3f(0.0f,0.0f,-1.0f);
glColor3f(0.9f,0.9f,0.8f);
glVertex3f(-0.75f,0.25f,-0.45f);
glVertex3f(-5.45f,0.25f,-0.45f);
glVertex3f(-5.45f,0.3f,-0.45f);
glVertex3f(-0.75f,0.25f,-0.45f);
glVertex3f(-5.45f,0.3f,-0.45f);
glVertex3f(-0.75f,0.3f,-0.45f);
glEnd();
//DeskFrontandSideEdges
glDisable(GL_LIGHTING);
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
glPolygonOffset(1.0f,-3.0f);
glEnable(GL_POLYGON_OFFSET_LINE);
glEnable(GL_POLYGON_SMOOTH);
//FrontDeskFront
glBegin(GL_POLYGON);
glNormal3f(0.0f,0.0f,1.0f);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-0.75f,0.25f,-2.55f);
glVertex3f(-0.75f,0.3f,-2.55f);
glVertex3f(-3.5f,0.3f,-2.55f);
glVertex3f(-3.5f,0.25f,-2.55);
glEnd();
//FrontDeskSide
glBegin(GL_POLYGON);
glNormal3f(-1.0f,0.0f,0.0f);
glVertex3f(-3.5f,0.25f,-2.55f);
glVertex3f(-3.5f,0.3f,-2.55f);
glVertex3f(-3.5f,0.3f,-2.95f);
glVertex3f(-3.5f,0.25f,-2.95f);
glEnd();
//RightDeskFront
glBegin(GL_POLYGON);
glNormal3f(-1.0f,0.0f,0.0f);
glVertex3f(-0.45f,0.25f,-0.75f);
glVertex3f(-0.45f,0.3f,-0.75f);
glVertex3f(-0.45f,0.3f,-2.25f);
glVertex3f(-0.45f,0.25f,-2.25f);
glEnd();
//DrawtheFrontShortDeskFrontThickness
glBegin(GL_POLYGON);
glNormal3f(0.0f,0.0f,1.0f);
glVertex3f(-4.0f,0.25f,-2.55f);
glVertex3f(-4.0f,0.3f,-2.55f);
glVertex3f(-4.75f,0.3f,-2.55f);
glVertex3f(-4.75f,0.25f,-2.55f);
glEnd();
//DrawtheFrontShortDeskSideThickness
glBegin(GL_POLYGON);
glNormal3f(1.0f,0.0f,0.0f);
glVertex3f(-4.0f,0.25f,-2.95f);
glVertex3f(-4.0f,0.3f,-2.95f);
glVertex3f(-4.0f,0.3f,-2.55f);
glVertex3f(-4.0f,0.25f,-2.55f);
glEnd();
//DrawtheLeftMiddleDeskFrontPortion
glBegin(GL_POLYGON);
glNormal3f(1.0f,0.0f,0.0f);
glVertex3f(-5.05f,0.25f,-2.25f);
glVertex3f(-5.05f,0.3f,-2.25f);
glVertex3f(-5.05f,0.3f,-1.15f);
glVertex3f(-5.05f,0.25f,-1.15f);
glEnd();
//Drawtheback
glBegin(GL_POLYGON);
glNormal3f(0.0f,0.0f,-1.0f);
glVertex3f(-0.75f,0.25f,-0.45f);
glVertex3f(-5.45f,0.25f,-0.45f);
glVertex3f(-5.45f,0.3f,-0.45f);
glVertex3f(-0.75f,0.3f,-0.45f);
glEnd();
glDisable(GL_POLYGON_OFFSET_LINE);
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
glEnable(GL_LIGHTING);
glDisable(GL_POLYGON_SMOOTH);
//ComputerTables
//DrawtheBackComputerTable
DrawPentagonTable();
//DrawtheFrontRightComputerTable
glPushMatrix();
glTranslatef(0.0f,0.0f,-3.00f);
glRotatef(90.0f,0.0f,1.0f,0.0f);
DrawPentagonTable();
glPopMatrix();
//DrawtheFrontLeftComputerTable
glPushMatrix();
glTranslatef(-5.5,0.0f,-3.0f);
glRotatef(180.0f,0.0f,1.0f,0.0f);
DrawPentagonTable();
glPopMatrix();
}
voidCCY457OpenGLView::DrawComputers()
{
//Computers
//DrawtheBackLeftCornerComputer
//SetColortoLightGrey
glColor3f(0.35,0.35f,0.35f);
glPushMatrix();
glTranslatef(-0.5f,0.42f,-0.4f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(-145.0f,0.0f,0.0f,1.0f);
glCallList(m_ComputerList);
glPopMatrix();
glPushMatrix();
glTranslatef(-2.0f,0.42f,-0.25f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(180.0f,0.0f,0.0f,1.0f);
glCallList(m_ComputerList);
glPopMatrix();
glPushMatrix();
glTranslatef(-3.5f,0.42f,-0.25f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(180.0f,0.0f,0.0f,1.0f);
glCallList(m_ComputerList);
glPopMatrix();
//FrontLeftComputer1
glPushMatrix();
glTranslatef(-0.5f,0.42f,-2.6f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(-45.0f,0.0f,0.0f,1.0f);
glCallList(m_ComputerList);
glPopMatrix();
//FrontLeftComputer2
glPushMatrix();
glTranslatef(-2.0f,0.42f,-2.75f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glCallList(m_ComputerList);
glPopMatrix();
//FrontRight
glPushMatrix();
glTranslatef(-5.1f,0.42f,-2.6);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(45.0f,0.0f,0.0f,1.0f);
glCallList(m_ComputerList);
glPopMatrix();
}
voidCCY457OpenGLView::DrawChairs()
{
glColor3f(0.28f,0.21f,0.0f);
//BackLeftChair
glPushMatrix();
glTranslatef(-0.7f,0.2f,-0.7f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(10.0f,0.0f,0.0f,1.0f);
glCallList(m_ChairList);
glPopMatrix();
//BackRight1
glPushMatrix();
glTranslatef(-2.0f,0.2f,-0.7f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(-30.0f,0.0f,0.0f,1.0f);
glCallList(m_ChairList);
glPopMatrix();
//BackRight2
glPushMatrix();
glTranslatef(-3.5f,0.2f,-0.7f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(-30.0f,0.0f,0.0f,1.0f);
glCallList(m_ChairList);
glPopMatrix();
//FrontLeft1
glPushMatrix();
glTranslatef(-0.7f,0.2f,-2.3f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(110.0f,0.0f,0.0f,1.0f);
glCallList(m_ChairList);
glPopMatrix();
//FrontLeft2
glPushMatrix();
glTranslatef(-2.0f,0.2f,-2.3f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(150.0f,0.0f,0.0f,1.0f);
glCallList(m_ChairList);
glPopMatrix();
//FrontRight
glPushMatrix();
glTranslatef(-4.8f,0.2f,-2.3f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(-170.0f,0.0f,0.0f,1.0f);
glCallList(m_ChairList);
glPopMatrix();
}
voidCCY457OpenGLView::DrawBlinds()
{
glColor3f(0.97f,0.84f,0.72f);
//DrawtheBlindsObject1
glPushMatrix();
glTranslatef(-0.8f,0.7f,-0.1f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glCallList(m_BlindsList);
glPopMatrix();
//DrawtheBlindsObject2
glPushMatrix();
glTranslatef(-1.8f,0.7f,-0.1f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glCallList(m_BlindsList);
glPopMatrix();
//DrawtheBlindsObject2
glPushMatrix();
glTranslatef(-3.8f,0.7f,-0.1f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glCallList(m_BlindsList);
glPopMatrix();
//DrawtheBlindsObject2
glPushMatrix();
glTranslatef(-4.8f,0.7f,-0.1f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glCallList(m_BlindsList);
glPopMatrix();
}
voidCCY457OpenGLView::DrawPhones()
{
//Drawthephones
glColor3f(0.49f,0.35,0.25f);
glPushMatrix();
glTranslatef(-0.25f,0.35f,-1.5f);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(-90.0f,0.0f,0.0f,1.0f);
glCallList(m_PhoneList);
glPopMatrix();
}
voidCCY457OpenGLView::DrawFloorAndCeiling()
{
//DrawFloor
glEnable(GL_TEXTURE_2D);
glCullFace(GL_BACK);
glBindTexture(GL_TEXTURE_2D,m_Texture[1]);
//DrawCeiling
glBegin(GL_POLYGON);
glNormal3f(0.0f,-1.0f,0.0f);
glColor3f(1.0f,1.0f,1.0f);
glTexCoord2f(0.0f,5.0f);
glVertex3f(0.0f,1.0f,-3.0f);
glTexCoord2f(0.0f,0.0f);
glVertex3f(0.0f,1.0f,0.0f);
glTexCoord2f(5.0f,0.0f);
glVertex3f(-5.5f,1.0f,0.0f);
glTexCoord2f(5.0f,5.0f);
glVertex3f(-5.5f,1.0f,-3.0f);
glEnd();
glBindTexture(GL_TEXTURE_2D,m_Texture[0]);
glBegin(GL_POLYGON);
glNormal3f(0.0f,1.0f,0.0f);
glColor3f(1.0f,1.0f,1.0f);
glTexCoord2f(0.0f,0.0f);
glVertex3f(0.0f,0.0f,-3.0f);
glTexCoord2f(20.0f,0.0f);
glVertex3f(-5.5f,0.0f,-3.0f);
glTexCoord2f(20.0f,20.0f);
glVertex3f(-5.5f,0.0f,0.0f);
glTexCoord2f(0.0f,20.0f);
glVertex3f(0.0f,0.0f,0.0f);
glEnd();
glDisable(GL_TEXTURE_2D);
}
相关推荐
基于MFC的OpenGL编程part5源码
基于MFC的OpenGL编程part6源码
基于MFC的OpenGL编程part3源码
基于MFC的OpenGL编程part7的源码 出处:http://phinecos.cnblogs.com/ 代码被我修改过,可以调试出来。原文中的一些细节地方重新注释了一下,方便理解。 很多地方被我修改过,但是大致的内容不会发生变化。 我自己...
基于MFC的OpenGL编程part4源码
基于MFC的OpenGL编程Part10源码 作者:洞庭散人 出处:http://phinecos.cnblogs.com/
基于MFC的OpenGL编程part2
基于MFC的OpenGL编程 基于MFC的OpenGL编程 基于MFC的OpenGL编程 基于MFC的OpenGL编程 基于MFC的OpenGL编程
基于MFC的OpenGL编程part8源码 洞庭散人的博客源码
基于MFC的OpenGL编程Part9源码 作者:洞庭散人 出处:http://phinecos.cnblogs.com/
使用单文档视图框架,解决拖动时产生的抖动问题
《基于MFC的OpenGL编程》Part 7 Colors的源码
C++ openGL库文件,有普通的openGL库资源,主要是基于MFC编程的库文件
本程序是基于基于MFC和OPENGL的编程,希望对大家的学习会有帮助。
对于OpenGL的应用,常常是基于GDI接口来实现的。在Windows下做开发,自然 就需要了解OpenGL在MFC下的开发,本工程是MFC下OpenGL开发的一个简单实例。
基于MFC的OpenGL编程.pdf
如何在VC++中用MFC进行OpenGL编程