資源簡介
openGl 飛機模擬
openGl 飛機模擬
openGl 飛機模擬
通過鼠標操作

代碼片段和文件信息
//?baiscobj.cpp:?implementation?of?the?baiscobj?class.
//
//////////////////////////////////////////////////////////////////////
#include?“stdafx.h“
#include?“baiscobj.h“
#include?“bitmap.h“
#include?“F16.h“
//////////////////////////////////////////////////////////////////////
//?Construction/Destruction
//////////////////////////////////////////////////////////////////////
int?F16;
GLuint?texturem?=?0;
GLfloat?XPOS?=?-MAX/2;
GLfloat?YPOS?=?0;
GLfloat?ZPOS?=?-MAX/2;
GLfloat?XP=0;
GLfloat?YP=0;
GLfloat?ZP=0;
GLfloat?xtrans?=?MAX/2;
GLfloat?ytrans?=?0;
GLfloat?ztrans?=?MAX/2;
GLfloat?visual_distance?=?180;
GLfloat?sun_height?=?2000;
GLfloat?sun_zdistance?=?-5000;
GLfloat?xtexa;?
GLfloat?ytexa;?
GLfloat?xtexa2;?
GLfloat?ytexa2;?
????
int?xrange1?;?
int?xrange2?;
int?zrange1?;
int?zrange2?;???
GLfloat xrot=0; //?繞?X?軸旋轉
GLfloat yrot=0; //?繞?Y?軸旋轉
GLfloat zrot=0; //?繞?Z?軸旋轉
GLfloat?Throttlei;
GLfloat?Throttle?=?5;
GLfloat?_Throttle=Throttle;
GLfloat?Speed?=?Throttle;
GLfloat?Speedi;
GLfloat?piover180?=?0.0174532925f;
GLfloat?sceneroty;
GLfloat?heading;
GLfloat?pitch?=?0;
GLfloat?yaw?=?0;
GLfloat?zprot;
int?quality?=?3;
GLfloat?H?=?0;
GLfloat?glow?=?.4f;
GLfloat?glowp?=?0;
bool??wireframe?=?FALSE; //?線框繪制模式ON/OFF
bool??water?=?true; //?是否繪制水?ON/OFF
bool??Afterburner?=?false;
GLUquadricObj?*quadratic;
//GLuint texture[8];
GLfloat?V;
GLfloat?Angle;
int?loop;
baiscobj::baiscobj()
{
????
//////////////////////////////////////////////////////////////////////
char appdir[256];
GetCurrentDirectory(256appdir);
CString?dir=appdir;
if(dir.Right(8)!=“運行程序“)
SetCurrentDirectory(“../運行程序“);
//////////////////////////////////////////////////////////////////////
g_imageData?=?LoadBit(“data/images/Terrain1.bmp“&g_bit);
LoadT8(“data/images/SAND3.bmp“ ?g_cactus[4]);
LoadT8(“data/images/ASPHALT.bmp“?g_cactus[7]);
LoadT8(“data/images/sky.bmp“?g_cactus[8]);
LoadT8(“data/images/4LEFT.bmp“?g_cactus[1]);
LoadT8(“data/images/NEBULA.bmp“?g_cactus[2]);
????glEnable(GL_TEXTURE_2D);
????F16=GL3DS_initialize_F16();
}
baiscobj::~baiscobj()
{
}
void?baiscobj::light0()
{ float?fog_r?=?50.f/255.f;
float?fog_g?=?150.f/255.f;
float?fog_b?=?254.f/255.f;
glClearColor(fog_r?fog_g?fog_b?1); //?黑背景顏色
glClearDepth(1.0f); ??? //?深度緩沖設置
??
RestoreMyDefaultSettings();
glHint(GL_PERSPECTIVE_CORRECTION_HINT?GL_NICEST); //?Really?Nice?Perspective?Calculations
????//?設置光照效果
GLfloat?LightAmbient[]= {?0.5f?0.5f?0.5f?1.0f?};
GLfloat?LightDiffuse[]= {?1.0f?1.0f?1.0f?1.0f?};
GLfloat?LightSpecular[]= {?0.5f?0.5f?0.5f?1.0f?};
GLfloat?LightPosition[]= {?0.0f?0.0f?0.0f?1.0f?};
????glLightfv(GL_LIGHT1?GL_AMBIENT?LightAmbient);
glLightfv(GL_LIGHT1?GL_DIFFUSE?LightDiffuse);
glLightfv(GL_LIGHT1?GL_SPECULARLightSpecular);
glLightfv(GL_LIGHT1?GL_POSITIONLightPosition);
glEnable(GL_LIGHT1);
/
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????21453??2007-11-25?18:58??openGl?飛機模擬\baiscobj.cpp
?????文件???????1801??2007-11-25?11:44??openGl?飛機模擬\baiscobj.h
?????文件???????3330??2007-08-26?15:12??openGl?飛機模擬\bitmap.h
?????文件??????66614??2005-01-24?10:17??openGl?飛機模擬\data\images\3TOP.BMP
?????文件??????33846??2005-04-07?00:28??openGl?飛機模擬\data\images\4LEFT.BMP
?????文件??????66614??2005-10-19?15:55??openGl?飛機模擬\data\images\ASPHALT.BMP
?????文件??????66614??2005-10-19?15:55??openGl?飛機模擬\data\images\NEBULA.BMP
?????文件?????263222??2005-04-05?16:24??openGl?飛機模擬\data\images\SAND2.BMP
?????文件?????263222??2005-04-05?16:24??openGl?飛機模擬\data\images\SAND3.BMP
?????文件?????263222??2005-04-05?16:22??openGl?飛機模擬\data\images\SAND4.BMP
?????文件??????66614??2005-10-19?15:55??openGl?飛機模擬\data\images\SKY.BMP
?????文件??????98668??2010-05-27?13:20??openGl?飛機模擬\Debug\baiscobj.obj
?????文件??????10459??2010-05-27?13:20??openGl?飛機模擬\Debug\glFont.obj
?????文件??????15298??2010-05-27?13:20??openGl?飛機模擬\Debug\OpenGL.obj
?????文件??????67083??2010-05-27?13:20??openGl?飛機模擬\Debug\StdAfx.obj
?????文件?????140288??2010-05-27?13:42??openGl?飛機模擬\Debug\vc60.idb
?????文件?????135168??2010-05-27?13:20??openGl?飛機模擬\Debug\vc60.pdb
?????文件?????188509??2010-05-27?13:20??openGl?飛機模擬\Debug\youxisheji.exe
?????文件?????298204??2010-05-27?13:20??openGl?飛機模擬\Debug\youxisheji.ilk
?????文件???????8856??2010-05-27?13:20??openGl?飛機模擬\Debug\youxisheji.obj
?????文件?????369664??2010-05-27?13:20??openGl?飛機模擬\Debug\youxisheji.pdb
?????文件??????44576??2007-08-25?08:26??openGl?飛機模擬\F16.gl
?????文件??????41549??2007-08-26?07:48??openGl?飛機模擬\F16.h
?????文件???????2446??2007-09-16?17:25??openGl?飛機模擬\glFont.cpp
?????文件????????668??2007-09-16?17:18??openGl?飛機模擬\glFont.h
?????文件???????4387??2007-10-30?07:21??openGl?飛機模擬\OpenGL.cpp
?????文件????????909??2007-10-11?17:04??openGl?飛機模擬\OpenGL.h
?????文件???????1233??2007-11-25?11:27??openGl?飛機模擬\ReadMe.txt
?????文件????????297??2007-11-25?11:27??openGl?飛機模擬\StdAfx.cpp
?????文件???????1324??2007-11-25?11:45??openGl?飛機模擬\StdAfx.h
............此處省略13個文件信息
評論
共有 條評論