Client interpolation

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
diho
Posts: 46
Joined: Fri May 20, 2011 9:01 pm
Location: Netherlands

Client interpolation

Post by diho »

Hi all,

I have a question about client side interpolation.
Say Object A has postion V1, and a update comes in, his position is changed to V2 during a time of X ms.
What is the best way to "recreate" this movement with interpolating the vectors?

-Diho
thanhle
Posts: 325
Joined: Wed Jun 12, 2013 8:09 am

Re: Client interpolation

Post by thanhle »

Using a straightline or spline approximation?
diho
Posts: 46
Joined: Fri May 20, 2011 9:01 pm
Location: Netherlands

Re: Client interpolation

Post by diho »

I guess just a straight line.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Client interpolation

Post by mongoose7 »

(1 - x)*V1 + x*V2 as x goes from 0 to 1. The speed of Object A (assuming it isn't warping!) is 1000*sqrt(dot((V2 - V1), (V2 - V1)))/X. But you can't change the past, so you need to get A to its next position. So set V2' = 2*V2 - V1. And maybe make it go a little bit faster. You should really always be heading to where A will be at the next update, not where it should be for this update. You use feedback to keep it on course. If it gets too far away, you should just warp it, or write better code.
Post Reply