xboxscene.org forums

OG Xbox Forums => Software Forums => Development => Topic started by: JbOnE on March 31, 2004, 03:18:00 PM

Title: Xbmesh/xbresource Pain-in-the-(cl)ass
Post by: JbOnE on March 31, 2004, 03:18:00 PM
anyone get these classes to work for them yet ?
i got it putting the mesh on screen - but totally void of the 100% perfectly ready to use texture that belongs on it.
DO NOT reply look at.. gamepad, dolphin, any other damn tut in there - cuz i'm doin the exact same thing they all do - but still no textures. (and yes xbg and xpr are correctly made and work in other projects)



CXBPackedResource cubeResource;
CXBMesh theCube;

HRESULT InitGeometry()
{
   
   if( FAILED( cubeResource.Create( "D:\\Media\\cube.xpr" )) )
       return E_FAIL;

   if( FAILED( theCube.Create( "D:\\Media\\cube.xbg", &cubeResource )) )
       return E_FAIL;


   return S_OK;
}

then in main loop call to ...

VOID Render()
{

   g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,
                        D3DCOLOR_XRGB(0,0,63), 1.0f, 0 );

   SetupMatrices();
   theCube.Render();

   g_pd3dDevice->Present( NULL, NULL, NULL, NULL );

}


according to ms's comments - the 2nd if there should create the mesh (it does) with the texture in the referenced resource (it does NOT)  - textures are MIA and i got a grey ass cube - any input ?? me and my keyboard thk you for your help (it's already lost 6 keys - who said programming couldn't be a contact sport hehe)
Title: Xbmesh/xbresource Pain-in-the-(cl)ass
Post by: BenJeremy on March 31, 2004, 04:13:00 PM
I believe you still need to load the textures manually and then SetTexture() (for each subobject, and multiple stages, if it's a multitexture)

Title: Xbmesh/xbresource Pain-in-the-(cl)ass
Post by: JbOnE on March 31, 2004, 05:28:00 PM
from the end of CXBMesh::Create
Title: Xbmesh/xbresource Pain-in-the-(cl)ass
Post by: BenJeremy on April 01, 2004, 01:16:00 AM
UnleashX.... correct me if I'm wrong here, but the resource doesn't HAVE to be cube.bmp. That's a reference tot he original model's texture, the subset information is there to tell you which one to use, but you can substitute any valid texture you wanted with the SetTexture call.

Title: Xbmesh/xbresource Pain-in-the-(cl)ass
Post by: JbOnE on April 01, 2004, 04:56:00 AM
smile.gif i'll definitely tinker some more tonight to see if i can't get it right - odd though that the xbg/xpr work fine if i put them in one of the tut's - but i'll definitely write it to make new ones seeing as how that has to be where the problem lies. hopefully have a textured mesh tonight smile.gif

pEAcE
JbOnE