Jump to content
  • Advertisement
Sign in to follow this  
Clarity

Creating Meshes from scratch

This topic is 3777 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 guys, I am currently doing some work on C++ and I have gotten stuck trying to make a mesh using Verices and Indices information that I have imported from a bmp file. I have functions that create the buffers but i am not sure how to make it so I can import these into a mesh. Any help please. My base code is http://www.riemers.net/eng/Tutorials/DirectX/C++/Series1/tut14.php I need to know how to do this as I am struggling on finishing my conversions and it is driving me nutts Thanks Clarity

Share this post


Link to post
Share on other sites
Advertisement
Heres a good site for everything DX:
http://www.toymaker.info/Games/index.html

And heres what I think your looking for:
http://www.toymaker.info/Games/html/fvf.html

good luck

Share this post


Link to post
Share on other sites
Not quite what I need.

I have worked out that what I need to use is to build the Mesh object. I am pretty sure I can do this once i have worked out how to get it started. The class details are

Mesh Class (Microsoft.DirectX.Direct3D)
http://msdn.microsoft.com/en-us/library/bb296480.aspx#_dx_directx_graphics_create_a_mesh_object

The above link shows me how to use it in C# but i am struggling to work out how to get it working in C++.

Thanks for any help.

Share this post


Link to post
Share on other sites
If as i suspect I cannot create a mesh using what I mentioned previously I am pretty sure i need to use

D3DXCreateMeshFVF(NumDaces, NumVertices, Options, FVFdetails, Device, &Mesh)

with this in mind I have the following

D3DXCreateMeshFVF(((WIDTH-1)*(HEIGHT-1))*2,WIDTH*HEIGHT, D3DXMESH_MANAGED,
D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_DIFFUSE, p_dx_Device,&TerrainMesh);

however I am unsure how to import the vertices and indecies in. I have comands that collects this information and puts them into a buffer but i don't know how to make them a part of the mesh.

I found the following website which gives some clues but i am confussed as to how to get my data into the mesh
http://www.mvps.org/directx/articles/d3dxmesh.htm


Sorry for being such a noob

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!