Another Texture Problem
#2
I find this very strange.

Are you sure that the texture file is in the same folder as the 3ds file (C:/Documents and Settings/p00009656/Desktop/3d Models).

The Reader3ds automatically searches for the texture files in the same folder (if TexturesPath is not set). So it should be enough to put the texture files in the same folder as 3ds file and call ReadFile method.

Sometimes the cause of such problems is that the texture file names in 3ds file are stored only with 8 characters. So if your texture file name is longer than 8 characters, the file would not be found by Reader3ds because in 3ds file the file names is truncated.

Such problems can be found by setting ThrowMissingTextureException to true. In this case the Reader3ds would throw an Reader3ds.MissingTextureException exception with missing file name. This way you can get the file name that is causing problems and display it.

The following code displays the missing file name and than reads the 3ds file again with ThrowMissingTextureException set to false (the code sample is from the help file for the ThrowMissingTextureException property):

Code:
Ab3d.Reader3ds newReader3ds;
Model3DGroup buttonModel3DGroup;

newReader3ds = new Ab3d.Reader3ds();
newReader3ds.ThrowMissingTextureException = true;

try
{
    buttonModel3DGroup = newReader3ds.ReadFile("c:\\models\\button.3ds");
}
catch (Reader3ds.MissingTextureException e)
{
    MessageBox.Show("Missing texture: " + e.MissingTextureFileName);
    newReader3ds.ThrowMissingTextureException = false;
    buttonModel3DGroup = newReader3ds.ReadFile("c:\\models\\button.3ds");
}


I would advice you to use the code and check if the file is really present.
Andrej Benedik
  


Messages In This Thread
Another Texture Problem - by Bryan Gabric - 08-26-2010, 04:34 PM
RE: Another Texture Problem - by abenedik - 08-27-2010, 04:43 PM
RE: Another Texture Problem - by Bryan Gabric - 08-27-2010, 05:46 PM
RE: Another Texture Problem - by abenedik - 08-28-2010, 10:25 PM
RE: Another Texture Problem - by Bryan Gabric - 08-28-2010, 10:37 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)