• Advertisement
Sign in to follow this  

[MDX] Generate a mesh from a vertex buffer?

This topic is 4184 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone... Lately I have been starting to play around with Managed DirectX. I have dug through a few tutorials and now have my Direct3D initialization code so that it handles different resolutions, multisample types, and fullscreen or windowed mode. I think I am about ready to do some actual rendering. So here is the question: Is it possible to load in mesh data into a vertex buffer (say, from a .txt file) and put it into a Mesh? (By Mesh, I mean the same classes that the .x files use). The reason I ask is that there seems to be a lot of good functionality for Meshes, such as functions like NormalizeNormals, and the ability to work with Optimized Meshes and Progressive Meshes. It would be a bit of a shame to simply ingore this functionality of the Mesh class and code a bunch of it myself if there was a simple way to load in a Mesh using data from one or more vertex buffers.

Share this post


Link to post
Share on other sites
Advertisement
isn't there some sort of example of this in the DirctX SDK??
say:

{SDK root}\Samples\C++\Direct3D\MeshFromOBJ

(exe:)

{SDK root}\Samples\C++\Direct3D\Bin\x86\MeshFromOBJ.exe

sorry if I've misread your question.

Note: It loads from a .obj file, but it's actually just vertex info in text (you can open it with Notepad)

(edit) And just yet I saw it.. you were looking for managed stuff, sorry.

Share this post


Link to post
Share on other sites
No problems. I will have to do somoe more digging into this.

Share this post


Link to post
Share on other sites
In case you haven't found it yet, you can use the VertexBuffer property on the mesh to retrieve a vertex buffer to put your data in directly. The SDK docs provide a simple example for that and over here you can find a more elaborate one that works with multiple attribute sets.

Hope this helps :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement