문제

Quick question, how do i load a .obj modle into directx 11 (d3d11.h) and also the .mtl file for materials. Thanks in advance.

도움이 되었습니까?

해결책

You can write your own parser, obj is a pretty simple text format (format description)

Otherwise some loaders already exists, like Assimp .It only deals with decoding, you will still need to create vertex/index buffers from decoded data.

다른 팁

DirectX no longer comes with any libraries to load object files, such as *.obj, *.x and so on after version 9. You need to either download a library to open these files, or do it yourself since OBJ files are reasonably simple to parse.

See here for an example of this using OpenGL: http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Load_OBJ - the concepts should be reasonably easy to transition across.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top