Skip to main content
GameDev.net gamedev.net
🔒 Locked

.X File validation Help please

Started by ankhd Mar 13, 2007 at 3:54 AM 3 replies 750+ views
Original Post
ankhd
ankhd
this data id from a house I created in 3dsmax9 and exported with the pandaExporter MeshMaterialList { 1; 12; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; { RoofMat } } MeshTextureCoords { 20; 1.000000;1.000000;, 0.000000;1.000000;, 1.000000;0.000000;, 0.000000;0.000000;, 0.000000;1.000000;, 1.000000;1.000000;, 0.000000;0.000000;, 1.000000;0.000000;, 0.000000;1.000000;, 1.000000;1.000000;, 1.000000;0.000000;, 0.000000;0.000000;, 1.000000;1.000000;, 0.000000;0.000000;, 0.000000;1.000000;, 1.000000;1.000000;, 1.000000;0.000000;, 0.000000;0.000000;, 0.000000;1.000000;, 1.000000;0.000000;; } } but when I render it its all gray. the materials in 3dsmax is just a tile material put to a wall. Any way does this look ok and if so would it be in the code for loading a mesh
Alex-R
Alex-R
How are you rendering this mesh? I'd like to look at the code.
Arex
Arex
Are you using shaders?

Anyway, you might have forgotton to :
1) Set active texture. (use SetTexture)
2) Use texture in the shader. ( for example : color += tex2D(BaseSampler, textureUV); )
ankhd
ankhd
Hi, here is the render for this mesh object and no shaders yet don't get this yet
DrawMeshContainer(LPDIRECT3DDEVICE9 device,
LPD3DXMESHCONTAINER meshContainerBase, LPD3DXFRAME frameBase) const
{
if(device == NULL)
return;

// Cast to our extended frame type
D3DXFRAME_EXTENDED *frame = (D3DXFRAME_EXTENDED*)frameBase;

// Cast to our extended mesh container
D3DXMESHCONTAINER_EXTENDED *meshContainer = (D3DXMESHCONTAINER_EXTENDED*)meshContainerBase;

// Set the world transform
device->SetTransform(D3DTS_WORLD, &frame->exCombinedTransformationMatrix);

// Loop through all the materials in the mesh rendering each subset
for (UINT iMaterial = 0; iMaterial < meshContainer->NumMaterials; iMaterial++)
{
// use the material in our extended data rather than the one in meshContainer->pMaterials[iMaterial].MatD3D
device->SetMaterial( &meshContainer->exMaterials[iMaterial] );
device->SetTexture( 0, meshContainer->exTextures[iMaterial] );

//device->SetRenderState(D3DRS_FILLMODE,D3DFILL_WIREFRAME );// D3DFILL_SOLID
// Select the mesh to draw, if there is skin then use the skinned mesh else the normal one
LPD3DXMESH pDrawMesh = (meshContainer->pSkinInfo) ? meshContainer->exSkinMesh: meshContainer->MeshData.pMesh;

// Finally Call the mesh draw function
pDrawMesh->DrawSubset(iMaterial);
Alex-R
Alex-R
In your file there is no information about texture.
(such as FileName). See in the exporter settings to include this info into your file.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.