資源簡介
可以用VS2010運行,加載OpenGL,讀取obj模型,并加載多幅紋理。
代碼片段和文件信息
#if?1
#include?
#include?
#include?“MainWnd.h“
#include?
#include?“atltypes.h“
CMainWnd?*?pCMainWnd?=?NULL;
void?display(void)
{
????pCMainWnd->DrawScene();
}
void?spinDisplay(int?)
{
????pCMainWnd->m_fAngleY+=0.1;
????glutPostRedisplay();
}
void?reshape(int?w?int?h)
{???
????pCMainWnd->reshape(w?h);
????glutPostRedisplay();
}
void?mouse(int?button?int?state?int?x?int?y)
{
????//printf(“b:%d?s:%d\n“?button?state);
????pCMainWnd->DrawScene();
????switch?(button){
????????//?鼠標事件捕獲,進行交互
????case?GLUT_LEFT_BUTTON:
????????if?(state?==?GLUT_DOWN)
????????{
????????????pCMainWnd->SetPoint(POINT2(x?y)?true);
????????}
????????break;
????case?3:
????????pCMainWnd->AddYU(-1);
????????break;
????case?4:
????????pCMainWnd->AddYU(1);
????????break;
????case?GLUT_RIGHT_BUTTON:
????????if?(state?==?GLUT_DOWN)
????????{
????????????//glutIdleFunc(spinDisplay);???????????
????????????pCMainWnd->SetPoint(POINT2(x?y)?false);
????????}
????????????
????????break;
????default:
????????break;
????}
}
void?mouseMove(int?x?int?y)
{
????pCMainWnd->mouseMove(x?y);
}
int?main(int?argc?char**?argv)
{
????glutInit(&argc?argv);
????glutInitDisplayMode(GLUT_DOUBLE?|?GLUT_RGBA?|?GLUT_DEPTH);
????glutInitWindowSize(500?500);
????glutInitWindowPosition(100?100);
????glutCreateWindow(“gl3D_test“);
????pCMainWnd?=?new?CMainWnd();
????pCMainWnd->InitScene();
????glutDisplayFunc(display);
????glutReshapeFunc(reshape);
????glutMouseFunc(mouse);
????//glutTimerFunc(100?spinDisplay?100);
????glutMotionFunc(mouseMove);
????glutMainLoop();
????return?0;
????/*?ANSI?C?requires?main?to?return?int.?*/
}
#endif
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3584??2019-02-27?19:06??讀OBJ模型,加載多紋理\.vs\GL3D\v15\.suo
?????文件???????1062??2019-02-28?20:43??讀OBJ模型,加載多紋理\Debug\cl.command.1.tlog
?????文件??????49030??2019-02-28?20:43??讀OBJ模型,加載多紋理\Debug\CL.read.1.tlog
?????文件????????806??2019-02-28?20:43??讀OBJ模型,加載多紋理\Debug\CL.write.1.tlog
?????文件?????198656??2015-03-15?14:28??讀OBJ模型,加載多紋理\Debug\freeglut.dll
?????文件????????563??2019-02-28?09:23??讀OBJ模型,加載多紋理\Debug\GL3D.Build.CppClean.log
?????文件?????139776??2019-02-28?20:43??讀OBJ模型,加載多紋理\Debug\GL3D.exe
?????文件????????381??2019-02-28?20:43??讀OBJ模型,加載多紋理\Debug\GL3D.exe.intermediate.manifest
?????文件?????890892??2019-02-28?20:43??讀OBJ模型,加載多紋理\Debug\GL3D.ilk
?????文件?????????52??2019-02-28?20:43??讀OBJ模型,加載多紋理\Debug\GL3D.lastbuildstate
?????文件???????6044??2019-02-28?20:43??讀OBJ模型,加載多紋理\Debug\GL3D.log
?????文件????1338368??2019-02-28?20:43??讀OBJ模型,加載多紋理\Debug\GL3D.pdb
?????文件????????713??2019-02-28?15:24??讀OBJ模型,加載多紋理\Debug\GL3D.vcxprojResolveAssemblyReference.cache
?????文件??????????0??2019-02-28?09:23??讀OBJ模型,加載多紋理\Debug\GL3D.write.1.tlog
?????文件????1386496??1997-11-25?17:11??讀OBJ模型,加載多紋理\Debug\glaux.dll
?????文件???????1198??2019-02-28?20:43??讀OBJ模型,加載多紋理\Debug\li
?????文件???????3460??2019-02-28?20:43??讀OBJ模型,加載多紋理\Debug\li
?????文件????????544??2019-02-28?20:43??讀OBJ模型,加載多紋理\Debug\li
?????文件??????38184??2019-02-28?20:10??讀OBJ模型,加載多紋理\Debug\main.obj
?????文件?????699474??2019-02-28?20:43??讀OBJ模型,加載多紋理\Debug\MainWnd.obj
?????文件????????382??2019-02-28?20:43??讀OBJ模型,加載多紋理\Debug\mt.command.1.tlog
?????文件????????584??2019-02-28?20:43??讀OBJ模型,加載多紋理\Debug\mt.read.1.tlog
?????文件????????212??2019-02-28?20:43??讀OBJ模型,加載多紋理\Debug\mt.write.1.tlog
?????文件?????740352??2019-02-28?20:43??讀OBJ模型,加載多紋理\Debug\vc100.idb
?????文件?????446464??2019-02-28?20:43??讀OBJ模型,加載多紋理\Debug\vc100.pdb
?????文件???62869504??2019-02-28?21:11??讀OBJ模型,加載多紋理\GL3D.sdf
?????文件???????1228??2019-02-27?22:54??讀OBJ模型,加載多紋理\GL3D.sln
????..A..H.?????20992??2019-02-28?21:11??讀OBJ模型,加載多紋理\GL3D.suo
?????文件???????8792??2019-02-28?19:53??讀OBJ模型,加載多紋理\GL3D.vcxproj
?????文件????????394??2019-02-28?09:23??讀OBJ模型,加載多紋理\GL3D.vcxproj.filters
............此處省略40個文件信息
評論
共有 條評論