MFC+OpenGL三维建模与动画显示


A OpenGL program developed in MFC IDE,which realized the 3D modeling and animation display of complex objects and also achieved a wonderful management of the objects' motion state using menu ,mouse and keyboard.The program is of great synthese as the technology of it refers to comtemporary c++ programing,MFC programing and OpenGL programing. MFC环境下的OpenGL编程,用于实现复杂物体的三维建模和动画显示,并实现了非常全面的菜单、鼠标、键盘功能控制,管理物体的运动状态,涉及现代C++编程技术、MFC编程技术和OpenGL编程,综合性很强
资源截图
代码片段和文件信息
// Bottle.cpp: implementation of the CBottle class.
//
//////////////////////////////////////////////////////////////////////

#include “stdafx.h“
#include “WaterBottle.h“
#include “Bottle.h“

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CBottle::CBottle()
{

}

CBottle::CBottle(float cneterxfloat centeryfloat centerz)
{
m_vcenter.coord[0]=cneterx;
m_vcenter.coord[1]=centery;
m_vcenter.coord[2]=centerz;
}

void CBottle::Create(float cneterxfloat centeryfloat centerz)
{
m_vcenter.coord[0]=cneterx;
m_vcenter.coord[1]=centery;
m_vcenter.coord[2]=centerz;
}

void CBottle::GetOutData(vector & vec_shape)
{
CFileDialog MyFileDlg(trueNULLNULL1“文本文件(*.txt)|*.txt“);
if(MyFileDlg.DoModal()==IDOK)
{
vec_shape.clear();
CString strstrFilenm=MyFileDlg.GetFileName();
int data;
int k=0;    //k记录已读取的数据的数目
char ch; 
try{
CFile thefile(strFilenmCFile::modeRead);
while(thefile.Read(&ch1))
{
if (ch>=‘0‘ && ch<=‘9‘)
str.Insert(str.GetLength()ch);
else if(!str.IsEmpty())
{
//已读取了k个数
k++;
if(k%3!=1)
{
if(k%3==2)    //读入X,以后用作半径
data=atoi(str);
else
{
listnode p;
p.radiu=data;
data=atoi(str);
p.z=data;
vec_shape.push_back(p);
}
}
str.Empty();
}
}
float r_begin=vec_shape.begin()->radiu;
m_fhight=(vec_shape.end()-1)->z-vec_shape.begin()->z;
thefile.Close();
}
catch(CFileException *)
{
MessageBox(NULL“Can‘t open the file““提示“1);
}

}
return;

}

CBottle::~CBottle()
{

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1910  2011-05-13 03:48  MFC版本 - 副本Bottle.cpp

     文件        917  2011-05-13 02:57  MFC版本 - 副本Bottle.h

     文件        550  2011-05-07 22:09  MFC版本 - 副本ottle.txt

     文件         49  2011-05-13 20:23  MFC版本 - 副本ow.txt

     文件       1577  2011-05-13 01:45  MFC版本 - 副本Circle.cpp

     文件       1176  2011-05-13 01:45  MFC版本 - 副本Circle.h

     文件      42177  2011-05-13 21:05  MFC版本 - 副本DebugBottle.obj

     文件          0  2011-05-13 21:05  MFC版本 - 副本DebugBottle.sbr

     文件      33788  2011-05-13 21:05  MFC版本 - 副本DebugCircle.obj

     文件          0  2011-05-13 21:05  MFC版本 - 副本DebugCircle.sbr

     文件      19949  2011-05-13 21:05  MFC版本 - 副本DebugMainFrm.obj

     文件          0  2011-05-13 21:05  MFC版本 - 副本DebugMainFrm.sbr

     文件     105660  2011-05-13 21:05  MFC版本 - 副本DebugStdAfx.obj

     文件    1374980  2011-05-13 21:05  MFC版本 - 副本DebugStdAfx.sbr

     文件     271360  2011-05-13 21:06  MFC版本 - 副本Debugvc60.idb

     文件     462848  2011-05-13 21:05  MFC版本 - 副本Debugvc60.pdb

     文件    3523584  2011-05-13 21:05  MFC版本 - 副本DebugWaterBottle.bsc

     文件     151627  2011-05-13 21:05  MFC版本 - 副本DebugWaterBottle.exe

     文件     413544  2011-05-13 21:05  MFC版本 - 副本DebugWaterBottle.ilk

     文件      36930  2011-05-13 21:05  MFC版本 - 副本DebugWaterBottle.obj

     文件    6869072  2011-05-13 21:05  MFC版本 - 副本DebugWaterBottle.pch

     文件     427008  2011-05-13 21:05  MFC版本 - 副本DebugWaterBottle.pdb

     文件       7692  2011-05-13 21:05  MFC版本 - 副本DebugWaterBottle.res

     文件          0  2011-05-13 21:05  MFC版本 - 副本DebugWaterBottle.sbr

     文件      15219  2011-05-13 21:05  MFC版本 - 副本DebugWaterBottleDoc.obj

     文件          0  2011-05-13 21:05  MFC版本 - 副本DebugWaterBottleDoc.sbr

     文件      98252  2011-05-13 21:05  MFC版本 - 副本DebugWaterBottleView.obj

     文件          0  2011-05-13 21:05  MFC版本 - 副本DebugWaterBottleView.sbr

     文件      58880  2011-05-13 22:29  MFC版本 - 副本Important_How to use the Program.doc

     文件       2378  2011-05-13 10:31  MFC版本 - 副本MainFrm.cpp

............此处省略30个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)