using CAL3D (Character Animation Library) with Irrlicht

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
terrorchrist

using CAL3D (Character Animation Library) with Irrlicht

Post 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?
Masdus
Posts: 186
Joined: Tue Aug 26, 2003 1:13 pm
Location: Australia

Post 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.
Klasker
Posts: 230
Joined: Thu May 20, 2004 8:53 am
Contact:

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

I might Help

Post by Kapace »

I might help you, i was just thinking the same thing! :D 8) :wink:
terrorchrist

cal3d

Post 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?
cubicool
Posts: 10
Joined: Sun Jan 29, 2006 7:15 pm

Post 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)
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post 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
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
MattyBoy
Posts: 19
Joined: Fri Oct 24, 2003 3:07 pm

Cal3d - Speed up

Post 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??
MattyBoy
Posts: 19
Joined: Fri Oct 24, 2003 3:07 pm

Forgot

Post by MattyBoy »

I also switched to getVerticesNormalsAndTexCoords, which didn't seem to help to much.
Troglodyte
Posts: 1
Joined: Sat Apr 01, 2006 10:17 pm

Post 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.
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post 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...
Finally making games again!
http://www.konekogames.com
Squarefox
Competition winner
Posts: 113
Joined: Tue Aug 19, 2008 6:46 pm
Location: Delta quadrant, Borg nexus 0001
Contact:

Re: using CAL3D (Character Animation Library) with Irrlicht

Post 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
Post Reply