• 大小: 35.55MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-05
  • 语言: 其他
  • 标签: 3d  opengl  

资源简介

3d opengl 飞行射击游戏源码和论文,好多都可以用,

资源截图

代码片段和文件信息

#include “.\boxsky.h“

BoxSky::BoxSky()
{
}

BoxSky::~BoxSky(void)
{
}
bool BoxSky::SetVertexBuffer(IDirect3DDevice9 *Device LPCSTR fontFileName LPCSTR backFileName LPCSTR leftFileName LPCSTR rightFileName LPCSTR topFileName LPCSTR bottomFileName float skywidth float skyheight)
{
if(FAILED(D3DXCreateTextureFromFile(DevicefontFileName&Skytex[0])))
{
return false;
}
if(FAILED(D3DXCreateTextureFromFile(DevicebackFileName&Skytex[1])))
{
return false;
}
if(FAILED(D3DXCreateTextureFromFile(DeviceleftFileName&Skytex[2])))
{
return false;
}
if(FAILED(D3DXCreateTextureFromFile(DevicerightFileName&Skytex[3])))
{
return false;
}
if(FAILED(D3DXCreateTextureFromFile(DevicetopFileName&Skytex[4])))
{
return false;
}
if(FAILED(D3DXCreateTextureFromFile(DevicebottomFileName&Skytex[5])))
{
return false;
}
if(FAILED(Device->CreateVertexBuffer(24* sizeof(CUSTOMVERTEX) 0 CUSTOMVERTEX_FVF D3DPOOL_MANAGED&m_pVertexBuffer 0)))
{
MessageBox(NULL““““1);
}
CUSTOMVERTEX *skyvertex;
m_pVertexBuffer->Lock(0 0 (void**)&skyvertex 0);
//前面
skyvertex[0] = CUSTOMVERTEX(skywidth/2.0f 0.0f -skywidth/2.0f 1.0f 1.0f);//点E
skyvertex[1] = CUSTOMVERTEX(skywidth/2.0f skyheight -skywidth/2.0f 1.0f 0.0f);//点F
skyvertex[2] = CUSTOMVERTEX(-skywidth/2.0f 0.0f -skywidth/2.0f 0.0f 1.0f);//点O
skyvertex[3] = CUSTOMVERTEX(-skywidth/2.0f skyheight -skywidth/2.0f 0.0f 0.0f);//点G
//后面
skyvertex[4] = CUSTOMVERTEX(-skywidth/2.0f 0.0f skywidth/2.0f 1.0f 1.0f);//点D
skyvertex[5] = CUSTOMVERTEX(-skywidth/2.0f skyheight skywidth/2.0f 1.0f 0.0f);//点A
skyvertex[6] = CUSTOMVERTEX(skywidth/2.0f 0.0f skywidth/2.0f 0.0f 1.0f);//点C
skyvertex[7] = CUSTOMVERTEX(skywidth/2.0f skyheight skywidth/2.0f 0.0f 0.0f);//点B
//左面
skyvertex[8] = CUSTOMVERTEX(-skywidth/2.0f 0.0f -skywidth/2.0f 1.0f 1.0f);
skyvertex[9] = CUSTOMVERTEX(-skywidth/2.0f skyheight -skywidth/2.0f 1.0f 0.0f);//点G
skyvertex[10] = CUSTOMVERTEX(-skywidth/2.0f 0.0f skywidth/2.0f 0.0f 1.0f);//点D
skyvertex[11] = CUSTOMVERTEX(-skywidth/2.0f skyheight skywidth/2.0f 0.0f 0.0f);//点A
//右面
skyvertex[12] = CUSTOMVERTEX(skywidth/2.0f 0.0f skywidth/2.0f 1.0f 1.0f);//点C
skyvertex[13] = CUSTOMVERTEX(skywidth/2.0f skyheight skywidth/2.0f 1.0f 0.0f);//点B
skyvertex[14] = CUSTOMVERTEX(skywidth/2.0f 0.0f -skywidth/2.0f 0.0f 1.0f);//点E
skyvertex[15] = CUSTOMVERTEX(skywidth/2.0f skyheight -skywidth/2.0f 0.0f 0.0f);//点F
//顶面
skyvertex[16] = CUSTOMVERTEX(skywidth/2.0f skyheight -skywidth/2.0f 1.0f 1.0f);//点F
skyvertex[17] = CUSTOMVERTEX(skywidth/2.0f skyheight skywidth/2.0f 1.0f 0.0f);//点B
skyvertex[18] = CUSTOMVERTEX(-skywidth/2.0f skyheight -skywidth/2.0f 0.0f 1.0f);//点G
skyvertex[19] = CUSTOMVERTEX(-skywidth/2.0f skyheight skywidth/2.0f 0.0f 0.0f);//点A
//底面
skyvertex[20] = CUSTOMVERTEX(-skywidth/2.0f 0.0f -skywidth/2.0f 1.0f 1.0f);//点O

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     364724  2005-10-19 15:55  Lelecode.com\FighterTest\Aereo.ms3d

     文件      28668  2005-10-19 15:55  Lelecode.com\FighterTest\FighterTest.aps

     文件       2359  2005-10-19 15:55  Lelecode.com\FighterTest\FighterTest.clw

     文件       4335  2011-11-07 13:30  Lelecode.com\FighterTest\FighterTest.cpp

     文件       5086  2005-10-19 15:55  Lelecode.com\FighterTest\FighterTest.dsp

     文件        547  2005-10-19 15:55  Lelecode.com\FighterTest\FighterTest.dsw

     文件       1408  2005-10-19 15:55  Lelecode.com\FighterTest\FighterTest.h

     文件      10610  2005-10-19 15:55  Lelecode.com\FighterTest\FighterTest.rc

     文件       1878  2011-11-07 13:30  Lelecode.com\FighterTest\FighterTestDoc.cpp

     文件       1527  2005-10-19 15:55  Lelecode.com\FighterTest\FighterTestDoc.h

     文件      19577  2011-11-07 13:30  Lelecode.com\FighterTest\FighterTestView.cpp

     文件       4304  2005-10-19 15:55  Lelecode.com\FighterTest\FighterTestView.h

     文件      17462  2005-10-19 15:55  Lelecode.com\FighterTest\Floor.bmp

     文件       2548  2011-11-07 13:30  Lelecode.com\FighterTest\MainFrm.cpp

     文件       1581  2005-10-19 15:55  Lelecode.com\FighterTest\MainFrm.h

     文件       5773  2005-10-19 15:55  Lelecode.com\FighterTest\MilkshapeModel.cpp

     文件        745  2005-10-19 15:55  Lelecode.com\FighterTest\MilkshapeModel.h

     文件       3122  2005-10-19 15:55  Lelecode.com\FighterTest\Model.cpp

     文件       1741  2005-10-19 15:55  Lelecode.com\FighterTest\Model.h

     文件       2102  2005-10-19 15:55  Lelecode.com\FighterTest\Puf.bmp

     文件       4430  2005-10-19 15:55  Lelecode.com\FighterTest\ReadMe.txt

     文件       1078  2005-10-19 15:55  Lelecode.com\FighterTest\RES\FighterTest.ico

     文件        403  2005-10-19 15:55  Lelecode.com\FighterTest\RES\FighterTest.rc2

     文件       1078  2005-10-19 15:55  Lelecode.com\FighterTest\RES\FighterTestDoc.ico

    ..A.SH.      6144  2005-10-19 15:55  Lelecode.com\FighterTest\RES\Thumbs.db

     文件       1078  2005-10-19 15:55  Lelecode.com\FighterTest\RES\Toolbar.bmp

     文件        499  2005-10-19 15:55  Lelecode.com\FighterTest\Resource.h

     文件     786486  2005-10-19 15:55  Lelecode.com\FighterTest\Sky.bmp

     文件        213  2005-10-19 15:55  Lelecode.com\FighterTest\StdAfx.cpp

     文件       1327  2005-10-19 15:55  Lelecode.com\FighterTest\StdAfx.h

............此处省略8个文件信息

评论

共有 条评论