匯入 X檔案 靜態模型

2021-06-16 04:55:45 字數 972 閱讀 6859

先呼叫乙個函式d3dxloadmeshfromx( 檔名,風格屬性,d3d裝置指標,三角形面鄰接資訊緩衝區,材質和紋理資料緩衝區&m_pmaterialbuffer,特效屬性緩衝區,材質數g_dwnummaterials,(返回)建立的網格&m_pmesh)。

呼叫成功後, 獲取3d模型的材質和紋理資訊。

d3dxmaterial *d3dxmaterials = (d3dxmaterial*)m_pmaterialbuffer->getbufferpointer();

//建立材質

d3dmaterial9 *m_pmeshmaterials = new d3dmaterial9[g_dwnummaterials];

//建立紋理

lpdirect3dtexture9 *m_pmeshtextures = new lpdirect3dtexture9[g_dwnummaterials];//這裡注意:資料型別似乎必須為lpdirect3dtexture9,如果用idirect3ddevice9 似乎不行.

for( dword i = 0; i < g_dwnummaterials; i++)

m_pmeshmaterials[i] = d3dxmaterials[i].matd3d;

if( failed(d3dxcreatetexturefromfile( m_pdevice, d3dxmaterials[i].ptexturefilename, &g_pmeshtextures[i])))

m_pmeshtextures[i] = null;

//繪製網格模型

for( dword i = 0; i < g_dwnummaterials; i++)/

m_pdevice->setmaterial( &m_pmeshmaterials[i]);

m_pdevice->settexture( 0, m_pmeshtextures[i]);

m_pmesh->drawsubset(i);

SpringBoot2 X 靜態檔案配置

spring boot 缺省會挨個從 meta resources resources static public 裡面找是否存在相應的資源,如果有則直接返回。預設配置 spring.resources.static locations classpath meta inf resources cl...

vue匯入靜態js vue引入靜態js檔案的方法

由於一些演示,需要對編碼名稱等可快速進行修改,需要頁面方便配置。由於build後的vue專案基本已經看不出原樣,因此需要建立乙個檔案,並在打包的時候不會進行編譯。vue cli 2.0的作法是在static檔案下建立js。vue cli 3.0 的寫法則是直接在public資料夾下建立js 具體操作...

靜態模型,動態模型!

在上一節中的4.4 隱式型別轉換 強制 你知道,編譯器有時會隱式轉換乙個值從乙個資料型別到另乙個。當您想從乙個資料型別提公升到乙個更大的類似資料型別的值時,使用隱式型別轉換系統是好的。許多新的程式設計師嘗試這樣的東西 浮動f 10 4 然而,因為10和4都是整數,沒有公升級發生。在10 4上執行整數...