rendering a mesh .x that has a bitmap materials
i am trying to render a .x that was created in 3d max , but when i draw the mesh it does not apear on screen , yet if i load a .x that has just not bitmap materials and just normal color it gets displayed , i am thinking there needs to be render state to be able to see the mesh with bitmap texture?
get the materials then loop through in a for loop calling drawsubsets , i cant paste the code now as i am not at home ,
am i suppose to be loading a texture? , but the texture should be supplied in the .x which would be the materiel of the mesh
are you suppose to use SetTexture as well as setting the materials?
i thought the bitmap thats on my .x is the material ,
am i suppose to be loading a texture? , but the texture should be supplied in the .x which would be the materiel of the mesh
are you suppose to use SetTexture as well as setting the materials?
i thought the bitmap thats on my .x is the material ,
Quote:Original post by AnddosThe .X file contains only the filename of the texture. It does not contain the actual texture data itself. So you need to call D3DXCreateTextureFromFile() and then during your loop over the subsets call the appropriate SetTexture().
am i suppose to be loading a texture? , but the texture should be supplied in the .x which would be the materiel of the mesh
are you suppose to use SetTexture as well as setting the materials?
hth
Jack
Quote:Original post by AnddosYou need to load the textures yourself, they're not embedded in the .x file - it just contains the mesh data.
i am loading the textures the same , get the materials then loop through in a for loop calling drawsubsets , i cant paste the code now as i am not at home ,
am i suppose to be loading a texture? , but the texture should be supplied in the .x which would be the materiel of the mesh
are you suppose to use SetTexture as well as setting the materials?
i thought the bitmap thats on my .x is the material ,
I don't sue .x files, so I can't tell you how to do that offhand, but there's pleanty of examples in the SDK.
so lets say i want to draw to a certain subset of the mesh ,
if i have load a texture that is a face of a person and the mesh is a shape of a person , how will i know which subset the head is so the texture fits perfectly on the head? ,
if i have load a texture that is a face of a person and the mesh is a shape of a person , how will i know which subset the head is so the texture fits perfectly on the head? ,
ISTR that when you load the mesh, each subset has material data, and has a texture name as one of the parameters. Then you load each texture, and apply it before rendering the subset.
Have a look at the SDKmesh.cpp file in DirectX SDK\Samples\C++\DXUT\Optional\SDKmesh.cpp, it shows how to load textures (There might be a better reference, I don't know).
Have a look at the SDKmesh.cpp file in DirectX SDK\Samples\C++\DXUT\Optional\SDKmesh.cpp, it shows how to load textures (There might be a better reference, I don't know).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement