模型的DX鼠标查看,可以参考一下
绑定的是World矩阵
#define DIRECTINPUT_VERSION 0x0800
#include <d3dx9.h>
#include <dinput.h>
#pragma comment(lib,"d3d9.lib")
#pragma comment(lib,"d3dx9.lib")
#pragma comment(lib,"dinput8.lib")
#pragma comment(lib,"dxguid.lib")
#pragma comment(lib,"winmm.lib")
#include <string>
#include <tchar.h>
#include <sstream>
#include <cmath>
#include <ctime>
using namespace std;
#pragma warning( disable : 4996 )
#include <strsafe.h>
#pragma warning( default : 4996 )
#ifdef _UNICODE
#define TSTRING wstring
#define TSSTREAM wstringstream
#else
#define TSTRING string
#define TSSTREAM stringstream
#endif
#ifndef SAFERELEASE
#define SAFERELEASE(s) if(s){s->Release();s=NULL;}
#endif
#define WINDOW_WIDTH 800
#define WINDOW_HEIGHT 600
#define WINDOW_CLASSNAME TEXT("CLASS")
#define WINDOW_NAME TEXT("窗口")
HWND g_hWnd;
HINSTANCE g_hInstance;
LPDIRECT3D9 g_pD3D = NULL;
LPDIRECT3DDEVICE9 g_pd3dDevice = NULL;
LPD3DXFONT g_pFont = NULL;
char name[MAX_PATH+1]={0};
bool draw=false;
//开始类
class CXModel
{
public:
explicit CXModel(void):m_fAngleX(0.0F),m_fAngleY(0.0F),m_fAngleZ(0.0F)
,m_numMaterials(0UL)
{
m_model = NULL;
m_matBuffer = NULL;
m_matList = NULL;
m_textureList = NULL;
memset(&m_vXYZ,0,sizeof(D3DXVECTOR3));
m_vXYZ.z=5.0F;
}
virtual ~CXModel(void)
{
SAFERELEA****odel)
for(DWORD i = 0; i < m_numMaterials; i++)
{