• Advertisement
Sign in to follow this  

A question about X file

This topic is 4649 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

When the model's polygon more than 1000,it fails to load X file in my code,so does MeshViewr. I use 3d max and panda exporter. Can someone give me a tip? thanks.

Share this post


Link to post
Share on other sites
Advertisement
I've loaded models with more than 30,000 polygons, so I'm pretty sure it's not x-file related. You should try to narrow the problem down a bit and post the small section of code you think may be failing. Also, the Panda exporter has many flaws. You might want to consider changing to the Quest exportor or using the built-in SDK version.

Share this post


Link to post
Share on other sites
I'm having the same problem, I try loading a mesh with... I don't really know how many polygons and it fails, but I load a ball. and it's fine. Do you think is video card related. Some code.


VOID Table::Start(TABLE &Table)
{

LPD3DXBUFFER pD3DXMtrlBuffer;
Table.g_pMesh = NULL; // Our mesh object in sysmem
Table.g_pMeshMaterials = NULL; // Materials for our mesh
Table.g_pMeshTextures = NULL; // Textures for our mesh
Table.g_dwNumMaterials = 0L; // Number of mesh materials

// Load the mesh from the specified file
if( FAILED( D3DXLoadMeshFromX( Table.Table_Name.operator LPCTSTR(), D3DXMESH_SYSTEMMEM,
g_pd3dDevice, NULL, &pD3DXMtrlBuffer,
NULL, &Table.g_dwNumMaterials, &Table.g_pMesh ) ) )
{
// If model is not in current folder, try parent folder
if( FAILED( D3DXLoadMeshFromX( "table.x", //Table.Table_Name.operator LPCTSTR(),
D3DXMESH_SYSTEMMEM, g_pd3dDevice, NULL,
&pD3DXMtrlBuffer, NULL, &Table.g_dwNumMaterials,
&Table.g_pMesh ) ) )
{
MessageBox(NULL, "Could not find " + Table.Table_Name ,
"Meshes.exe", MB_OK);
{
Table.State = E_FAIL;
return;
}
}
}



here is where it fails...

any opinions...

Share this post


Link to post
Share on other sites
I've have this problem as well. I think its the exporter I use though, I use panda exporter it gives me other problems as well. [crying]

Where is the URL for this "Quest exporter?" I want to try it. [smile]

Share this post


Link to post
Share on other sites
Hey buddy, I just figured out what was happening, well my problem was, bad modeling... The thing is, when you draw a mesh it some times has doble points or doble lines... well, when this happens you get faces with less that 3 vertices.
In the x file the vert and the reference to those verts are made, but the face is not exported and the import fails.

I suggest you revise the model. If you are like me, a programmer that is trying to model something to put in a game. Try doing a lot of modeling tutorials so you know the best way to avoid this.

Best of luck...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement