const c8* car=".../address and name of your mesh/...";
const c8* tex[n+1]; // number of textures of mesh plus 1
tex[1] = ".../address and name of your first texture/ ...";
tex[2] = ".../address and name of your second texture/ ...";
.
.
.
tex[n] = ".../address and name of your 'n' texture/...";
SMesh* box2;
box2 = loadmesh(car,tex);
Be aware, the texture indexes begin at 1.
That's it.
Last edited by Auradrummer on Mon Jun 02, 2008 1:35 pm, edited 1 time in total.
Professional Software Developer and Amateur Game Designer
hybrid: I'm using LWO, and inside LWO the path to the texture aren't correct. This is because I'm programming under Linux, and my models have to be done under Windows.
And this code I posted open more possibilities. I think, for example, that if I try to load a reflection map in only one of these meshbuffers I'll can. I think I can even one of the meshbuffers wireframe.
This is possibilities, that I don't tested, but in my case is because the path of textures.
Professional Software Developer and Amateur Game Designer
Moreover, the mesh loader should handle the problematic paths, not the user afterwards. The typical loading of textures in Irrlicht is as follows: First the full path, then the mesh's path, then the current working directory, some mesh types also have a scene manager attribute to set another path. The textures should be in one of these locations.
BlindSide: I don't remember if I tried exactly what you posted, but I remember I tried to get Mesh Buffers from an IMesh and failed, and 'box' is an IMesh. So I converted to SMesh first, than generated the SceneNode.
But, this solution I found is that one I was capable to implement, due my inexperience in Irrlicht. I read the API trying to find anything better without success. This explains why I don't made anything easier. But I'll appreciate a lot if someone presents a better solution.
Hybrid: Loading LWO this don't works, at least here. When I load my object, Various log's appears. Among them there are some that says "c:\documents\texes ... \tex.jpg cannot load" (or something like this). This path is the one I used in Windows when I built the object. If I don't specify a new texture, the mesh will be drawn with the base color of the texture, as in Linux that path doesn't exists.
Professional Software Developer and Amateur Game Designer
Really, my function is not able to load two meshes. I have to look into it. Hybrid, do you have some tip to me that can help me to make the natural loader function works?
Professional Software Developer and Amateur Game Designer
Really, hybrid, is fully working that feature. The problem is that I was placing texes and meshes in different places. If everything is in the same place, all works. I spent about four days to load those textures......
..................................... BUT I STILL GOT A MEDAL OF BEST GOALKEEPER OF 1996 AMATEUR CHAMPIONSHIP
Professional Software Developer and Amateur Game Designer