Blender to irrLicht

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Aardaerimus
Posts: 3
Joined: Sun Dec 31, 2006 4:22 am

Blender to irrLicht

Post by Aardaerimus »

Hello all,

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:

Image

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));
    }
Can anyone help out a newbie?

Thanks!

- Aardaerimus

Edit to add:
I forgot to mention that the irrLicht output shows both the texture and the object loading just fine:
Image
isIrrNewb(true);
Saturn
Posts: 418
Joined: Mon Sep 25, 2006 5:58 pm

Post by Saturn »

You have to uv-unwrap your mesh in Blender. Other texture application methods, like projections won't work. Maybe this is the problem?
MasterBaker
Posts: 7
Joined: Fri Nov 24, 2006 6:13 pm

Post by MasterBaker »

Saturn, you seem to be familiar with Blender and Irrlicht.

Im having the same problem as Aardaerimus, so when i read your reply my heart was filled with hope.

I did the quickie UVMap tutorial :
(http://en.wikibooks.org/wiki/Blender_3D ... Map_Basics)

I sucessfully got the earth texture onto the mesh using the uvMap, and used the DirectX8 Mod 1.3.2 to save the file to .X. I then tried to see if i could get a textured mesh working in IrrEdit, to no avail. I'm getting the same result - the mesh loads properly, IrrLicht mentions that it sucessfully loads the texture, but the object is not textured - plain black mesh.

Am i missing a step? If you have a recipe to make it work we'd both appreciate to hear about it! Thanks in advance.

Masterbaker
noreg
Posts: 158
Joined: Fri Jun 23, 2006 6:01 pm
Location: continental europe

Post by noreg »

Post your file. This guessing is horrible.
Post Reply