Jump to content
  • Advertisement
Sign in to follow this  
lucky6969b

3D How to tell which face of a ID3DXMesh is mapped to which material slot?

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

Just didn't know why when I try to retrieve the attribute table from the m_pOrigMesh after it gets loaded, it reports zero attributes, only after I setup the subsets, that is the attribute table manually.   I would like to first assign the original materials to the attribute table or buffer an initial value, and when I want to change certain parts, I alter the table. But since I don't have this information handy, that is which face is mapping to which material slot, when I make up a certain material for a certain subset, I need to make up the rest of the material mapping, which the original intentions were no change.

Any ideas?

Thanks

Jack

 

	if (FAILED(D3DXLoadMeshFromXA(pFilename, D3DXMESH_MANAGED, d3d::GetInstance().GetDevice(),
            NULL, &l_buff, NULL, &numMats, &m_pOrigMesh)))
        {    
            cout << "Failed to load mesh: " << pFilename << endl;
            throw(cError);
	        }
    }
    else
    {        
        cout << "Failed to load mesh: " << pFilename << endl;
        throw(cError);
    }
	 
    D3DXMATERIAL* _mats = (D3DXMATERIAL*)l_buff->GetBufferPointer();    
	    DWORD numFaces = m_pOrigMesh->GetNumFaces();
	  
Edited by lucky6969b

Share this post


Link to post
Share on other sites
Advertisement
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!