Animation questions (many questions :P)[SOLVED]

Started by
9 comments, last by Misantes 9 years, 4 months ago

That seems like good advice. I hadn't thought about exporting a rigged model without the animation (though I had tried an un-rigged model, to make certain the object loading was working in a general sense).

I've definitely a problem with the keys mtime as well. That assert keeps getting thrown, and even when printing out the values of Factor, animation time, delta time, etc. I'm a little uncertain why (well, i mean, i know why. It results in a value that isn't between 0 and 1. I'm just not certain where I'm erring to get those values and how to go about fixing it. This is totally within my ability to solve, I think, it's just becoming a little tedious at this point, as I've been working on this for a long while now. I'm mostly just feeling impatient to get moving again with developing a game, rather than the architecture. But, really, that's how programming goes, and I'm letting my impatience get in the way of just buckling down and getting through it.

Anyhow, you're right. I think most of my frustrations are coming from tackling what is likely multiple problems at once. It makes it magnitudes more difficult to solve. If I can simplify things to the point where they're solvable one by one, I'll be able to work through this (which, thus far in learning programming, seems to be how it goes tongue.png).

Anyhow, I do appreciate the advice you've given, and I'll definitely get through this (eventually, at least). I'll spend the remainder of the week stripping things down and building it up a piece at a time to try to pinpoint the problems.

Thanks again Haegarr smile.png

Edit**

I know this thread has gone on too long, and likely few people are still reading it, but in the interest of it perhaps being useful to someone else someday, I'll continue updating it. I'll just add to this comment so it doesn't get bumped.

After scaling the project down and using a simple model with a single bone, rotation, scaling and translation all work fine. Everything is rendered and placed perfectly. So, I have a feeling that I'm going wrong somewhere with the how it handles parent/child bones, perhaps? Whether it's within the exported model options or in the code, I'm still unsure. But, I'm hoping this rules out problems with the shader and perhaps some of the boneTransform issues (I suppose there could still be some in how it handles parent/child or multiple bones, but at least the math behind the rotation, translation and scaling should be fine). I recall briefly reading somewhere that assimp handles parent/child bones in a surprising manner, so I'll likely spend some time looking through their documentation to see how it's handled.

I'm also wondering if the boneOffset value is getting calculated or used incorrectly in there somewhere. Looking at the animated model in game would kind of support that. The vertices that should be affected by the offset appear as though they're down by the parent node.

So, it's definitely a problem with the way I'm handling the parent/child nodes. Here's an image of a simple rotation, where a pillar-like rectangle translates left and right. You can see where the bottom portion (the parent bone) has moved fairly far left, but the top portion (child) is inverted down near the bottom and to the right (it's translated a little bit, but it's a fraction of what it ought to be).

I've tried debugging, and it does appear to be calculating the child bones, and there is an offset matrix for the bone. I'm wondering if I'm messing up the calculation and multiplying the aiMatrix4x4 offset against the wrong thing. But, I think I'm getting closer to a solution...hopefully >.< My head's getting bruised from banging it against the desk.

Beginner here <- please take any opinions with grain of salt

This topic is closed to new replies.

Advertisement