Sign in to follow this  
Moe

[MDX] Generate a mesh from a vertex buffer?

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
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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this