Skip to main content
gamedev.net
🔒 Locked

Creating Meshes from scratch

Started by Clarity Jul 12, 2008 at 1:26 PM 2 replies 700+ views
Original Post
Clarity
Clarity
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
Clarity
Clarity
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.
Clarity
Clarity
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.