Converting Vertex and Index buffers to a File Format I have many sets of vertex and index buffers that I’d like to render on to the screen. Ideally each model in different locations with-in world space. I’m actually doing a statistical study on spatial relationships between models in world space. 

I have done a lot of reading on the DirectX graphics pipeline to try and get a basic understanding of how it works.

Instead of programming my own model viewer from the ground up, I thought I’d first take a look at some pre-built solutions first to save me the time. I found this: https://github.com/walbourn/directxtkmodelviewer

From what I can tell, it only supports loading models from DirectX SDK .SDKMESH files and .VBO files. So 2 questions:

1)  How do I convert my vertex and index buffers to one of those file formats?

2)  For changing the models world space in the viewer, isn’t that done by changing the view matrix before uploading the model? 

Also, if this can be done in standard 3D modeling application, that would be ideal. All I want to do is view the models in relation to each other. I haven’t been able to find any applications that accept vertex and index buffers in raw form though. 

Thank you.
No idea about DirectX, but in OpenGL the buffers are just a block of binary data so you can easily load and save them.

In any 3D framework, changing the object position to achieve a different relative arrangement of a scene is not done through the view matrix (that represents the camera position and viewing direction) but through the model matrix of each model. Note that the vertex and index buffers stay unaffected by matrix transformations, that is the main benefit of such pipelines.

Perhaps you could do your study with less effort using a 3D game engine, to list just a few:


https://godotengine.org/
https://www.unrealengine.com/
https://unity.com/


I am not aware that any of them would support loading the raw buffers straight away, but they can load OBJ files. OBJ is one of the oldest text-based 3D model formats. It has a simple structure, so you can easily convert your buffer data to an OBJ file.