I'm having texturing problems with objects exported from Blender. I was wondering if anyone could point me in the right direction. From what I've read, Blender should be a great program for creating objects for irrLicht, but I just can't seem to apply textures to my objects. I've tried both .OBJ and .X files with pretty much the same results.
Objects exported from Bryce or Maya, on the other hand, seem to texture fine. Blender objects just show up as a textureless mass as seen below:
The bridge in the background was made in Maya (I'm pretty sure) and textures fine, but my rock in the foreground was made in Blender.
My code to add and texture is:
Code: Select all
IAnimatedMesh* BlenderMesh = smgr->getMesh("../media/objects/Rock2.obj");
IAnimatedMeshSceneNode* BlenderNode = smgr->addAnimatedMeshSceneNode(BlenderMesh);
if (BlenderNode){
BlenderNode->setMaterialFlag(EMF_LIGHTING,false);
BlenderNode->setMaterialTexture(0,driver->getTexture("../media/stones2.jpg"));
BlenderNode->setScale(core::vector3df(100,100.0f,100));
BlenderNode->setPosition(core::vector3df(2500*2,595*2,2500*2));
}
Thanks!
- Aardaerimus
Edit to add:
I forgot to mention that the irrLicht output shows both the texture and the object loading just fine: