# Keep track of model movement

This topic is 4025 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

So I have my fully functional bones-system running and now I want to move a character around on my flat mesh. I choose a starting position and translate to it. I render the model. Now its pretty easy to keep track of rotation, since its just one float that changes over time. But it different with the translation-part of it. Lets say I want to move from a position to another. And I want to interpolate between the two to make it look as smooth as posible. Can someone show me the math in it, or maybe direct me to an article explaining it? I know this must be an easy task, but I cant seem to figure it out. Also, would it be better to store a matrix, for each model, as a 16 float array with the translation/rotation info. And then load a matrix from it every frame. Sound posible but maybe a little heavy. If its an idea hwo do I do it? Please enlighten me! =)

##### Share on other sites
Quote:
 Now its pretty easy to keep track of rotation, since its just one float that changes over time.

Only if you rotate around a single fixed axis.

Quote:
 And I want to interpolate between the two to make it look as smooth as posible. Can someone show me the math in it, or maybe direct me to an article explaining it?

Linear interpolation for translational components, Slerp for rotational components (assuming quaternions, which interpolate better than other forms of rotation).

Quote:
 Also, would it be better to store a matrix, for each model, as a 16 float array with the translation/rotation info. And then load a matrix from it every frame. Sound posible but maybe a little heavy. If its an idea hwo do I do it?

It's better to store translation (as a vector), rotation (as a quaternion) and maybe scale (as a vector) separately and compose a matrix only when you need it. Matrices do not interpolate well and extracting the components (rotation, scale, translation) if you need them becomes more difficult.

1. 1
2. 2
Rutin
23
3. 3
JoeJ
20
4. 4
5. 5

• 29
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631740
• Total Posts
3001962
×