How set more that one texture...
Posted: Wed Jul 07, 2004 11:52 pm
Hi all! I come back with new problems:))) I with DeleD editor create simple map. This map have two textures. I with LithUnwrap change material names and then load with Irrlicht. Geometry loads perfecty, but map has only one texture on it. I think it is problem with setMaterialTexture(). How to fix it? Does setMaterilaTexture(0, driver->getTexture("texture.bmp")) texture layer don't work? Any suggestions?
My code
-----------------------------------------------------------------------
#include <irrlicht.h>
using namespace irr;
#pragma comment (lib, "Irrlicht.lib")
int main()
{
IrrlichtDevice* device = createDevice(video::EDT_DIRECTX8,
core::dimension2d<s32>(640,480),16, false, false);
scene::ISceneManager* smgr = device->getSceneManager();
video::IVideoDriver* driver = device->getVideoDriver();
device->setWindowCaption(L"Project: Bandymai");
scene::ISceneNode* node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("bandymas.x"));
if (node)
{
b]node->setMaterialTexture(0, driver->getTexture("BRICK4.BMP"));
node->setMaterialTexture(1, driver->getTexture("carpet3.bmp"));[/b]
node->setMaterialFlag(video::EMF_LIGHTING, false);
}
smgr->addCameraSceneNodeFPS();
while (device->run() && driver)
{
driver->beginScene(true, true, video::SColor(0, 100, 100, 100));
smgr->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
-------------------------------------------------------------------------
Code ends here
My code
-----------------------------------------------------------------------
#include <irrlicht.h>
using namespace irr;
#pragma comment (lib, "Irrlicht.lib")
int main()
{
IrrlichtDevice* device = createDevice(video::EDT_DIRECTX8,
core::dimension2d<s32>(640,480),16, false, false);
scene::ISceneManager* smgr = device->getSceneManager();
video::IVideoDriver* driver = device->getVideoDriver();
device->setWindowCaption(L"Project: Bandymai");
scene::ISceneNode* node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("bandymas.x"));
if (node)
{
b]node->setMaterialTexture(0, driver->getTexture("BRICK4.BMP"));
node->setMaterialTexture(1, driver->getTexture("carpet3.bmp"));[/b]
node->setMaterialFlag(video::EMF_LIGHTING, false);
}
smgr->addCameraSceneNodeFPS();
while (device->run() && driver)
{
driver->beginScene(true, true, video::SColor(0, 100, 100, 100));
smgr->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
-------------------------------------------------------------------------
Code ends here