Sign in to follow this  

Keep track of model movement

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this