Introduction - If you have any usage issues, please Google them yourself
I want to realize the 3d display of 2d images for the sake of image processing, so I have written this code and I hope to share it with interested readers. The image is obtained from the BMP image file, and the second is from the clipboard. This code calls the OpenGL library function in the MFC to realize the three-dimensional display of the two-dimensional image, the width of the image, the height of the image and the brightness of the pixel are respectively the x,z and y coordinates of the three-dimensional space. The program mainly has initialization, mapping, resource release, and operation parts, which are implemented in ogl_mfcview.cpp files. OpenGL library initialization in the file OnCreate, InitScene and DrawScene function implementation, main initialize OpenGL runtime environment variables, illumination of the 3-d objects, materials, etc., due to a lot of document introduces OpenGL library initialization, here I am not much said, interested readers can refer to the relevant documents. Call the global function GLDraw3DBMP to complete the drawing part in the DrawScene function.
When you compile the source code, you must link the opengl32.lib glu32. Lib to the project.
You can change the material through the dialog box. Press the arrow keys to rotate the x axis of the 3d image, and the right and left arrow keys can be used to rotate the z-axis around the z-axis.
Packet : 7346266620052111201507.rar filelist
20052111201507\OGL_MFC.clw
20052111201507\Bmpfile.h
20052111201507\MainFrm.h
20052111201507\OGL_MFC.h
20052111201507\OGL_MFCDoc.h
20052111201507\OGL_MFCView.h
20052111201507\resource.h
20052111201507\SelectColorDlg.h
20052111201507\StdAfx.h
20052111201507\UrlLink.h
20052111201507\Bmpfile.cpp
20052111201507\MainFrm.cpp
20052111201507\OGL_MFC.cpp
20052111201507\OGL_MFCDoc.cpp
20052111201507\OGL_MFCView.cpp
20052111201507\SelectColorDlg.cpp
20052111201507\StdAfx.cpp
20052111201507\UrlLink.cpp
20052111201507\res\OGL_MFC.rc2
20052111201507\res\OGL_MFCDoc.ico
20052111201507\res\OGL_MFC.ico
20052111201507\res\Toolbar.bmp
20052111201507\res\『源码天空』.url
20052111201507\res\免费『商业源码』.url
20052111201507\res\使用说明.txt
20052111201507\res
20052111201507\OGL_MFC.plg
20052111201507\OGL_MFC.opt
20052111201507\OGL_MFC.dsp
20052111201507\OGL_MFC.dsw
20052111201507\OGL_MFC.rc
20052111201507\ReadMe.txt
20052111201507\ThreeDBMP.exe
20052111201507\『源码天空』.url
20052111201507\免费『商业源码』.url
20052111201507\使用说明.txt
20052111201507