Jump to content

  • Log In with Google      Sign In   
  • Create Account


What am i doing wrong? Loading models with directx(C++)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 thecdr   Members   -  Reputation: 102

Like
0Likes
Like

Posted 23 July 2012 - 04:35 PM

I was following the tutorials that comes with DirectX SDK, and i saw Tutorial6, which was about loading and showing meshes.I tried loading some .x files i made with sketchup and it worked fine. Then i decided to modify the code and allow it to load several models.
It didn't work. I believe it succesfully finds and loads the model. But it shows nothing on the screen.(Except the color i used to clear the screen) Can you look into the code and tell me what am i doing wrong?
I attached both of the original tutorial code and my modified one.
P.S sorry for my bad english
Attached File  meshproblem.rar   7.24KB   37 downloads

Sponsor:

#2 Alin   Members   -  Reputation: 391

Like
0Likes
Like

Posted 30 November 2012 - 09:08 AM

I do not have debugging your program, but I think you can modify the code in your function LoadModel and try agin.
if( FAILED( D3DXLoadMeshFromX( "modelname.x", D3DXMESH_SYSTEMMEM,
g_pd3dDevice, NULL,
&pD3DXMtrlBuffer, NULL, &model.g_dwNumMaterials,
&model.g_pMesh ) ) )
{
MessageBox( NULL, "Could not find modelname.x", "Meshes.exe", MB_OK );
return E_FAIL;
}

#3 Medo3337   Members   -  Reputation: 619

Like
0Likes
Like

Posted 30 November 2012 - 12:43 PM

You should be able to create array of LPD3DXMESH and load .x file in each one, then render them all.

LPD3DXMESH store the mesh geometry, other information you might need to store in the array is the texture data, etc...




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS