亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? main.cpp

?? Quake中的MD2模型導入
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);	// Clear The Screen And The Depth Buffer
	glLoadIdentity();									// Reset The matrix

//////////// *** NEW *** ////////// *** NEW *** ///////////// *** NEW *** ////////////////////

	// Give OpenGL our position,	then view,		then up vector
	gluLookAt(		0, 1.5f, 90,		0, 0.5f, 0,			0, 1, 0);
	
	// We want the model to rotate around the axis so we give it a rotation
	// value, then increase/decrease it. You can rotate right of left with the arrow keys.

	glRotatef(g_RotateX, 0, 1.0f, 0);						// Rotate the object around the Y-Axis
	g_RotateX += g_RotationSpeed;							// Increase the speed of rotation

	// Make sure we have valid objects just in case. (size() is in the vector class)
	if(g_3DModel.pObject.size() <= 0) return;

	// Get the current object that we are displaying
	t3DObject *pObject = &g_3DModel.pObject[0];

	// Render lines or normal triangles mode, depending on the global variable
	glBegin(g_ViewMode);

		// Go through all of the faces (polygons) of the object and draw them
		for(int j = 0; j < pObject->numOfFaces; j++)
		{
			// Go through each corner of the triangle and draw it.
			for(int whichVertex = 0; whichVertex < 3; whichVertex++)
			{
				// Get the index for each point in the face
				int index = pObject->pFaces[j].vertIndex[whichVertex];

				// Get the index for each texture coord in the face
				int index2 = pObject->pFaces[j].coordIndex[whichVertex];
			
				// Give OpenGL the normal for this vertex.  Notice that we put a 
				// - sign in front.  It appears that because of the ordering of Quake2's
				// polygons, we need to invert the normal
				glNormal3f(-pObject->pNormals[ index ].x, -pObject->pNormals[ index ].y, -pObject->pNormals[ index ].z);
					
				// Make sure there was a UVW map applied to the object or else it won't have tex coords.
				if(pObject->pTexVerts) 
				{
					glTexCoord2f(pObject->pTexVerts[ index2 ].x, pObject->pTexVerts[ index2 ].y);
				}
				
				// Pass in the current vertex of the object (Corner of current face)
				glVertex3f(pObject->pVerts[ index ].x, pObject->pVerts[ index ].y, pObject->pVerts[ index ].z);
			}
		}

	glEnd();

//////////// *** NEW *** ////////// *** NEW *** ///////////// *** NEW *** ////////////////////

	SwapBuffers(g_hDC);									// Swap the backbuffers to the foreground
}

///////////////////////////////// WIN PROC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*
/////
/////	This function handles the window messages.
/////
///////////////////////////////// WIN PROC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*

LRESULT CALLBACK WinProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    LONG    lRet = 0; 
    PAINTSTRUCT    ps;

    switch (uMsg)
	{ 
    case WM_SIZE:										// If the window is resized
		if(!g_bFullScreen)								// Do this only if we are NOT in full screen
		{
			SizeOpenGLScreen(LOWORD(lParam),HIWORD(lParam));// LoWord=Width, HiWord=Height
			GetClientRect(hWnd, &g_rRect);				// Get the window rectangle
		}
        break; 
 
	case WM_PAINT:										// If we need to repaint the scene
		BeginPaint(hWnd, &ps);							// Init the paint struct		
		EndPaint(hWnd, &ps);							// EndPaint, Clean up
		break;

//////////// *** NEW *** ////////// *** NEW *** ///////////// *** NEW *** ////////////////////

	// Below we define our controls for this simple tutorial.
	// The controls are: 

	// Left Mouse Button - Changes the Render mode from normal to wireframe.
	// Right Mouse Button - Turns lighting On/Off
	// Left Arrow Key - Spins the model to the left
	// Right Arrow Key - Spins the model to the right
	// Escape - Quits

	case WM_LBUTTONDOWN:								// If the left mouse button was clicked
		
		if(g_ViewMode == GL_TRIANGLES) {				// We our drawing mode is at triangles
			g_ViewMode = GL_LINE_STRIP;					// Go to line stips
		} else {
			g_ViewMode = GL_TRIANGLES;					// Go to triangles
		}
		break;

	case WM_RBUTTONDOWN:								// If the right mouse button was clicked.
		
		g_bLighting = !g_bLighting;						// Turn lighting ON/OFF

		if(g_bLighting) {								// If lighting is ON
			glEnable(GL_LIGHTING);						// Enable OpenGL lighting
		} else {
			glDisable(GL_LIGHTING);						// Disable OpenGL lighting
		}
		break;

	case WM_KEYDOWN:									// If we pressed a key

		switch(wParam) {								// Check if we hit a key
			case VK_ESCAPE:								// If we hit the escape key
				PostQuitMessage(0);						// Send a QUIT message to the window
				break;

			case VK_LEFT:								// If the LEFT arrow key was pressed
				g_RotationSpeed -= 0.05f;				// Decrease the rotation speed (eventually rotates left)
				break;

			case VK_RIGHT:								// If the RIGHT arrow key is pressed
				g_RotationSpeed += 0.05f;				// Increase the rotation speed (rotates right)
				break;
		}
		break;

//////////// *** NEW *** ////////// *** NEW *** ///////////// *** NEW *** ////////////////////


    case WM_CLOSE:										// If the window is being closed
        PostQuitMessage(0);								// Send a QUIT Message to the window
        break; 
     
    default:											// Return by default
        lRet = DefWindowProc (hWnd, uMsg, wParam, lParam); 
        break; 
    } 
 
    return lRet;										// Return by default
}

/////////////////////////////////////////////////////////////////////////////////
//
// * QUICK NOTES * 
//
// This tutorial shows how to load a .Md2 file.  This is a good addition to an engine.
// In the next tutorial we will show you how to handle the key frame animation.
// I think this is the best and easiest 3D file format I have worked with, especially
// for animation.
// 
// * What's An STL (Standard Template Library) Vector? *
// Let me quickly explain the STL vector for those of you who are not familiar with them.
// To use a vector you must include <vector> and use the std namespace: using namespace std;
// A vector is an array based link list.  It allows you to dynamically add and remove nodes.
// This is a template class so it can be a list of ANY type.  To create a vector of type
// "int" you would say:  vector<int> myIntList;
// Now you can add a integer to the dynamic array by saying: myIntList.push_back(10);
// or you can say:  myIntList.push_back(num);.  The more you push back, the larger
// your array gets.  You can index the vector like an array.  myIntList[0] = 0;
// To get rid of a node you use the pop_back() function.  To clear the vector use clear().
// It frees itself so you don't need to worry about it, except if you have data
// structures that need information freed from inside them, like our objects.
//
// Once again I should point out that the coordinate system of OpenGL and .Md2 files are different.
// Since Quake2 Models have the Z-Axis pointing up (strange and ugly I know! :), 
// we need to flip the y values with the z values in our vertices.  That way it
// will be normal, with Y pointing up.  Also, because we swap the Y and Z we need to negate 
// the Z to make it come out correctly.  This is also explained and done in ReadMd2Data().
//
// I would like to thank Daniel E. Schoenblum <dansch@hops.cs.jhu.edu> for help
// with explaining the file format.  You can check it out at:  
// 
// http://www.ugrad.cs.jhu.edu/~dansch/md2/#model_magic
//
// Let me know if this helps you out!
// 
// 
// Ben Humphrey (DigiBen)
// Game Programmer
// DigiBen@GameTutorials.com
// Co-Web Host of www.GameTutorials.com
//
// The Quake2 .Md2 file format is owned by ID Software.  This tutorial is being used 
// as a teaching tool to help understand model loading and animation.  This should
// not be sold or used under any way for commercial use with out written conset
// from ID Software.
//
// Quake and Quake2 are trademarks of id Software.
// All trademarks used are properties of their respective owners. 
//
// 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
717成人午夜免费福利电影| 国内成人自拍视频| 欧美在线观看视频一区二区| 亚洲欧洲成人av每日更新| 丁香网亚洲国际| 国产精品久久久久久久久动漫| 成人免费黄色大片| 亚洲色图欧洲色图| 欧美日韩黄色一区二区| 麻豆精品国产传媒mv男同 | 99久久久久久| 亚洲综合丁香婷婷六月香| 欧美三级乱人伦电影| 捆绑调教美女网站视频一区| 中文在线一区二区| 欧美午夜精品久久久久久孕妇| 五月激情丁香一区二区三区| 欧美成人一区二区三区在线观看| 国产麻豆91精品| 亚洲美女视频一区| 日韩欧美国产一二三区| eeuss鲁片一区二区三区在线看| 亚洲国产欧美另类丝袜| 精品久久久久久综合日本欧美| 成人av电影在线网| 青青青伊人色综合久久| 国产精品伦一区| 欧美一级片在线| av电影一区二区| 日本在线观看不卡视频| 中文字幕成人av| 884aa四虎影成人精品一区| 国产精品一区二区三区99| 亚洲一区二区三区国产| 久久免费视频一区| 欧美日韩日本视频| 成人综合在线观看| 蜜臀av亚洲一区中文字幕| 亚洲丝袜另类动漫二区| 精品伦理精品一区| 欧美日韩一级片网站| 波多野结衣一区二区三区| 蜜臀久久99精品久久久久久9| 亚洲乱码精品一二三四区日韩在线 | 欧美日韩一区二区不卡| 懂色av一区二区三区蜜臀| 青青草原综合久久大伊人精品| 亚洲欧美另类久久久精品| 精品国产伦一区二区三区观看体验 | 自拍偷拍国产精品| 欧美精品一区二区不卡| 欧美日韩情趣电影| 色综合天天综合网天天看片| gogogo免费视频观看亚洲一| 强制捆绑调教一区二区| 一区二区成人在线| 国产精品免费视频观看| 久久精品一区八戒影视| 日韩亚洲国产中文字幕欧美| 欧美丝袜丝交足nylons| 99综合影院在线| 丁香婷婷综合色啪| 国产精品综合在线视频| 老司机一区二区| 视频在线观看一区二区三区| 亚洲美女一区二区三区| 亚洲精品欧美激情| 亚洲欧美日韩中文播放| 亚洲欧洲www| 亚洲欧洲制服丝袜| 亚洲品质自拍视频| 中文字幕视频一区| 中文子幕无线码一区tr| 国产精品美日韩| 国产精品高潮呻吟久久| 国产精品国产三级国产普通话三级 | 免费欧美日韩国产三级电影| 亚洲国产欧美在线| 日日夜夜精品免费视频| 午夜精品在线看| 奇米色777欧美一区二区| 日韩二区在线观看| 久久精品99国产精品日本| 另类调教123区| 国产一区二区不卡在线| 岛国精品在线播放| 99久久综合精品| 欧亚一区二区三区| 欧美精品自拍偷拍| 欧美成人一区二区三区| 久久久久久黄色| 国产精品久久久久久久第一福利 | 中文字幕亚洲精品在线观看| 亚洲人妖av一区二区| 亚洲精品视频免费观看| 亚洲成人动漫在线免费观看| 午夜亚洲福利老司机| 久久福利视频一区二区| 国产91精品一区二区麻豆网站| thepron国产精品| 精品视频在线免费| 日韩精品一区二区三区四区视频| 久久久久久久精| 亚洲精品成人精品456| 天天色图综合网| 国产精品一区2区| 色94色欧美sute亚洲线路一ni | 久久久久免费观看| 亚洲日本一区二区三区| 日韩**一区毛片| 国产成人aaaa| 欧美日韩免费视频| 久久久91精品国产一区二区精品| ...xxx性欧美| 久久国产人妖系列| 99久久久精品| 日韩欧美在线123| 国产精品视频九色porn| 亚洲高清不卡在线观看| 国产精品99久久久| 欧美日韩免费高清一区色橹橹| 欧美变态口味重另类| 亚洲免费在线视频一区 二区| 美女诱惑一区二区| 色婷婷狠狠综合| 久久噜噜亚洲综合| 日韩精品一二三四| 99免费精品在线| 久久综合av免费| 午夜伦理一区二区| 91香蕉国产在线观看软件| 久久看人人爽人人| 日韩不卡一区二区| 色天天综合色天天久久| 国产区在线观看成人精品| 日韩精品福利网| 在线一区二区三区做爰视频网站| 久久这里只有精品首页| 日韩av电影天堂| 在线亚洲免费视频| 国产精品久久久一本精品| 精品一二三四区| 欧美一区二区三区免费视频| 亚洲欧美日韩国产综合| 国产成人午夜电影网| 日韩欧美国产一二三区| 日本欧美韩国一区三区| 欧美性极品少妇| 亚洲精品福利视频网站| 不卡的av电影| 国产精品视频一二三| 国产一区二区日韩精品| 精品国产乱码久久久久久牛牛 | 欧美v日韩v国产v| 视频在线观看91| 欧美日韩精品一区二区三区蜜桃| 《视频一区视频二区| 91在线免费看| 亚洲麻豆国产自偷在线| 色婷婷综合视频在线观看| 亚洲欧美视频一区| 91久久精品一区二区二区| 亚洲精品国产无套在线观| 99久久精品久久久久久清纯| 国产精品热久久久久夜色精品三区| 国产乱国产乱300精品| xfplay精品久久| 国产黑丝在线一区二区三区| 国产亚洲一区二区在线观看| 国产成人av网站| 国产农村妇女毛片精品久久麻豆| 国产传媒欧美日韩成人| 国产日韩欧美激情| 99久久久无码国产精品| 亚洲免费观看高清完整版在线| 在线一区二区视频| 亚洲成人av中文| 欧美一级专区免费大片| 久久爱另类一区二区小说| 久久精品一区二区三区不卡| 成人激情动漫在线观看| 亚洲精品欧美激情| 欧美剧在线免费观看网站| 蜜桃一区二区三区四区| 久久久夜色精品亚洲| 99九九99九九九视频精品| 亚洲一二三四久久| 日韩三级中文字幕| 国产91精品欧美| 一区二区成人在线观看| 日韩视频永久免费| 国产99久久久久| 一区二区三区四区不卡视频| 欧美日韩中文国产| 国产一区二区在线观看视频| 国产精品久久福利| 欧美高清你懂得| 国产美女娇喘av呻吟久久| 亚洲日本va午夜在线影院| 欧美一区二区性放荡片|