二维图像三维显示

所属分类:OpenGL
开发工具:Visual C++
文件大小:104KB
下载次数:2045
上传日期:2005-08-02 22:44:01
上 传 者zhiwen79
说明:  本人为了图像处理的需要,很想实现二维图像的三维显示,于是写了本代码,希望与此有兴趣的读者共享。图像的获取一是bmp图像文件,二是来自剪贴板。本代码在MFC中调用OpenGL库函数来实现二维图像的三维显示,图像的宽度、高度和象素的亮度分别为三维空间的x,z,y坐标。程序主要有初始化、绘图、资源释放和操作部分,这些功能在OGL_MFCView.cpp文件中实现。OpenGL库的初始化在该文件中的OnCreate,InitScene和DrawScene函数中实现,主要初始化OpenGL运行时的环境变量,三维物体的光照,材质等,由于介绍OpenGL库的初始化的文档很多,在这里我就不多说了,感兴趣的读者可以参考有关的文档。在DrawScene函数中调用全局函数GLDraw3DBMP完成绘图部分。 编译源代码时,必须把opengl32.lib glu32.lib链到工程中。 可以通过对话框改变材质。按上下箭头键可以实现三维图像的绕x轴旋转,按左右箭头键可以实现三维图像绕z轴旋转。 本代码在Windows2000下编译通过。
(image processing to the needs and would like to achieve th ree-dimensional two-dimensional images, then wrote the code, with the readers are interested in sharing. Image Access First bmp image files, two from the clipboard. The MFC code Calling OpenGL library functions to achieve the three-dimensional two-dimensional image display, image width, height and pixel brightness of the three-dimensional space x, z, y coordinates. Main initialization procedures, mapping, the release of resources and operation, the function of these documents OGL_MFCView.cpp achieve. OpenGL library initialization of the documents, the OnCreate, InitScene DrawScene function and the realization of the main initialization OpenGL runtime environment variables, 3D objects light, material, and as such introduced OpenG)

文件列表:
OGL_MFC.clw (3067, 2004-01-06)
Bmpfile.h (1534, 2003-05-30)
MainFrm.h (1581, 2003-10-31)
OGL_MFC.h (1367, 2004-01-05)
OGL_MFCDoc.h (1486, 2003-10-31)
OGL_MFCView.h (2497, 2004-01-05)
resource.h (1100, 2004-01-05)
SelectColorDlg.h (1590, 2003-10-31)
StdAfx.h (1118, 2004-01-05)
UrlLink.h (2848, 2002-12-04)
Bmpfile.cpp (17289, 2003-06-28)
MainFrm.cpp (2512, 2004-01-05)
OGL_MFC.cpp (4664, 2004-01-05)
OGL_MFCDoc.cpp (1762, 2003-10-31)
OGL_MFCView.cpp (12707, 2004-01-05)
SelectColorDlg.cpp (2526, 2003-11-01)
StdAfx.cpp (209, 2003-10-31)
UrlLink.cpp (11656, 2002-12-04)
res (0, 2003-12-20)
res\OGL_MFC.rc2 (399, 2003-10-31)
res\OGL_MFCDoc.ico (1078, 2003-10-31)
res\OGL_MFC.ico (1078, 2003-10-31)
res\Toolbar.bmp (1078, 2003-10-31)
OGL_MFC.plg (976, 2004-01-06)
OGL_MFC.opt (201728, 2004-01-06)
OGL_MFC.dsp (5096, 2004-01-06)
OGL_MFC.dsw (537, 2003-10-31)
OGL_MFC.rc (12463, 2004-01-06)
ThreeDBMP.exe (49152, 2004-01-06)

近期下载者

相关文件


收藏者