31337
12-13-2002, 03:53 PM
Alright here's the deal:
I have an MD2 loader that loads keyframes into memory. My draw function takes two parameters, a mode (not important right now), and a floating point value named frame. Here's the idea:
If it gets passed 3.5 for the frame variable, then it means draw the coordinates halfway inbetween keyframe 3 and keyframe 4.
So, what should be my algorithm for doing this? I was thinking something that looks like this:
(frames[(int)frame].x - frames[(int)frame-1)].x)*((int)frame-((int)frame-1)) + frames[(int)frame].x
However I get some very strange results. Does anybody see the error in my way? Thanks a lot
I have an MD2 loader that loads keyframes into memory. My draw function takes two parameters, a mode (not important right now), and a floating point value named frame. Here's the idea:
If it gets passed 3.5 for the frame variable, then it means draw the coordinates halfway inbetween keyframe 3 and keyframe 4.
So, what should be my algorithm for doing this? I was thinking something that looks like this:
(frames[(int)frame].x - frames[(int)frame-1)].x)*((int)frame-((int)frame-1)) + frames[(int)frame].x
However I get some very strange results. Does anybody see the error in my way? Thanks a lot