Hi all,
I'm told that Irrlicht supports skeletal animation. My understanding of this is that I could export a rigged/skinned model from Blender into, say, .obj format. Then Irrlicht would allow me to move bones and deform the skin appropriately. I would then be able to move a player's arm, for example.
Are there any tutorials or sample code? If not, where should I start reading...?
TIA.
Skeletal animation?
Check out the tutorial N°1 for example, it contains a skinned and animated mesh.
There are some tweaking to be done to get the exporter right (well usually),
I use the 'pipeline b3d' exporter and it works like a charm (except it doesn't export specular settings).
[edit] That works for animated skinmeshes, maybe I misunderstood the question and you want to move the bones by code?
If you want to it's quite straightforward too.
There are some tweaking to be done to get the exporter right (well usually),
I use the 'pipeline b3d' exporter and it works like a charm (except it doesn't export specular settings).
[edit] That works for animated skinmeshes, maybe I misunderstood the question and you want to move the bones by code?
If you want to it's quite straightforward too.
-
hybrid
- Admin
- Posts: 14144
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Actually, Sydney is not a skeletal animated mesh. Instead use the ninja or dawrf from the SDK meshes. You cannot use .obj, though, because this is neither animated, nor using a skeleton. You have to use .b3d, .ms3d, or .x
If you want to move the bones programatically, you can read in the Wiki how to do that.
If you want to move the bones programatically, you can read in the Wiki how to do that.
I understood about Sydney; I've used that model elsewhere. Yes, I am wanting to move the actual bones by program. I'll search the wiki. Does anyone have a snippet of code, though?hybrid wrote:Actually, Sydney is not a skeletal animated mesh. Instead use the ninja or dawrf from the SDK meshes. You cannot use .obj, though, because this is neither animated, nor using a skeleton. You have to use .b3d, .ms3d, or .x
If you want to move the bones programatically, you can read in the Wiki how to do that.
Hi Uberbot, here is everything you need:
http://www.irrlicht3d.org/wiki/index.ph ... tionSystem
edit:
i wrote little example for you, it is using ninja.b3d model from media from irrlicht examples
http://www.irrlicht3d.org/wiki/index.ph ... tionSystem
edit:
i wrote little example for you, it is using ninja.b3d model from media from irrlicht examples
Code: Select all
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif
int main()
{
IrrlichtDevice *device =
createDevice( video::EDT_OPENGL, dimension2d<u32>(800, 600));
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
smgr->addCameraSceneNode(0, vector3df(0,10,-10), vector3df(0,5,0));
IAnimatedMesh* mesh = smgr->getMesh("./media/ninja.b3d");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh);
node->setMaterialFlag(EMF_LIGHTING, false);
node->setMaterialTexture( 0, driver->getTexture("./media/nskinrd.jpg") );
node->setRotation(vector3df(0,180,0)); // let ninja be in front to us
node->setJointMode(EJUOR_CONTROL); // tell irrlicht that you want to control joint positions
IBoneSceneNode* bone = node->getJointNode("Joint10"); // create IBoneSceneNode and select the desired bone
while(device->run()) {
bone->setRotation(bone->getRotation() + vector3df(1,0,0)); // rotate bone
driver->beginScene();
smgr->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
Thank you!
Thank you. This is, INDEED, everything I need.
