資源簡介
這是一個項(xiàng)目時使用到的"三維空間向量/點(diǎn)"類及相關(guān)函數(shù),使用它們可以定義一個空間向量/點(diǎn),實(shí)現(xiàn)向量的平移,縮放和旋轉(zhuǎn)等,使用相關(guān)函數(shù)還可以實(shí)現(xiàn)兩向量的叉乘,得到一個向量的絕對長度,將一個向量單位化,得到一個三點(diǎn)決定的平面的垂直向量(經(jīng)過單位化),得到空間中兩點(diǎn)的距離,得到兩向量的點(diǎn)積,得到兩向量的夾角等操作,為方便用戶的使用,每個函數(shù)都有詳細(xì)的注釋,希望對大家有所用處.

代碼片段和文件信息
//?ControlWnd.cpp?:?implementation?file
//
#include?“stdafx.h“
#include?“Test1.h“
#include?“ControlWnd.h“
#include?“ProjectView.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CControlWnd
IMPLEMENT_DYNCREATE(CControlWnd?CFormView)
extern?GLfloat??xrofyrofzrof;
extern?bool???gbDataIsEmpty;
CControlWnd::CControlWnd()
:?CFormView(CControlWnd::IDD)
{
//{{AFX_DATA_INIT(CControlWnd)
m_nxZoom?=?60;
m_nyZoom?=?5;
m_nzZoom?=?10;
m_nMaxrange?=?0.0f;
m_nMinrange?=?0.0f;
//}}AFX_DATA_INIT
m_bShowCoordinate?=?true;
this->m_bShowConsult?=?true;?
m_bXpWnd?=?false;
pWnd?=?NULL;
}
CControlWnd::~CControlWnd()
{
if?(pWnd)
{
delete?pWnd;
pWnd?=?NULL;
}
}
void?CControlWnd::DoDataExchange(CDataExchange*?pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CControlWnd)
DDX_Control(pDX?IDC_ZOOMBACK?m_ZoomBack);
DDX_Control(pDX?IDC_ZOOMDEL?m_ZoomDel);
DDX_Control(pDX?IDC_ZOOMADD?m_ZoomAdd);
DDX_Control(pDX?IDC_SHOWTPWND?m_ShowXpWnd);
DDX_Control(pDX?IDC_SHOWDATAWND?m_ShowDataWnd);
DDX_Control(pDX?IDC_MINRANGE?m_Minrange);
DDX_Control(pDX?IDC_MAXRANGE?m_Maxrange);
DDX_Control(pDX?IDC_CLEAR_DATA?m_Clearbtn);
DDX_Control(pDX?IDC_VIEWPIC?m_Viewpicbtn);
DDX_Control(pDX?IDC_SETDEFAULT?m_SetDefaultbtn);
DDX_Control(pDX?IDC_GETDATA?m_GetDatabtn);
DDX_Control(pDX?IDC_PICVALUE?m_PicValue);
DDX_Control(pDX?IDC_ALLVALUE?m_AllValue);
DDX_Control(pDX?IDC_ZZOOM?m_zZoom);
DDX_Control(pDX?IDC_YZOOM?m_yZoom);
DDX_Control(pDX?IDC_XZOOM?m_xZoom);
DDX_Text(pDX?IDC_XZOOM?m_nxZoom);
DDX_Text(pDX?IDC_YZOOM?m_nyZoom);
DDX_Text(pDX?IDC_ZZOOM?m_nzZoom);
DDX_Text(pDX?IDC_MAXRANGE?m_nMaxrange);
DDX_Text(pDX?IDC_MINRANGE?m_nMinrange);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CControlWnd?CFormView)
//{{AFX_MSG_MAP(CControlWnd)
ON_BN_CLICKED(IDC_VIEWPIC?OnViewpic)
ON_LBN_DBLCLK(IDC_ALLVALUE?OnDblclkAllvalue)
ON_LBN_DBLCLK(IDC_PICVALUE?OnDblclkPicvalue)
ON_BN_CLICKED(IDC_SETDEFAULT?OnSetdefault)
ON_BN_CLICKED(IDC_RADIOTURN?OnRadioturn)
ON_BN_CLICKED(IDC_RADIOSELECT?OnRadioselect)
ON_BN_CLICKED(IDC_GETDATA?OnGetdata)
ON_BN_CLICKED(IDC_CLEAR_DATA?OnClearData)
ON_WM_CTLCOLOR()
ON_BN_CLICKED(IDC_SHOWDATAWND?OnShowdatawnd)
ON_BN_CLICKED(IDC_CHECKCONSULT?OnCheckconsult)
ON_BN_CLICKED(IDC_CHECKCOOLDINATE?OnCheckcooldinate)
ON_BN_CLICKED(IDC_RADIOTURNX?OnRadioturnx)
ON_BN_CLICKED(IDC_RADIOTURNY?OnRadioturny)
ON_BN_CLICKED(IDC_RADIOTURNZ?OnRadioturnz)
ON_BN_CLICKED(IDC_SHOWTPWND?OnShowTpWnd)
ON_BN_CLICKED(IDC_ZOOMADD?OnZoomAdd)
ON_BN_CLICKED(IDC_ZOOMDEL?OnZoomdel)
ON_BN_CLICKED(IDC_ZOOMBACK?OnZoomback)
ON_BN_CLICKED(IDC_CHECKLIGHTING?OnChecklighting)
//}}AFX_MSG_MAP
ON_MESSAGE(MESSAGE_ENABLEBTNEnableButton)
ON_MESSAGE(MESSAGE_DISABLEBTN?DisableBu
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????7169??2002-12-26?12:00??三維繪圖\MainFrm.cpp
?????文件???????2340??1999-11-30?08:48??三維繪圖\Include\AutoFont.h
?????文件???????4230??2002-12-21?21:54??三維繪圖\Include\WBButton.h
?????文件???????1781??2002-12-24?10:39??三維繪圖\Include\XTPWnd.h
????..AD...?????????0??2003-04-04?19:34??三維繪圖\Include
?????文件????????156??2002-12-24?09:49??三維繪圖\MagWnd\MagWnd.clw
?????文件???????1435??2007-08-02?15:30??三維繪圖\MagWnd\MagWnd.cpp
?????文件????????184??2002-12-24?09:49??三維繪圖\MagWnd\MagWnd.def
?????文件???????4637??2002-12-24?20:03??三維繪圖\MagWnd\MagWnd.dsp
?????文件???????3065??2002-12-24?09:49??三維繪圖\MagWnd\MagWnd.rc
?????文件????????398??2002-12-24?09:49??三維繪圖\MagWnd\res\MagWnd.rc2
????..AD...?????????0??2003-04-04?19:34??三維繪圖\MagWnd\res
?????文件????????378??2002-12-24?09:49??三維繪圖\MagWnd\Resource.h
?????文件????????208??2002-12-24?09:49??三維繪圖\MagWnd\StdAfx.cpp
?????文件???????1447??2002-12-24?09:49??三維繪圖\MagWnd\StdAfx.h
?????文件???????4823??2007-08-02?15:30??三維繪圖\MagWnd\XTPWnd.cpp
????..AD...?????????0??2007-08-02?15:21??三維繪圖\MagWnd
?????文件??????18270??2002-12-21?09:39??三維繪圖\res\ButtonsWin3000.bmp
?????文件???????1078??2002-12-17?16:57??三維繪圖\res\Test1.ico
?????文件????????397??2002-12-17?16:57??三維繪圖\res\Test1.rc2
?????文件???????1078??2002-12-17?16:57??三維繪圖\res\Test1Doc.ico
?????文件???????1078??2002-12-24?11:16??三維繪圖\res\Toolbar.bmp
????..AD...?????????0??2003-04-04?19:34??三維繪圖\res
?????文件???????7542??2000-05-22?10:57??三維繪圖\XpButton\AutoFont.cpp
?????文件????????400??2002-12-21?10:31??三維繪圖\XpButton\res\XpButton.rc2
????..AD...?????????0??2003-04-04?19:34??三維繪圖\XpButton\res
?????文件????????380??2002-12-21?10:31??三維繪圖\XpButton\Resource.h
?????文件????????210??2002-12-21?10:31??三維繪圖\XpButton\StdAfx.cpp
?????文件???????1447??2002-12-21?10:31??三維繪圖\XpButton\StdAfx.h
?????文件???????8658??2002-12-22?23:28??三維繪圖\XpButton\WBButton.cpp
............此處省略42個文件信息
- 上一篇:off三維模型
- 下一篇:SAP BTE (簡單明了)
評論
共有 條評論