load texture or load image ??
Posted: Mon Jun 17, 2019 8:27 am
hello. im use ogre 1.12.0.
read file and filedata manual mesh create success.
i cant texture mapping.
error code, FileNotfoundException
Mycode
{
* * *
String strTexturePathName = "../../Resources/Mesh/";
strTexturePathName += vecSubSetInfo.at(i).strTextureFileName;
MaterialPtr pMaterial = MaterialManager::getSingleton().create(
strTexturePathName, "General", true);
Pass* pPass = pMaterial->getTechnique(0)->getPass(0);
TextureUnitState* pTexUnitState = pPass->createTextureUnitState();
Image img;
//1. error
img.load(strTexturePathName); // ex) strTexturePathName= ../../Resources/Mesh/abcdef.jpg
//2. error
TexturePtr pTexture = TextureManager::getSingleton().load(strTexturePathName, "General");
pTexUnitState->setTextureName(pTexture->getName());
sub->setMaterial(pMaterial);
}
i think path no problem.
but can't find path...
i hope runtime texture mapping. help me
read file and filedata manual mesh create success.
i cant texture mapping.
error code, FileNotfoundException
Mycode
{
* * *
String strTexturePathName = "../../Resources/Mesh/";
strTexturePathName += vecSubSetInfo.at(i).strTextureFileName;
MaterialPtr pMaterial = MaterialManager::getSingleton().create(
strTexturePathName, "General", true);
Pass* pPass = pMaterial->getTechnique(0)->getPass(0);
TextureUnitState* pTexUnitState = pPass->createTextureUnitState();
Image img;
//1. error
img.load(strTexturePathName); // ex) strTexturePathName= ../../Resources/Mesh/abcdef.jpg
//2. error
TexturePtr pTexture = TextureManager::getSingleton().load(strTexturePathName, "General");
pTexUnitState->setTextureName(pTexture->getName());
sub->setMaterial(pMaterial);
}
i think path no problem.
but can't find path...
i hope runtime texture mapping. help me