將 3d 模型導入 Direct3D 11 示例 (Importing 3d model to Direct3D 11 Example)


問題描述

將 3d 模型導入 Direct3D 11 示例 (Importing 3d model to Direct3D 11 Example)

I'm building an WP8 app with Direct3D 11, and need to load 3dModel.

I know how to load it in XNA, but XNA is not valid for WP8 :|

I need an example of how to load a 3d model in Direct3D 11.

‑‑‑‑‑

參考解法

方法 1:

Wavefront OBJ is a very simple and widely supported format for static 3D models. Writing a cusom importer is not difficult.

I have written a Wavefront Importer for C#. It covers the most basic features of OBJ files (sub meshes; vertex positions, normals and texture coordinates). I do not guarantee that any of this works, it should just serve as an example on how to implement a custom mesh importer. I am using SlimDX's Vector types. You can replace them with vectors from your framework of choice.

方法 2:

Visual Studio 2012 is able to load FBX and OBJ files itself and compiles them to CMO format.

For reading CMO format and every other things you can use the sample below.

http://code.msdn.microsoft.com/windowsapps/Visual‑Studio‑3D‑Starter‑455a15f1

(by Mostafa El‑AbadyLuciusGökhan Şengün)

參考文件

  1. Importing 3d model to Direct3D 11 Example (CC BY‑SA 3.0/4.0)

#direct3d11 #directx-11 #C++ #3d-model #windows-phone-8






相關問題

Адлюстраванне дынамічнага буфера ў Direct3D11 у праграме Windows Store (Mapping a dynamic buffer in Direct3D11 in a Windows Store App)

未處理的異常@ClearRenderTargetView() (Unhandled exception @ ClearRenderTargetView())

將 3d 模型導入 Direct3D 11 示例 (Importing 3d model to Direct3D 11 Example)

編譯器不允許我使用“DDSTextureLoader.h”和“WICTextureLoader.h” (Compiler won't let me use "DDSTextureLoader.h" and "WICTextureLoader.h")

在我從舊版 DirectX SDK 更改為 Windows SDK (Visual Studio 2015) 後,鏈接器一直在抱怨 (The linker keeps complaining after I changed from legacy DirectX SDK to Windows SDK (Visual Studio 2015)))

鏈接器給出了我在我的應用程序中根本沒有使用過的函數的錯誤 (Linker gives errors about a function that i have not used in my application at all)

Direct3D 11 中輸出圖像的雙線性過濾 (Bilinear filtering of output image in Direct3D 11)

Direct3D 編程新手:11 與 12 (New to Direct3D programming: 11 vs 12)

如何在 Direct3D 11 上使用字體文件渲染文本? (How can I render text using font files on Direct3D 11?)

獲取 D3D 調試信息? (Get D3D debug information?)

為什麼 XMMatrixLookAtLH 會導致調試錯誤? (Why does XMMatrixLookAtLH result in a debug error?)

InterlockedAdd HLSL 潛在優化 (InterlockedAdd HLSL potential optimization)







留言討論