Game Development Community

What frame is what pos?

by Daniel Buckmaster · in Torque Game Engine · 08/09/2008 (9:10 am) · 2 replies

I'm currently using one DSQ file to contain multiple animation segments of a look animation (so, for example, horizontal and vertical looking are in the same file). I've very nearly got the system working, but there's just some strange stuff going on with calculating the correct position for the thread to play at.
I stepped through updateLookAnimation where my calculations are being done, and everything is working nicely - but when the camera is looking straight ahead, the character's arms are pointing at an angle upwards. The move correctly, though - so it must be something to do with how I'm calculating the position.
When I set a thread position, what is pos 0.0? Does it correspond to keyframe 1, or keyframe 0? (Even though I can't actually create a keyframe 0 in Blender). Because it would make sense that pos 0 is keyframe 1, but when I do frame 1 / max keyframes, it can never be 0.
What about pos 1.0? I'm guessing the last keyframe I exported, but you never know...

About the author

Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!


#1
08/09/2008 (10:42 am)
A blend can be any length, but only 3 keys are referenced. 0 is your root, this should match your root.dsq pose. The sequence helper determines start/stop, the only other 2 keys we care about. ThreadPos 0.0 would be the start (up or left) and ThreadPos 1.0 would be the ending key (down or right). So, updateLookAnimation usually sets you at ThreadPos 0.5, which would be halfway between up and down, hopefully straight ahead.
Keep in mind that a blend is only relative positioning against the root (key 0). If that is wrong, your arms will go wild on you.
#2
08/09/2008 (12:16 pm)
Okay... I think I get it. I've discovered other, bigger problems I need to worry about before tackling this detail, though :P My animation blends nicely in show tool, but I can't manage to get the right values in code. My animation will play correctly at the lower end, but as I get to the other end of the segment, the values aren't correct, so the animation starts bleeding over into the next segment, and the arms start to do wacky things because they're transitioning to a different segment.