using CAL3D (Character Animation Library) with Irrlicht
using CAL3D (Character Animation Library) with Irrlicht
Hey guys!
I found this nice character animation library and now I wonder how it is possible to use it with irrlicht. I mean I know that it is possible, and that I have to create a new SceneNode Class for it, but HOW?
I found this nice character animation library and now I wonder how it is possible to use it with irrlicht. I mean I know that it is possible, and that I have to create a new SceneNode Class for it, but HOW?
I wrote a scene node for cal3d some time ago. It works without problems so far.
I was planning on releasing it along with my newton wrapper which is not complete yet, but you can use it if you want.
You can download my wrapper here:
http://www.wc3jass.com/files/IrrCal3D.zip
All you need to do is link to "libIrrCal3D.a" and include "irrCal3D.h" in your source.
Use these two prototype functions to create your cal3d scene nodes:
Remember that they are declared in the irr::scene namespace.
Note that ICal3DSceneNode is not an IAnimatedSceneNode, because the interface for IAnimatedSceneNode is frame-based, and cal3d uses blended animations.
For getCal3DModelFromFile, you need to give it the .cfg-file (a cal3d model has a lot of files).
Here is a short example:
I was planning on releasing it along with my newton wrapper which is not complete yet, but you can use it if you want.
You can download my wrapper here:
http://www.wc3jass.com/files/IrrCal3D.zip
All you need to do is link to "libIrrCal3D.a" and include "irrCal3D.h" in your source.
Use these two prototype functions to create your cal3d scene nodes:
Code: Select all
ICal3DModel* getCal3DModelFromFile( video::IVideoDriver* videoDriver, const c8* filename );
ICal3DSceneNode* createCal3DSceneNode( ISceneManager* mgr, ICal3DModel* model, ISceneNode* parent=0 );
Note that ICal3DSceneNode is not an IAnimatedSceneNode, because the interface for IAnimatedSceneNode is frame-based, and cal3d uses blended animations.
For getCal3DModelFromFile, you need to give it the .cfg-file (a cal3d model has a lot of files).
Here is a short example:
Code: Select all
scene::ICal3DModel* model = scene::getCal3DModelFromFile( driver, "paladin/paladin.cfg" );
scene::ICal3DSceneNode* node = scene::createCal3DSceneNode( manager, model );
node->playAnimation( 0, 1.0f, 0.0f );
cal3d
hey thank you Kasker!
and do you think it is better to use cal3d than the md3 format?
I mean because of the ease of use and the functions.
for example: how do you tell the lower body portion to do a running animation while the upper body does a handshake animation...
and: because my character (if i use cal 3d) is only ONE mesh - how can I create several hit zones (head, torso, legs),...
and can I still add a weapon to a bone as easily?
and do you think it is better to use cal3d than the md3 format?
I mean because of the ease of use and the functions.
for example: how do you tell the lower body portion to do a running animation while the upper body does a handshake animation...
and: because my character (if i use cal 3d) is only ONE mesh - how can I create several hit zones (head, torso, legs),...
and can I still add a weapon to a bone as easily?
Well, but this is lib only compiled for DevCPP.
Zola wrote one article for using of Cal3d with Irrlicht. You can find tutorial and sources here:
http://thomas.webtracker.ch/jahia/Jahia ... 6DBF525351
Also similar topic you can find in IrrlichtNX forum
Zola wrote one article for using of Cal3d with Irrlicht. You can find tutorial and sources here:
http://thomas.webtracker.ch/jahia/Jahia ... 6DBF525351
Also similar topic you can find in IrrlichtNX forum
Cal3d - Speed up
You can dramatically speed this up if you make SMeshBuffer mb a member of the class and don't do the clears.
DON'T DO
mb.Verticies.clear();
mb.Indicies.clear();
They clear all the memory and the memory has to be reallocated.
Do something like this in the constructor
mb.Vertices.set_used(2000);
mb.Indices.set_used(5000);
or what ever values are good for your models.
Does anyone else have any performance enhancements for the cal3dscenenode??
DON'T DO
mb.Verticies.clear();
mb.Indicies.clear();
They clear all the memory and the memory has to be reallocated.
Do something like this in the constructor
mb.Vertices.set_used(2000);
mb.Indices.set_used(5000);
or what ever values are good for your models.
Does anyone else have any performance enhancements for the cal3dscenenode??
-
- Posts: 1
- Joined: Sat Apr 01, 2006 10:17 pm
First off all I want to thank Klasker for providing the Scene node for Cal3d and all the others that have provided info on using Irrlicht and Cal3d together.
FYI: I have several years of experience with C++, but I am starting out with Irrilcht coming from using a 3D Engine that our school provides / and codes for called the MU Opengl Toolkit. FYI: I am using Cal3d with it.
Anyway, since I am just a newbie to the world of Irrlich, I was wondering if anyone could provide me with a very basic example .cpp file that would be used with Klasker 's files. I tried to write my own, but I am not very familiar with the required syntax, so I got many errors.
Using say for instance, the paladin.cfg file, can some one show me how this would be done? I realize that a lot of info has already been provided, and I thank you for that. However, I am almost a complete newbie right now.
All I am really looking for is a .cpp file that would load the character file to the screen, and maybe show the animation.
Thanks in advance.
FYI: I have several years of experience with C++, but I am starting out with Irrilcht coming from using a 3D Engine that our school provides / and codes for called the MU Opengl Toolkit. FYI: I am using Cal3d with it.
Anyway, since I am just a newbie to the world of Irrlich, I was wondering if anyone could provide me with a very basic example .cpp file that would be used with Klasker 's files. I tried to write my own, but I am not very familiar with the required syntax, so I got many errors.
Using say for instance, the paladin.cfg file, can some one show me how this would be done? I realize that a lot of info has already been provided, and I thank you for that. However, I am almost a complete newbie right now.
All I am really looking for is a .cpp file that would load the character file to the screen, and maybe show the animation.
Thanks in advance.
btw, this is the cal3d exporter working for Blender 2.41.
probably this one works but not the one included with blender...that is, bones, weights, animation , working. That i understood: Have not tested my self, but look like it does :
http://www.eternal-lands.com/misc/blender2cal3d_3.py
I read the info and status from this thread :
http://blender.org/forum/viewtopic.php? ... c&start=30
Last link there, as u see...
probably this one works but not the one included with blender...that is, bones, weights, animation , working. That i understood: Have not tested my self, but look like it does :
http://www.eternal-lands.com/misc/blender2cal3d_3.py
I read the info and status from this thread :
http://blender.org/forum/viewtopic.php? ... c&start=30
Last link there, as u see...
Finally making games again!
http://www.konekogames.com
http://www.konekogames.com
-
- Competition winner
- Posts: 117
- Joined: Tue Aug 19, 2008 6:46 pm
- Location: Delta quadrant, Borg nexus 0001
- Contact:
Re: using CAL3D (Character Animation Library) with Irrlicht
Is there any working Cal3D importer with the current Irrlicht version?
I have some Cal3D models here and I would like use them.
They consist out of CAF CSF CRF and CMF files.
Kind regards,
Squarefox
I have some Cal3D models here and I would like use them.
They consist out of CAF CSF CRF and CMF files.
Kind regards,
Squarefox