Sign in to follow this  
derek7

ID3DXBaseMesh interface

Recommended Posts

I use D3DXLoadMeshHierarchyFromX to load mesh that exported from maya . I found D3DXMESHCONTAINER has mesh, D3DXFRAME::pMeshContainer::MeshData::pMesh; but GetFVF() get 0, why? here is code snipet
	if (FAILED(D3DXLoadMeshHierarchyFromX(m_filename.c_str(), D3DXMESH_MANAGED,
								device, &allocMeshHierarchy, 0, /* ignore user data */ 
								&m_root/*hierarchy here!!*/,	&m_animCtrl))) 
		MessageBox(0," load mesh fail", 0, 0);

	//	复制出 and process mesh material...
	D3DXFRAME* f = findNodeWithMesh(m_root);
	if( f == 0 ) MessageBox (0,"no mesh",0,0);

	//	copy mesh to m_D3DXmesh
	D3DXMESHCONTAINER* C = f->pMeshContainer;
	ID3DXMesh *t = C->MeshData.pMesh;
	DWORD r = t->GetFVF();
	if(FAILED(t->CloneMeshFVF(D3DXMESH_MANAGED, t->GetFVF(), device, &m_D3DXmesh)))
	{
		::MessageBox(0,"CLONE MESH FAILED!",0,0);
	}

it work for some .x file ,but fail to work other .x file. but directx mview.exe all work.

Share this post


Link to post
Share on other sites
It is perfectly valid to have a "FVF-less" vertex buffer (and mesh). Try looking at ID3DXBaseMesh::GetDeclaration() instead. Then use the regular CloneMesh() instead of CloneMeshFVF()

FVF's can describe a lot of vertex formats, but vertex declarations have pretty much superceded them.

hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
It is perfectly valid to have a "FVF-less" vertex buffer (and mesh). Try looking at ID3DXBaseMesh::GetDeclaration() instead. Then use the regular CloneMesh() instead of CloneMeshFVF()

FVF's can describe a lot of vertex formats, but vertex declarations have pretty much superceded them.

hth
Jack


It is perfectly valid to have a "FVF-less" vertex buffer (and mesh). ??

what does it mean? if you create vertex buffer you must give a fvf.
right?

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