Page 1 of 1

using CAL3D (Character Animation Library) with Irrlicht

Posted: Fri Feb 17, 2006 12:58 pm
by terrorchrist
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?

Posted: Mon Feb 20, 2006 11:16 pm
by Masdus
some work was done with Cal earlier, so give the forums a search. I believe that several problems were encountered and never resolved, but it might give you a starting point.

Posted: Tue Feb 21, 2006 3:30 pm
by Klasker
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:

Code: Select all

ICal3DModel* getCal3DModelFromFile( video::IVideoDriver* videoDriver, const c8* filename );

ICal3DSceneNode* createCal3DSceneNode( ISceneManager* mgr, ICal3DModel* model, ISceneNode* parent=0 );
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:

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 );

I might Help

Posted: Wed Feb 22, 2006 1:55 am
by Kapace
I might help you, i was just thinking the same thing! :D 8) :wink:

cal3d

Posted: Wed Feb 22, 2006 2:55 pm
by terrorchrist
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?

Posted: Wed Feb 22, 2006 9:23 pm
by cubicool
Klasker provided the source for me and I can confirm that the code build and works on Linux w/out a hitch using -W and -Wall. My vote is for it to be tested a bit and added to Irrlicht TRUNK.

(Using Dapper Drake, GCC4, and Cal3D from apt)

Posted: Thu Feb 23, 2006 3:15 pm
by etcaptor
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

Cal3d - Speed up

Posted: Fri Mar 10, 2006 8:45 am
by MattyBoy
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??

Forgot

Posted: Fri Mar 10, 2006 8:47 am
by MattyBoy
I also switched to getVerticesNormalsAndTexCoords, which didn't seem to help to much.

Posted: Sat Apr 01, 2006 10:21 pm
by Troglodyte
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.

Posted: Sat Apr 01, 2006 10:26 pm
by vermeer
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...

Re: using CAL3D (Character Animation Library) with Irrlicht

Posted: Wed Dec 06, 2017 7:07 pm
by Squarefox
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