Page 1 of 1
IAnimatedMeshX in C#
Posted: Tue Aug 08, 2006 9:43 pm
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?
Posted: Wed Aug 09, 2006 2:48 am
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).
Posted: Wed Aug 09, 2006 4:06 am
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.
Posted: Sat Sep 09, 2006 1:03 pm
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. ?!?!?!
Posted: Sun Dec 10, 2006 2:22 am
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