If you get a pointer to a unknown mesh, how do you tarverse the vertex buffer?
like:
HRESULT Func( LPD3DXMESH pMesh )
{
[color=#ff0000]VERTEX* p = NULL;
pMesh->LockVertexBuffer( 0, &p );
.....
}
How do you define the [color=#ff0000]VERTEX mentioned above?
Your methods of traversing the vertex buffer of a unknown mesh ( DirectX)
How do you define the [color=#ff0000]VERTEX mentioned above?
You can't. What you can do is get the array of vertex elements with GetDeclaration, and use that to determine the stride of the vertices as well as the offset of any particular element within a single vertex.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement