• Advertisement
Sign in to follow this  

How to create meshes using programs?

This topic is 4398 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

Hi, GD's, I am working on a project. I need to automatically create 3D models based on some existing coordinates. Have looked at DirectX and MAXSDK. The only thing I found was class mesh in MAXSDK. Anybody has any sample program that creates mesh based on some existing data. Any comments are also very welcome. Thanks, Dan

Share this post


Link to post
Share on other sites
Advertisement
If you're using D3D, you can create mesh data and export it to the X format using the following process -

  1. Generate a vertex buffer and an index buffer.
  2. Create a mesh (D3DXCreateMesh).
  3. Copy the buffers into the mesh (using pointers from ID3DXBaseMesh::LockVertexBuffer and ID3DXBaseMesh::LockIndexBuffer)
  4. You'd then need to create an attribute buffer, which contains information about the faces (textures, materials, that sort of stuff). I haven't been able to find any resources on the contents of the attribute buffer or what kind of flags you can assign to the mesh. To access the attribute buffer use ID3DXMesh::LockAttributeBuffer.
  5. Finally, export the mesh to an X-format file with D3DXSaveMeshToX.


D3DX also contains a bunch of shape drawing functions to generate meshes from geometry (cylinders, spheres, etc) which you can then combine with D3DXConcatenateMeshes to form a single, complex mesh.

Share this post


Link to post
Share on other sites
Dear Mushu,

Would you please offer some pointers to some references, books/websites of directX with focus on my topics?

Thanks a million,
Dan

Share this post


Link to post
Share on other sites
Quote:
Original post by guodah
Hi, GD's,

I am working on a project. I need to automatically create 3D models based on some existing coordinates. Have looked at DirectX and MAXSDK. The only thing I found was class mesh in MAXSDK.

Anybody has any sample program that creates mesh based on some existing data. Any comments are also very welcome.

Thanks,
Dan


Have you looked into Blender? Blender is a free modeling tool, scriptable via python. You could use the Mesh module to create your model.
Hope that helps.

Share this post


Link to post
Share on other sites
Quote:
Original post by guodah
Dear Mushu,

Would you please offer some pointers to some references, books/websites of directX with focus on my topics?

The DXSDK is the only resource I've ever used or needed, and basically all of it is available online on MSDN. If you ever need other resources though, there's almost always plenty available in the DirectX Forum FAQ. I can't really be more specific though because I'm not quite sure I know what you're trying to do (ie, what kind of "data" you want to convert into a mesh).

Share this post


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

  • Advertisement