ID3DXBaseMesh interface

Started by
1 comment, last by derek7 18 years ago
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.
Advertisement
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

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?

This topic is closed to new replies.

Advertisement