I just edited my post because my worst issue is not the world map size anymore : at the moment I am using scales everywhere to get a quite big world, so the problem is a bit solved, but now I have some textures AND blender issues
1) In BLENDER I made a terrain (thanks to an heightmap feature in blender) and exported it to .3ds format.
Code: Select all
mesh = hotp->scene->getMesh("data/levels/terrain_plat_1.3ds");
node = hotp->scene->addOctTreeSceneNode(mesh);
node->setScale(vector3df(80.0f, 80.0f, 80.0f));//(2.0f,0.8f,2.0f));
node->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);
node->setMaterialFlag(video::EMF_LIGHTING, false);
I tried this :
Code: Select all
node->setMaterialTexture(0, hotp->driver->getTexture("data/levels/map1.jpg"));
2) In blender (v2.42) I created another tree (my previous tree had 2434 vertices and 2432 faces), less memory consuming : only 26 vertices and 26 faces (it should be a tree like in old CS : a trunk represented by a small cylinder and the foliage represented by 2 orthogonal faces on which I put a "noobish" texture.
In blender then I texture my trunk cylinder and my foliage faces, and I set my foliage faces to "double sided", in order to see them from front or back. I also set "UseAlpha" in the texture, and "Alpha" in "Map To" of the material. I then export to .obj (the only format that seems to work).
In irrlicht, I load my trees with :
Code: Select all
// Place 100 nodes of this object
mesh = hotp->scene->getMesh("data/objects/arbre1.obj");
for (int i = 0; i < 100; ++i)
{
// Add another copy
ptiga = hotp->scene->addOctTreeSceneNode(mesh->getMesh(0));
// No global light, so...
ptiga->setMaterialFlag(video::EMF_LIGHTING, false);
// Align the copies in a row
ptiga->setPosition(vector3df(0 + 4 * i, 10, -10));
}
a) they do not seem to be double sided since I can only see one part of each face (say, the front one), and the other part (say, the back one) is transparent.
b) the texture does not seem to appear : I have a black rectangle, thats all, no texture
The trunk texture is in .jpg, and the foliage texture is in .tga.
Does anyone here know blender and can give me advices about how to set textures in blender, what format and how to export, and how to set textures properly in irrlicht pleaaaaaaase ?
If someone uses Blender with Irrlicht quite often, I would love to be taught some good tips
Thanks a lot,
Lideln (who needs a bit help to get started )