added support for texture-mapping

This commit is contained in:
granzuglia 2006-11-06 09:31:43 +00:00
parent f0b3eeb258
commit c64e319d7b
2 changed files with 17 additions and 2 deletions

View File

@ -238,6 +238,19 @@ namespace io {
}
else return E_NOMESH;
}
static void GetTexture(const QDomDocument& doc,AdditionalInfoDAE* inf)
{
QDomNodeList txlst = doc.elementsByTagName("library_images");
for(int img = 0;img < txlst.size();++img)
{
QDomNodeList nlst = txlst.at(img).toElement().elementsByTagName("init_from");
if (nlst.size() > 0)
{
inf->dae->texturefile.push_back(nlst.at(0).firstChild().nodeValue());
}
}
}
public:
//merge all meshes in the collada's file in the templeted mesh m
@ -261,6 +274,8 @@ namespace io {
file.close();
info->doc = doc;
//GetTexture(*(info->doc),inf);
QDomNodeList& scenes = info->doc->elementsByTagName("scene");
int scn_size = scenes.size();
if (scn_size == 0)
@ -369,7 +384,7 @@ namespace io {
info->doc = doc;
GetTexture(*(info->doc),inf);
QDomNodeList& scenes = info->doc->elementsByTagName("scene");
int scn_size = scenes.size();

View File

@ -37,7 +37,7 @@ namespace io {
}
QDomDocument* doc;
std::vector<std::string> texturefile;
std::vector<QString> texturefile;
};
class AdditionalInfoDAE : public AdditionalInfo