Loading Static .X Mesh

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
adam23
Posts: 14
Joined: Fri Jun 16, 2006 6:37 pm
Contact:

Loading Static .X Mesh

Post by adam23 »

I am working on my very first 3D project using this engine. I have done 3D work before, but now with this engine. I have searched the forums and the documentation for the best way to load a .X text based file into the program. With what I am trying I am getting this error on the console window Unknown data object in x file: Header.

Here is what I have:

Code: Select all

	scene::IAnimatedMesh *mesh = smgr->getMesh("../../media/enemy.X");
	scene::IAnimatedMeshSceneNode *node = smgr->addAnimatedMeshSceneNode( mesh );
	if(node)
	{
		node->setMaterialFlag(video::EMF_LIGHTING, false);
	}
I didn't see a way to load a static mesh, so I am trying IAnimatedMesh. Is there a better way to do this?

Here is the top part of my enemy.X file maybe something is wrong with it.
xof 0302txt 0064
template Header {
<3D82AB43-62DA-11cf-AB39-0020AF71E433>
WORD major;
WORD minor;
DWORD flags;
}

template Vector {
<3D82AB5E-62DA-11cf-AB39-0020AF71E433>
FLOAT x;
FLOAT y;
FLOAT z;
}

template Coords2d {
<F6F23F44-7686-11cf-8F52-0040333594A3>
FLOAT u;
FLOAT v;
}
adam23
Posts: 14
Joined: Fri Jun 16, 2006 6:37 pm
Contact:

Post by adam23 »

I did a search for the Unknown data type and found that a lot of people had that error. I don't know why it didn't occur to me to search for that sooner. Anyway I did what one of the suggestions which was to open with mviewer and save. It worked I don't get that error anymore, but I still don't see my mesh. :(
Post Reply