我搜索过SO并且没有找到与基础知识有关的内容,一步一步解释。我们需要这个。
假设我只使用微软提供的DirectX SDK。
还假设我已经制作了.fbx
和.3ds
个模型并且在工作目录中是通用的,单色的,形状(立方体,球体,金字塔等)。
请将渲染过程压缩为使用directX函数的函数(如在,可编译),作为示例:
//the following is a suggestion, not a guideline for those who
//want to get into 3D programming.
vector<DX3DModel>modelsToBeRendered;
void bufferFrame(vector<DX3DModel>models){
while(1){
/* something something vertexes, lets say DX3DModel only contains vertexes
and a string as a file link
(Rendering code would make it very
messy in the question, but please include it in the answer.) */
//render models.end(); here
models.pop_back();
}
}
使用类似于上面的方法,我将如何(安全地)渲染单个&#34;区域中的所有其他演员?虽然仍然可以随意操纵顶点?
(Area是一个(AxBx1)模型,我们称之为field.fbx
。这是所有参与者存在的边界)
答案 0 :(得分:1)
Direct3D 11 API与OpenGL API非常相似,是一种低级渲染API,可以在包含点,线和三角形的构造上进行资源和绘制操作。它不是可以直接从3D编辑器加载或渲染模型文件的高级API,也不是固有的材质/效果系统。
如果您不熟悉DirectX 11,则应考虑使用DirectX Tool Kit作为一个很好的起点。您无法直接从3DS
或FBX
模型进行渲染,但您可以使用内置的Visual Studio内容管道转换为CMO
或使用{{ 3}}转换为SDKMESH
,这两个都可以通过 DirectX工具包加载。
使用 DirectX工具包,您可以使用Model
课程并获得与您的建议基本相似的内容。请参阅Samples Content Exporter,尤其是课程DirectX Tool Kit tutorial。
对于Direct3D 11开发,您应该强烈考虑 not 使用旧版DirectX SDK,因为它已被弃用。如果您使用的是VS 2012或更高版本,则不需要它。请参阅Rendering a model和Where is the DirectX SDK (2015 Edition)?。