not show *.x animaton

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.
Moore
Posts: 31
Joined: Sat Mar 06, 2010 6:23 pm
Location: Poland

not show *.x animaton

Post by Moore »

I did animation and export to *.x file. I compile project, but nothing happen. I see only background. When i display normal model without animation all's ok. So why i don't see my model?
This is code(may help):

Code: Select all

#include <irrlicht.h>

using namespace irr;
using namespace core;
using namespace scene;
using namespace video;

int main()

{ 
  IrrlichtDevice* device = createDevice( EDT_OPENGL, core::dimension2d<s32>(640, 480),
  32, false, true, false, 0);

  video::IVideoDriver* video = device->getVideoDriver();
  scene::ISceneManager* menage= device->getSceneManager();
  scene::ICameraSceneNode *kam = menage->addCameraSceneNodeFPS();
  device ->getCursorControl()->setVisible(true);
  kam ->setPosition(core::vector3df(0,0,-100));
  //Zasięg pola widzenia kamery
  kam ->setFarValue(90000);
  //Wczytywanie modelu
 IAnimatedMesh* mesh = menage->getMesh("anim.x");
 IAnimatedMeshSceneNode* pud = menage->addAnimatedMeshSceneNode( mesh );
  pud -> setScale (core::vector3df(-300,-300,-300));
  pud -> setPosition (core::vector3df(0,0,900));
  pud ->setMaterialFlag(video::EMF_LIGHTING, false);
  pud ->setMaterialFlag(video::EMF_BACK_FACE_CULLING, false);
	   pud->setFrameLoop(0, 14); 
pud->setAnimationSpeed(15);



int lastFPS = -1;

  while(device->run())

  {
    video->beginScene(true, true, video::SColor(255,113,113,133));
    menage->drawAll();
    video->endScene();
    
int fps = video->getFPS();
		if (lastFPS != fps)
		{
			wchar_t tmp[1024];
			swprintf(tmp, 1024, L"Movement Example - Irrlicht Engine [%s] fps:%d", 
				video->getName(), fps);

			device->setWindowCaption(tmp);
			lastFPS = fps;
		}
    
  }
  device->drop();
  return 0;
}

What?
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

Wrong path for your model probably. What does it say in the console window?
multum in parvo
CuteAlien
Admin
Posts: 9716
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Try if it works in the meshviewer. If it works there it's probably a path problem. If it does not work there please check if it works in the directx viewer for comparison.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Moore
Posts: 31
Joined: Sat Mar 06, 2010 6:23 pm
Location: Poland

Post by Moore »

I tried with meshviewer and it doesn't work.

Well, console wrote something like this:

Code: Select all

Index count per face not equal to face material index count in x file.
Mesh without material found in x file.
Loaded mesh: anim.x
I also tried with 3D Object Viewer and then a have that error:

Code: Select all

Runtime error 7018- Could not load 3D object at line 525
What?
Moore
Posts: 31
Joined: Sat Mar 06, 2010 6:23 pm
Location: Poland

Post by Moore »

Help anyone?
What?
Scarabol
Posts: 167
Joined: Sat Jan 03, 2009 5:26 pm
Location: Aachen, Germany

Post by Scarabol »

Hi,

which program did u use to create the modell?

Which exporter did u use to export to .x file?

Maybe you could send me the modell .x file via pm and i ll check it.

MfG
Scarabol
Moore
Posts: 31
Joined: Sat Mar 06, 2010 6:23 pm
Location: Poland

Post by Moore »

I use Blender 2.48, defalut exporter which is in blender. A model is there: http://www.wrzucaj.com/292624
What?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

having a short look at the mesh datas it seems the problem is that the exporter creates quads instead of triangles !!! :shock:

if you look at the indices you see this (line 5821):

Code: Select all

1440;
4; 0, 3, 2, 1;,
4; 4, 7, 6, 5;,
4; 8, 11, 10, 9;,
4; 12, 15, 14, 13;,
4; 16, 19, 18, 17;,
4; 20, 23, 22, 21;,
4; 24, 27, 26, 25;,
...
it uses 4 indices per face (= quad) !!!

but it should be like this:

Code: Select all

4512;
3;0,1,2;,
3;3,1,0;,
3;3,4,1;,
3;4,5,1;,
3;1,5,6;,
3;7,0,2;,
...
3 indices per face (= triangle) !!!

well, I don't use Blender, but maybe there is a setting for the exporter so it creates tris instead of quads !?!?!
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Irrlicht should cope automatically with the quad/triangle conversion. I'll check this later.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

hybrid wrote:Irrlicht should cope automatically with the quad/triangle conversion.
allright, so this seems not to be the problem... :lol:
I tried to load the mesh into the mesh viewer and it can load it, but it doesn't load animations and the mesh is corrupted:
Image
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Moore
Posts: 31
Joined: Sat Mar 06, 2010 6:23 pm
Location: Poland

Post by Moore »

May, it will better to use another format. What is good for animations?
Btw. what format is good for maps?
What?
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

multum in parvo
Moore
Posts: 31
Joined: Sat Mar 06, 2010 6:23 pm
Location: Poland

Post by Moore »

I tried to load my animation in DeleD. All (without animation, and "some" smoth was ok). Even it had color, i gave in blender. So why irrlicht refuses to obey ;]?

Btw. I have irrlicht 1.3
What?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Moore wrote:I tried to load my animation in DeleD. All (without animation, and "some" smoth was ok). Even it had color, i gave in blender. So why irrlicht refuses to obey ;]?

Btw. I have irrlicht 1.3
MS3D also doesn't load the mesh...
Irrlicht (1.7.1) at least tries to load it, even it's corrupted then (see screenshot above) !!! ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Since the Microsoft MView refuses to load the mesh,, we won't work on this for any reason. Try a different mesh format.
Post Reply