Water.h
资源名称:3DRPG.rar [点击查看]
上传用户:cjwanglu
上传日期:2013-07-10
资源大小:4744k
文件大小:1k
源码类别:
游戏
开发平台:
Visual C++
- #include <d3dx9.h>
- #define D3DFVF_VERTEX (D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX1)//|D3DFVF_NORMAL
- class CWater
- {
- private:
- struct VERTEX
- {
- float x,y,z;
- float nx,ny,nz;
- float tu,tv;
- bool flag;
- float tvv;
- };
- public:
- CWater(HINSTANCE hinst,LPDIRECT3DDEVICE9 d3dd,DWORD row,DWORD col);
- virtual ~CWater();
- void Translate();
- void RenerWater(float Vy);
- //float GetHeight(float x,float z);
- float y;
- private:
- D3DXVECTOR3 GetTriangeNormal(D3DXVECTOR3* vV1, D3DXVECTOR3* vV2, D3DXVECTOR3* vV3);
- D3DMATERIAL9 material;
- void SetMaterial();
- void CreateVertex();
- void SetTexture();
- LPDIRECT3DDEVICE9 m_pD3DDevice;
- LPDIRECT3DVERTEXBUFFER9 m_pVbRiver;
- LPDIRECT3DINDEXBUFFER9 m_pIbRiver;
- LPDIRECT3DTEXTURE9 m_pTxRiver;
- DWORD dwRow,dwCol;//湖水行列
- //DWORD m_dwRow,m_dwCol;//地形行列
- //float m_fHeight;
- float m_fcell;
- //BYTE * m_pHeightData;
- HINSTANCE m_hInst;
- };