Trouble about COLLADA (Octree and texture)

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
Shomaa
Posts: 15
Joined: Sat Mar 14, 2009 2:28 pm
Location: {Epitech.} Kremlin-Bicetre

Trouble about COLLADA (Octree and texture)

Post by Shomaa »

Hi,
I use Irrlicht for a school project and we got a problem with COLLADA.
the real meshes looks like this :

http://picasaweb.google.fr/lh/photo/8aE ... directlink

but in Irrlicht, every meshes is reverted in Z axis (Textures and meshes)
also, the textures become black accordind the camera angle , why ?

http://picasaweb.google.com/lh/photo/Mv ... directlink


thanks.
--
Shomaa
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The zbuffer problem is probably related to the z-up problem that wasn't solved in Irrlicht 1.5 IIRC. The current SVN/trunk version has this fixed, though, and usually handles geometry and textures correctly. Transparency is not correct in most situations, though. I could test the mesh with the latest meshviewer version and maybe also fix the other problems if you can provide me with the mesh.
Shomaa
Posts: 15
Joined: Sat Mar 14, 2009 2:28 pm
Location: {Epitech.} Kremlin-Bicetre

Post by Shomaa »

Hybrid :
I gave you a piece of the mesh via PM

thanks for the help
--
Shomaa
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Is there somewhere the whole scene in one file, or do you load many "parts" as separate files? Collada is quite good at storing huge files and still keeping the structures pretty clear.
Shomaa
Posts: 15
Joined: Sat Mar 14, 2009 2:28 pm
Location: {Epitech.} Kremlin-Bicetre

Post by Shomaa »

we load many parts via XML ,
it's the easiest mtehod for applying the physic engine on the scene and twinking the scene.
--
Shomaa
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, e.g. the stairs look absolutely perfect, but I don't know if everything's correct. I guess you should try to port your project to SVN/trunk version to test it, or provide the scene loader (do you use a .irr file?)
Shomaa
Posts: 15
Joined: Sat Mar 14, 2009 2:28 pm
Location: {Epitech.} Kremlin-Bicetre

Post by Shomaa »

After several try ,the resultat is still the same, the z axis is reverted ,and worst ,the collada meshes doesnt support several texture anymore... :evil:

http://picasaweb.google.com/lh/photo/nK ... directlink

i post my code here, it's for loading a collada file with several textures :

Code: Select all

	IAnimatedMesh	*anim = this->_engine->GetSmgr()->getMesh("media/pack/Character/NPC/Haruhi_npc/Ai_npc01.dae");

		ISceneNode* node = this->_engine->GetSmgr()->addAnimatedMeshSceneNode(anim);
		node->setMaterialTexture(0,this->_engine->GetDriver()->getTexture(
			"media/pack/Character/NPC/Sourceimages/Character/Ai_Shadow_01.png"));
		node->setMaterialTexture(1,this->_engine->GetDriver()->getTexture(
			"media/pack/Character/NPC/Sourceimages/Character/Ai_npc01.png"));
		node->setMaterialTexture(2,this->_engine->GetDriver()->getTexture(
			"media/pack/Character/NPC/Sourceimages/Character/Ai_npc01_Eyes.png"));
		node->setMaterialTexture(3,this->_engine->GetDriver()->getTexture(
			"media/pack/Character/NPC/Sourceimages/Character/Ai_npc01_Mouth_01.png"));
		node->getMaterial(0).MaterialType = irr::video::EMT_TRANSPARENT_ALPHA_CHANNEL;
node->getMaterial(1).MaterialType = irr::video::EMT_SOLID;
		node->getMaterial(2).MaterialType = irr::video::EMT_TRANSPARENT_ALPHA_CHANNEL;
		node->getMaterial(3).MaterialType = irr::video::EMT_TRANSPARENT_ALPHA_CHANNEL;
		node->setMaterialFlag(irr::video::EMF_LIGHTING,false);
		this->_player[_nb_player_current]->SetPlayerNode(node);
--
Shomaa
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You should note that the Collada loader always creates a scene, not just a single mesh. So be sure you find the proper node when changing the material. At least the NPC is loading properly with latest SVN/trunk. You should try to export the normals, though, because right now the mesh looks not nice when being lit.
Shomaa
Posts: 15
Joined: Sat Mar 14, 2009 2:28 pm
Location: {Epitech.} Kremlin-Bicetre

Post by Shomaa »

in my last post, I compiled the project with the lastest Irllicht (SVN/Trunk)
and the picture is the result of this operation...
how do you apply correctly the texture ?
Can you show a piece of your code ,please ?
--
Shomaa
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I simply choose the dae file in the meshviewer example 9. This loads the NPC without problems, textures are automatically loaded.
Shomaa
Posts: 15
Joined: Sat Mar 14, 2009 2:28 pm
Location: {Epitech.} Kremlin-Bicetre

Post by Shomaa »

I found my first error:
because the file is a .DAE, you must add the flag video::EMF_FRONT_FACE_CULLING , for avoid the blink of texture (because the mesh is one textured...)
but the second problem remain here the screenshot :
http://picasaweb.google.com/lh/photo/xC ... directlink

the mesh is still inverted...
--
Shomaa
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

This still sounds as if your library doesn't load the collada as the latest SVN/trunk does. I did not change a thing to the mesh settings, just laoded it with the meshviewer (example 9) and latest SVN/trunk.
Post Reply