Sign in to follow this  
simotix

Hand write a mesh

Recommended Posts

You can manually create a mesh using function

HRESULT D3DXCreateMesh(
DWORD NumFaces,
DWORD NumVertices,
DWORD Options,
CONST LPD3DVERTEXELEMENT9 * pDeclaration,
LPDIRECT3DDEVICE9 pD3DDevice,
LPD3DXMESH * ppMesh
);

This function creates a mesh and alocates memory. Then you just lock the vertex/index buffer and copy vertices/indices.

Share this post


Link to post
Share on other sites
Quote:
Original post by amigocz
This function creates a mesh and alocates memory. Then you just lock the vertex/index buffer and copy vertices/indices.
The default attribute table and buffer should be fine, but you may also need to alter these if you're generating your own geometry.

hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
Quote:
Original post by amigocz
This function creates a mesh and alocates memory. Then you just lock the vertex/index buffer and copy vertices/indices.
The default attribute table and buffer should be fine, but you may also need to alter these if you're generating your own geometry.

hth
Jack


Well if I only wanted to have a simple rectangle, how would I do that?

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