Page 1 of 1

Meshes/Textures aren't showing up! Help!

Posted: Sat Apr 23, 2011 1:00 am
by DoritoX
Hey there,

I downloaded a pack of meshes from the internet (with textures) but for some reason, these won't load correctly.
I loaded thousands of other meshes who most of the time load their textures respectively through the .mtl file.

the code i use is:

Code: Select all

IAnimatedMesh *mesh = smgr->getMesh("location/model.?");
IAnimatedMeshSceneNode *node = smgr->addAnimatedMeshSceneNode(mesh);
However, this time i got a few .3DS files (with TARGA textures) and they load up fine in 3DS Max and Blender, however if i load them inside Irrlicht, nothing will show up, even though the debugger says everything is loaded.
With some other models i got in the same package, i get the message: "Found no matching material for Group in 3ds file".

I tried converting them to .OBJ format, it ends up loading the mesh but not the textures (even though the .MTL has them assigned)

Then i tried converting it to .X, and i got the same results as with .OBJ
the confusing part is that everything (with textures) looks perfectly in 3DS Max or Blender so it's kinda weird.

Also I tried rescaling everything but it didnt matter, so that's not the problem.
and in the console window it does say "Texture.....loaded!" and "Mesh....loaded!".

I hope you can help me!

Thanks ALOT!

Posted: Sat Apr 23, 2011 1:18 am
by ChaiRuiPeng
what are the settings do you have in blender when exporting?

Posted: Sat Apr 23, 2011 1:25 am
by DoritoX
Exporting Options:
for .OBJ ->

Code: Select all

Context = Selection Only
Output Options = RotateX90
Export = Edges, Materials, UV's,Nurbs
Blender Objects as OBJ = keep vert order
for .X ->

Code: Select all

Anim = off
Flop Norm = off
Swap zy = off
Flip z = on
Speed = off

Export All

BI.normals = on
recalc.no = off
no smooth = off

Posted: Sat Apr 23, 2011 7:11 am
by CuteAlien
Does it also fail when you load it in the Irrlicht meshviewer?

Re: [NOT SOLVED YET] Meshes/Textures aren't showing up! Help

Posted: Sat Apr 23, 2011 8:52 am
by randomMesh
I guess you forgot to setup a proper lighting and/or camera. Please show the entire code.

Posted: Sat Apr 23, 2011 10:50 am
by DoritoX
Entire code is about 500 lines so it's a bit hard to show just like that.
plus the camera must be setup right because it does show other meshes, on top of that, i also tried with a first person camera.
And i left the default lighting, i don't know if that matters

Also in the Irrlicht meshviewer, the model appears WITH texture but it's like.....extremely transparent (if i set the material to solid it shows perfectly, but how do i do that in my gamecode?)

EDIT: by adding the following line of code, i can make the .3DS files appear without needing any conversion, however, the textures still don't show up!!
(note: it's also way bigger this way, in the .OBJ model i had to call "->setScale(vector3df(10,10,10)); to make it look normal size.
now it already looks alot bigger without scaling it

Code: Select all

model->setMaterialType(EMT_NORMAL_MAP_SOLID);

Re: [NOT SOLVED YET]Meshes/Textures aren't showing up! Help!

Posted: Sun Apr 24, 2011 9:55 am
by xirtamatrix
DoritoX wrote:I downloaded a pack of meshes from the internet
If you're just playing around, then its ok. If you're planning to develope some serious game/application, then forget about downloading from internet. Its NEVER a good idea. I strongly suggest creating your own meshes as required by your game/app. When you get into that, you'd be forced to work-out a complete content creation pipe-line, learn about WHY there are multiple formats in the first place and what a format should or should not have that you need or need not. :)

To get you started, start by learning more on Irrlicht materials types.
http://irrlicht.sourceforge.net/docu/cl ... erial.html

Posted: Tue Apr 26, 2011 8:22 am
by CuteAlien
When the irrlicht meshviewer shows the textures, then there is some problem in your code. And hard to help unless we see what you do. Maybe reduce your code to just the model-loading (but a complete program that compiles).