Direct3D 9学习笔记(11)网格(Mesh)2
2012-08-20 14:03
411 查看
七.网格优化
参数解释:
示例:
// // Optimize the mesh to generate an attribute table. // std::vector<DWORD> adjacencyBuffer(Mesh->GetNumFaces() * 3); Mesh->GenerateAdjacency(0.0f, &adjacencyBuffer[0]); hr = Mesh->OptimizeInplace( D3DXMESHOPT_ATTRSORT | D3DXMESHOPT_COMPACT | D3DXMESHOPT_VERTEXCACHE, &adjacencyBuffer[0], 0, 0, 0);
八.属性表
九.邻接信息
示例:
void dumpAdjacencyBuffer(std::ofstream& outFile, ID3DXMesh* mesh) { outFile << "Adjacency Buffer:" << std::endl; outFile << "-----------------" << std::endl << std::endl; // three enttries per face std::vector<DWORD> adjacencyBuffer(mesh->GetNumFaces() * 3); mesh->GenerateAdjacency(0.0f, &adjacencyBuffer[0]); for(int i = 0; i < mesh->GetNumFaces(); i++) { outFile << "Triangle's adjacent to triangle " << i << ": "; outFile << adjacencyBuffer[i * 3 ] << " "; outFile << adjacencyBuffer[i * 3 + 1] << " "; outFile << adjacencyBuffer[i * 3 + 2] << std::endl; } outFile << std::endl << std::endl; }
十.网格克隆
HRESULT CloneMesh( [in] DWORD Options, [in] const D3DVERTEXELEMENT9 *pDeclaration, [in] LPDIRECT3DDEVICE9 pDevice, [out, retval] LPD3DXMESH *ppCloneMesh );
相关文章推荐
- Direct3D 9学习笔记(10)网格(Mesh)1
- Direct3D 9学习笔记(12)网格(Mesh)3
- Direct3D 9学习笔记(13)网格(Mesh)4
- DirectX 11游戏编程学习笔记之7: 第6章Drawing in Direct3D(在Direct3D中绘制)(重点回顾+勘误)
- Direct3D 11 学习笔记(二)
- Introduction to 3D Game Programming with DirectX 11学习笔记 6 Direct3D中的绘制(四)渲染状态
- DirectX 11游戏编程学习笔记之8: 第6章Drawing in Direct3D(在Direct3D中绘制)(习题解答)
- DirectX 11游戏编程学习笔记之5: 第4章Direct3D Initialization(Direct3D初始化)
- DirectX 11游戏编程学习笔记之8: 第6章Drawing in Direct3D(在Direct3D中绘制)(习题解答)
- Introduction to 3D Game Programming with DirectX 11学习笔记 4.2Direct3D进行初始化
- Introduction to 3D Game Programming with DirectX 11学习笔记 6 Direct3D中的绘制(一)
- Direct3D 11 学习笔记(一)
- Introduction to 3D Game Programming with DirectX 11学习笔记 6 Direct3D中的绘制(二)顶点着色器
- 【DirectX 11 SDK 学习笔记】Direct3D 11 Basics
- Introduction to 3D Game Programming with DirectX 11学习笔记 6 Direct3D中的绘制(三)像素着色器
- ARM学习笔记11——GNU ARM汇编程序设计
- C++学习笔记11:定位new运算符
- 【DirectX 11 SDK 学习笔记】Shaders and Effect System
- 【】windows phone7 学习笔记11——启动器与选择器
- JavaWeb学习笔记-java基础-11-打印M格式