I really need help with Klasker's Cal3d code

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.
CameroKid
Posts: 71
Joined: Tue Jul 11, 2006 8:54 pm

I really need help with Klasker's Cal3d code

Post by CameroKid »

I have been trying in integrate Irrlicht and Cal3d for weeks. I have version 1.2 of irrlicht and I use VS 2005 for a complier. I followed klaskers instructions to the letter:
-copied the dll to the .exe
-linked to the library (i didn't use project settings I used #pragma comment(lib, "../msvc/IrrCal3D.lib") )
-I added the include path in options
-then I opened the example .cpp file in a project and compiled.

I get 1 error (and 5 warnings) about the line that prints the bone and fps information so I commented that section out. Heres the error:

error C2664: '_snwprintf' : cannot convert parameter 2 from 'const wchar_t [40]' to 'size_t'

when I compile again I get 5 errors that I have no idea what they mean. Heres an example:

error LNK2019: unresolved external symbol "__declspec(dllimport) class irr::IrrlichtDevice * __cdecl irr::createDevice(enum irr::video::E_DRIVER_TYPE,class irr::core::dimension2d<int> const &,unsigned int,bool,bool,bool,class irr::IEventReceiver *,char const *)" (__imp_?createDevice@irr@@YAPAVIrrlichtDevice@1@W4E_DRIVER_TYPE@video@1@ABV?$dimension2d@H@core@1@I_N22PAVIEventReceiver@1@PBD@Z) referenced in function _main

I'm sorry, I'm new at irrlicht. Can someone please help me out, I'm so sick of fighting with this.
Klasker
Posts: 230
Joined: Thu May 20, 2004 8:53 am
Contact:

Post by Klasker »

It was compiled an old version of Irrlicht (v1.0 I think), which should explain the error messages.

I just uploaded a recompiled version for 1.2: Download IrrCal3D.zip (4 MB)

I hope it works now :D
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Klasker wrote:It was compiled an old version of Irrlicht (v1.0 I think), which should explain the error messages.

I just uploaded a recompiled version for 1.2: Download IrrCal3D.zip (4 MB)

I hope it works now :D
Just wondering, but shouldn't meshes be updated (recalculated) in OnPreRender() instead of OnRender()? I was thinking that multiple calls may be made to render for stuff like stencil shadows. I'm doing a Doom3 model loader so I'm interested in these things. :wink:
Klasker
Posts: 230
Joined: Thu May 20, 2004 8:53 am
Contact:

Post by Klasker »

The mesh is updated in OnPostRender(u32 timeMs). The render() method just pulls information from Cal3D about the model - it doesn't change it.
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Klasker wrote:The mesh is updated in OnPostRender(u32 timeMs). The render() method just pulls information from Cal3D about the model - it doesn't change it.
Ah, right. :)

To clarify: I recalculate in OnPreRender(); render in OnRender(); update in OnPostRender(). I assume this is correct.
CameroKid
Posts: 71
Joined: Tue Jul 11, 2006 8:54 pm

Post by CameroKid »

Thanks for replying.

I tried it again with that download but I got the same errors. So I downgraded irrlicht to 1.0 I get the same errors but the warnings have gone away. I have a feeling it has to do with the CBoneAxis files. Where am I supposed to put them?
Klasker
Posts: 230
Joined: Thu May 20, 2004 8:53 am
Contact:

Post by Klasker »

Did you link to the Irrlicht library?
CameroKid
Posts: 71
Joined: Tue Jul 11, 2006 8:54 pm

Post by CameroKid »

Ok I linked to the library in code. It went down to 1 error. I read it closely and realized it had to do with this line of code:

scene::CBoneAxisTripodSceneNode* boneNode = new scene::CBoneAxisTripodSceneNode(
manager,
node );

I commented out that line and it ran! However this line looks pretty important. Can you see the problem? Thanks for the help!
CameroKid
Posts: 71
Joined: Tue Jul 11, 2006 8:54 pm

Post by CameroKid »

Oh! I also had to comment out the section where the info is printed to the screen.
Klasker
Posts: 230
Joined: Thu May 20, 2004 8:53 am
Contact:

Post by Klasker »

CameroKid wrote:Ok I linked to the library in code. It went down to 1 error. I read it closely and realized it had to do with this line of code:

scene::CBoneAxisTripodSceneNode* boneNode = new scene::CBoneAxisTripodSceneNode(
manager,
node );

I commented out that line and it ran! However this line looks pretty important. Can you see the problem? Thanks for the help!
What was the error? Apparently you read it closely but forgot to post it here... :?
CameroKid
Posts: 71
Joined: Tue Jul 11, 2006 8:54 pm

Post by CameroKid »

main.obj : error LNK2019: unresolved external symbol "public: __thiscall irr::scene::CBoneAxisTripodSceneNode::CBoneAxisTripodSceneNode(class irr::scene::ISceneManager *,class irr::scene::CCal3DSceneNode *,float)" (??0CBoneAxisTripodSceneNode@scene@irr@@QAE@PAVISceneManager@12@PAVCCal3DSceneNode@12@M@Z) referenced in function _main
Klasker
Posts: 230
Joined: Thu May 20, 2004 8:53 am
Contact:

Post by Klasker »

It looks like you did not include CBoneAxisTripodSceneNode.cpp in your project. Try adding it so it gets compiled and try again.
CameroKid
Posts: 71
Joined: Tue Jul 11, 2006 8:54 pm

Post by CameroKid »

That did it. Thanks
CameroKid
Posts: 71
Joined: Tue Jul 11, 2006 8:54 pm

Post by CameroKid »

Ok I can animate certain bones to do one animation and other bones to do another at the same time right? How is this done?
Klasker
Posts: 230
Joined: Thu May 20, 2004 8:53 am
Contact:

Post by Klasker »

You can blend animations so they appear at the same time, so for example the character can walk and talk at the same time. I don't think Cal3D lets you specify individual bones to animate, but the same can be achieved by blending different animations. If you want to animate both arms individually, make animations for each arm. So for example you can blend rightarm_punch and leftarm_picknose to make the character pick his nose while punching.
Post Reply