Jump to content
  • Advertisement
Sign in to follow this  
derek7

ID3DXBaseMesh interface

This topic is 4474 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!