New Animation System for Irrlicht
Hi there,
I'm interested in adding animation support for the collada file format. For that I've checked out the current animation branch from SVN. I'm having problems with compiling it though. I'm getting various compile errors in the files xdebug and xlocale.
As far as I understand these files come with every visual studio installation. I'm pretty sure that my visual studio files are okay though, because if I check out the trunk files, I can compile Irrlicht without a problem. Has somebody noticed a similar problem?
Thanks in advance!
I'm interested in adding animation support for the collada file format. For that I've checked out the current animation branch from SVN. I'm having problems with compiling it though. I'm getting various compile errors in the files xdebug and xlocale.
As far as I understand these files come with every visual studio installation. I'm pretty sure that my visual studio files are okay though, because if I check out the trunk files, I can compile Irrlicht without a problem. Has somebody noticed a similar problem?
Thanks in advance!
Code: Select all
1>C:\Programme\Microsoft Visual Studio 8\VC\include\xdebug(32) : warning C4229: anachronism used : modifiers on data are ignored
1>C:\Programme\Microsoft Visual Studio 8\VC\include\xdebug(32) : error C2365: 'operator new' : redefinition; previous definition was 'function'
..
1>C:\Programme\Microsoft Visual Studio 8\VC\include\xlocale(338) : fatal error C1003: error count exceeds 100; stopping compilation
Last edited by ri0t on Fri Jun 22, 2007 12:54 pm, edited 1 time in total.
Hello Luke,
thanks for your quick response! I think the compile errors were caused by the inclusion of <iostream> in the file CAnimatedMeshSceneNode.cpp. Without the line the project compiles fine. Is there a reason for that line?
Only problem left was that CBoneSceneNode.h/cpp were not included in the VS project.
Thanks again.
thanks for your quick response! I think the compile errors were caused by the inclusion of <iostream> in the file CAnimatedMeshSceneNode.cpp. Without the line the project compiles fine. Is there a reason for that line?
Only problem left was that CBoneSceneNode.h/cpp were not included in the VS project.
Thanks again.
I've just dowloaded /branches/SkinnedMesh and lwo-patch, so I'll have a look at it these days.
Please, take a look at http://node.mindnever.org/Luke wrote:alexionne:
Could you list these features, I'll see if then can be in the generic skinnedMeshI've implemented really lot of LW-specific features so far
-
- Posts: 277
- Joined: Thu Dec 15, 2005 6:11 pm
Hello Luke,
I were able to write an importer for Collada using your skinning code and the FCollada library. Thanks a lot for your code!
By the way, I think I found a bug in the bounding box calculation. In file iskinnedmesh.h - method recalclulateBoundingBox - you're falling through the cases of the switch-statement, which most often causes the bounding box of the created mesh to be empty.
I were able to write an importer for Collada using your skinning code and the FCollada library. Thanks a lot for your code!
By the way, I think I found a bug in the bounding box calculation. In file iskinnedmesh.h - method recalclulateBoundingBox - you're falling through the cases of the switch-statement, which most often causes the bounding box of the created mesh to be empty.
Nice work, you plaining on releasing it? But is the FCollada library usable with irrlicht's? It might have to be an external loader.I were able to write an importer for Collada using your skinning code and the FCollada library. Thanks a lot for your code!
Thanks for finding that, lol pretty bad, committed the fix now.By the way, I think I found a bug in the bounding box calculation. In file iskinnedmesh.h - method recalclulateBoundingBox - you're falling through the cases of the switch-statement, which most often causes the bounding box of the created mesh to be empty.
Using a external library is not Irrlicht's style but it was much easier for me this way. Not sure what I'm going to do with the loader when I'm done.Luke wrote:Nice work, you plaining on releasing it? But is the FCollada library usable with irrlicht's? It might have to be an external loader.I were able to write an importer for Collada using your skinning code and the FCollada library. Thanks a lot for your code!
No problem, I'm currently having another problem Is it possible to reuse the same skinned mesh by attaching it multiple AnimatedMeshSceneNodes? I've tried this and I'm having problems with the animation. Sometimes it works nice, but sometimes a joint transformation from one node is also used with the other node.Luke wrote:Thanks for finding that, lol pretty bad, committed the fix now.By the way, I think I found a bug in the bounding box calculation. In file iskinnedmesh.h - method recalclulateBoundingBox - you're falling through the cases of the switch-statement, which most often causes the bounding box of the created mesh to be empty.
For example, when loading a model and attaching it to two animatatedmeshscenenodes, the first node is animated correctly, but the second one uses a mix of his own joint positions and the joints that the other node just moved.
Yes definitely, I've played around with 100 or so nodes sharing one mesh, no problems.Is it possible to reuse the same skinned mesh by attaching it multiple AnimatedMeshSceneNodes?
.Sometimes it works nice, but sometimes a joint transformation from one node is also used with the other node
that could happen if the mesh doesn't have animation were your animating and your not using any bone control, but that's not really a problem, it might be something else
Strange, could you send me an example. and can a have a look at the loader?
Hi Luke,Luke wrote:Yes definitely, I've played around with 100 or so nodes sharing one mesh, no problems.Is it possible to reuse the same skinned mesh by attaching it multiple AnimatedMeshSceneNodes?
.Sometimes it works nice, but sometimes a joint transformation from one node is also used with the other node
that could happen if the mesh doesn't have animation were your animating and your not using any bone control, but that's not really a problem, it might be something else
Strange, could you send me an example. and can a have a look at the loader?
thanks for your reply. I'm sorry I didn't exactly get what you were saying. I'm importing a Collada mesh with it's animation keys.
Here's the relevant code:
Code: Select all
pJoint = pSkinController->GetJoint(iJoint);
for (int k=0; k<keys.size(); k++)
{
core::vector3df translation;
core::vector3df rotation;
core::vector3df scale;
ConvertColladaToIrrlicht(matrices[k], translation, rotation, scale);
rotation *= core::vector3df(-1, -1, 1);
// we can be careless here because SkinnedMesh removes unneeded keys automatically
CSkinnedMesh::SPositionKey* posKey = mesh.createPositionKey(pIrrJoint);
posKey->frame = keys[k] * 30; // HACK
posKey->position = translation;
CSkinnedMesh::SScaleKey* scaleKey = mesh.createScaleKey(pIrrJoint);
scaleKey->frame = keys[k] * 30; // HACK
scaleKey->scale = scale;
CSkinnedMesh::SRotationKey* rotKey = mesh.createRotationKey(pIrrJoint);
rotKey->frame = keys[k] * 30; // HACK
rotKey->rotation = core::quaternion(irr::core::PI/180.0f*rotation);
}
For example I'm using a simple skinned model, where the character lifts his left arm and then his right arm. Now when I run two nodes with the same skinnedmesh at the same time, one node is animated correctly and only has one arm up at all times. But the second node will play an animation where not only his one arm is lifted, but also his second arm.
It looks like his right arm-joint overrides the sekelton right arm-joint correctly, but his left arm-joint isn't changed from the previous animation frame of the other model and appears at the joint-position that the other model used, instead of on the bind pose like the animation is supposed to be.
It seems like joints that aren't overriden by a new animation key will not be changed, thus using a joint position that could be wrong.
I hope I made myself clear. It's kinda hard to explain. I'll see if I can come up with some screenshots or some small code that illustrates the problem.
Thanks again.
well that's not really the code I talking about, but it looks fine, by the way that '* 30' hack is no longer needed as in the new animation system, frames are in floats not ints so interpolation is fine without it.thanks for your reply. I'm sorry I didn't exactly get what you were saying. I'm importing a Collada mesh with it's animation keys.
Here's the relevant code:
so does the animation in the joint completely end (no keyframes) before the animation of the mesh as a whole ends?For example I'm using a simple skinned model, where the character lifts his left arm and then his right arm. Now when I run two nodes with the same skinnedmesh at the same time, one node is animated correctly and only has one arm up at all times. But the second node will play an animation where not only his one arm is lifted, but also his second arm.
Yeah that's true, and I could easily change so it so it's overwritten by the bind pose, but this may cause problems with animation blending later on.It seems like joints that aren't overriden by a new animation key will not be changed, thus using a joint position that could be wrong.
if the animation in the joints are ending before, or starting after the whole mesh does (I haven't found a b3d and ms3d mesh with this problem) you could fill in the gap by adding an extra keyframe at the start or the end, being the same as the next keyframe there should be no interpolation (speed loss). On second thought, I can easily add this as a check in skinnedmesh and save you the work
Edit:
I've added it now, ri0t could you test it for me, I got nothing to test it with