IAnimatedMeshX in C#

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
Shoarc
Posts: 7
Joined: Tue Aug 08, 2006 9:26 pm

IAnimatedMeshX in C#

Post by Shoarc »

I am attempting to convert the code from the thread below into C#:

http://irrlicht.sourceforge.net/phpBB2/ ... matedmeshx

However, when i try to use IAnimatedMeshX it gives me this error:

Code: Select all

Error	1	The type or namespace name 'IAnimatedMeshX' could not be found (are you missing a using directive or an assembly reference?)	
I need help using IAnimatedMeshX in C#. I am using 1.1 version of the engine. Thanks in advance.

-When I looked through the API.net on the main site, I didnt find it under Irrlicht.Scene but in the normal API, I found it under irr::scene::IAnimatedMeshX. Does this mean that this class is not in .net?
If it isn't, is there a way to attach a 'weapon' on a mesh and have it animate with the animation of the parent node described in the linked thread above?
shurijo
Posts: 148
Joined: Sat Feb 21, 2004 3:04 am

Post by shurijo »

Try using an IAnimatedMesh and loading your .X file. I think IAnimatedMeshX is an internal class used by the engine and the generic IAnimatedMesh will work with any format (I use it to load MD2 models).
Shoarc
Posts: 7
Joined: Tue Aug 08, 2006 9:26 pm

Post by Shoarc »

I don't have a problem loading my model. What I am trying to do is to attach another node to my model like in the thread I linked to. The addChild() method only provide rotation and translation animations to keep it orienteted around the model but what I want is to have the node animate with the mesh animation. Or is this not possible?

I searched around and found a getXJointNode() that I would have to implement myself: http://irrlicht.sourceforge.net/phpBB2/ ... matedmeshx but it seems it already has been added to the API:
http://irrlicht.sourceforge.net/docu/cl ... _node.html.
Then again, when I try this:

Code: Select all

IAnimatedMeshSceneNode animMeshNode = device.SceneManager.AddAnimatedMeshSceneNode(character_mesh, null, -1);
ISceneNode nHand = animMeshNode.getXJointNode("Hand");
I get an error stating that the class doesn't contain a definition for the method. Does this method exist for the .net version of this api?

What I want to do is something like this video:http://video.google.ca/videoplay?docid= ... 2014210068 that was posted in this thread: http://irrlicht.sourceforge.net/phpBB2/ ... mor+armour.
In the thread, the getXJointNode() method is used. I also need help getting IAnimatedMeshX to work so I can use the methods described in the API.

Thanks in advance.
daniel.retief
Posts: 5
Joined: Thu Sep 07, 2006 9:22 am

Post by daniel.retief »

Im trying to load an .x mesh into my scene, but it wont work, and ideas? The model is ok, as I tested it in a direct3d mesh viewer.

Code: Select all

            //Load Mesh
            IAnimatedMesh mesh = device.SceneManager.GetMesh(@"fountain2.x");

            node = smgr.AddAnimatedMeshSceneNode(mesh, null, 1);

            node.Position = (new Vector3D(0, 0, 0));
            node.SetMaterialTexture(0,device.VideoDriver.GetTexture(@"./Textures/baseTexture.bmp"));
The program compiles ok, and draws my other stuff, but the mesh is nowhere to be seen. ?!?!?!
Elfloard2
Posts: 20
Joined: Sun Jan 22, 2006 4:45 am

Post by Elfloard2 »

first make sure that the mesh actually exist by creating an error message like if(mesh==NULL)
MessageBox.Show("Mesh does not Exist");

Put this code immedietly after you set the mesh variable to the filename

if the message box does not pop up when u run the program then go back into programming mode and add a Camera to your scene. To learn how to add a camera go into Hello World_cs and open up the Hello World solution in irrlicht.net folder of the irrlicht folder u downloaded. Good Luck
Locked