• 大小: 15.1MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-29
  • 语言: 其他
  • 标签: opengl  显示兔子  

资源简介

斯坦福大学常用的opengl画兔子的程序。简便好用

资源截图

代码片段和文件信息

//-----------------------------------------------------------------------------
//           Name: ogl_stanford_bunny.cpp
//         Author: Kevin Harris (kevin@codesampler.com)
//  Last Modified: 02/01/05
//    Description: This sample demonstrates how to make use of the useful 
//                 Stanford Bunny model or data set for testing and prototyping 
//                 purposes.
//
//   Control Keys: Left Mouse Button - Spin the view
//                 Up Arrow - Move the bunny model away
//                 Down Arrow - Move the bunny model away
//-----------------------------------------------------------------------------

#define STRICT
#define WIN32_LEAN_AND_MEAN


#include 
#include 
#include 
#include 

#include “resource.h“

//-----------------------------------------------------------------------------
// GLOBALS
//-----------------------------------------------------------------------------
HWND   g_hWnd = NULL;
HDC    g_hDC  = NULL;
HGLRC  g_hRC  = NULL;

GLuint g_stanfordBunnyDL = -1;

bool g_bRenderInWireframe = false;

float g_fDistance = -2.0f;
float g_fSpinX    =  0.0f;
float g_fSpinY    =  0.0f;

//-----------------------------------------------------------------------------
// PROTOTYPES
//-----------------------------------------------------------------------------
int WINAPI WinMain(HINSTANCE hInstanceHINSTANCE hPrevInstance 
   LPSTR lpCmdLine int nCmdShow);
LRESULT CALLBACK WindowProc(HWND g_hWnd UINT msg WPARAM wParam LPARAM lParam);
void init(void);
void render(void);
void shutDown(void);

extern GLint Gen3DobjectList();

//-----------------------------------------------------------------------------
// Name: WinMain()
// Desc: The application‘s entry point
//-----------------------------------------------------------------------------
int WINAPI WinMain( HINSTANCE hInstance
   HINSTANCE hPrevInstance
   LPSTR     lpCmdLine
   int       nCmdShow )
{
WNDCLASSEX winClass; 
MSG        uMsg;

memset(&uMsg0sizeof(uMsg));

winClass.lpszClassName = “MY_WINDOWS_CLASS“;
winClass.cbSize        = sizeof(WNDCLASSEX);
winClass.style         = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
winClass.lpfnWndProc   = WindowProc;
winClass.hInstance     = hInstance;
winClass.hIcon        = LoadIcon(hInstance (LPCTSTR)IDI_OPENGL_ICON);
winClass.hIconSm    = LoadIcon(hInstance (LPCTSTR)IDI_OPENGL_ICON);
winClass.hCursor       = LoadCursor(NULL IDC_ARROW);
winClass.hbrBackground = (HBRUSH)GetStockobject(BLACK_BRUSH);
winClass.lpszMenuName  = NULL;
winClass.cbClsExtra    = 0;
winClass.cbWndExtra    = 0;

if( !RegisterClassEx(&winClass) )
return E_FAIL;

g_hWnd = CreateWindowEx( NULL “MY_WINDOWS_CLASS“ 
                    “OpenGL - Stanford Bunny Data Set“
                    WS_OVERLAPPEDWINDOW | WS_VISIBLE
                    0 0 640 480 NULL NULL hInstance NUL

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2011-10-11 16:45  rabbit\
     目录           0  2012-02-13 19:32  rabbit\ogl_stanford_bunny\
     目录           0  2012-02-13 19:25  rabbit\ogl_stanford_bunny\Debug\
     文件         466  2012-02-12 23:49  rabbit\ogl_stanford_bunny\Debug\BscMake.command.1.tlog
     文件       19992  2012-02-12 23:49  rabbit\ogl_stanford_bunny\Debug\CL.read.1.tlog
     文件        1482  2012-02-12 23:49  rabbit\ogl_stanford_bunny\Debug\CL.write.1.tlog
     文件         684  2012-02-12 23:49  rabbit\ogl_stanford_bunny\Debug\bscmake.read.1.tlog
     文件         396  2012-02-12 23:49  rabbit\ogl_stanford_bunny\Debug\bscmake.write.1.tlog
     文件        1498  2012-02-12 23:49  rabbit\ogl_stanford_bunny\Debug\cl.command.1.tlog
     文件           2  2012-02-13 19:25  rabbit\ogl_stanford_bunny\Debug\link-cvtres.read.1.tlog
     文件           2  2012-02-13 19:25  rabbit\ogl_stanford_bunny\Debug\link-cvtres.write.1.tlog
     文件        2032  2012-02-13 19:25  rabbit\ogl_stanford_bunny\Debug\link.command.1.tlog
     文件        4316  2012-02-13 19:25  rabbit\ogl_stanford_bunny\Debug\link.read.1.tlog
     文件        1144  2012-02-13 19:25  rabbit\ogl_stanford_bunny\Debug\link.write.1.tlog
     文件         450  2012-02-13 19:25  rabbit\ogl_stanford_bunny\Debug\mt.command.1.tlog
     文件         346  2012-02-13 19:25  rabbit\ogl_stanford_bunny\Debug\mt.read.1.tlog
     文件         346  2012-02-13 19:25  rabbit\ogl_stanford_bunny\Debug\mt.write.1.tlog
     文件     4008960  2012-02-12 23:49  rabbit\ogl_stanford_bunny\Debug\ogl_stanford_bunny.bsc
     文件      922624  2012-02-13 19:25  rabbit\ogl_stanford_bunny\Debug\ogl_stanford_bunny.exe
     文件         406  2012-02-12 23:49  rabbit\ogl_stanford_bunny\Debug\ogl_stanford_bunny.exe.embed.manifest
     文件         472  2012-02-12 23:49  rabbit\ogl_stanford_bunny\Debug\ogl_stanford_bunny.exe.embed.manifest.res
     文件         381  2012-02-13 19:25  rabbit\ogl_stanford_bunny\Debug\ogl_stanford_bunny.exe.intermediate.manifest
     文件     1066444  2012-02-13 19:25  rabbit\ogl_stanford_bunny\Debug\ogl_stanford_bunny.ilk
     文件          70  2012-02-13 19:25  rabbit\ogl_stanford_bunny\Debug\ogl_stanford_bunny.lastbuildstate
     文件        2338  2012-02-13 19:25  rabbit\ogl_stanford_bunny\Debug\ogl_stanford_bunny.log
     文件       25210  2012-02-12 23:49  rabbit\ogl_stanford_bunny\Debug\ogl_stanford_bunny.obj
     文件     1870848  2012-02-13 19:25  rabbit\ogl_stanford_bunny\Debug\ogl_stanford_bunny.pdb
     文件        7988  2012-02-12 23:00  rabbit\ogl_stanford_bunny\Debug\ogl_stanford_bunny.res
     文件           0  2012-02-12 23:49  rabbit\ogl_stanford_bunny\Debug\ogl_stanford_bunny.sbr
     文件         232  2012-02-12 23:00  rabbit\ogl_stanford_bunny\Debug\ogl_stanford_bunny_manifest.rc
     文件        1276  2012-02-12 23:49  rabbit\ogl_stanford_bunny\Debug\rc.command.1.tlog
............此处省略31个文件信息

评论

共有 条评论