[opensource-dev] Client-side prediction
Celierra Darling
Celierra at gmail.com
Fri Feb 5 21:13:29 PST 2010
I made a small mistake at the "current angle" (it should be -0.2ish radians
instead of -pi/4), which makes the angle difference close to a semicircle.
But still, if you add that, you end up with a vector pointing up and
backwards... (If you subtract, you end up just heading back left...)
Maybe I'm just not interpreting what you mean by the "twist" correctly?
(Even when I 'visually' do it to your picture, I get the same result...)
Am I supposed to be finding the angle between the velocity vectors, or the
angle between the (position - intersection point) vectors?
(We might want to work things out off-list, unless anyone would like to see
those details.)
Celi
.
On Fri, Feb 5, 2010 at 10:22 PM, Nexii Malthus <nexiim at googlemail.com>wrote:
> Ah, thanks Celierra. 3 planes, yes that makes a lot more sense.
>
> Hmm, trying to step through your calculations. I think you have to subtract
> the angle difference rather than add it on.
> I just tried visually going through your calcs and it seems to hit right on
> your perfect value p3.
>
> http://i48.tinypic.com/15x2wz8.png
>
> - Nexii
>
>
>
> On Sat, Feb 6, 2010 at 1:28 AM, Celierra Darling <Celierra at gmail.com>
> wrote:
> > I'm not sure about this -- I tried this with a free-flight parabola and
> got
> > a nonsense value out. Calculations attached at the end.
> > What is the significance of the "anchor"? It looks like you're trying to
> > estimate the center of the path's curvature? If you were doing that, you
> > want to intersect using the lines through p and *perpendicular* to v (in
> > 2D), not intersect the lines created by v. In 3D, I think you'd want to
> > intersect 3 planes, the two planes through p perpendicular to their
> > respective v and also the plane that contains both points.
> > I'm not sure how to extend that to handle torques on the object....
> > Have you tried estimating a = (v1 - v2)/t, and extrapolating using that
> > (p_next = p_cur + v_cur*dt + 1/2*a*dt^2)? It would also extend to
> torques
> > and angular velocity using the analogous equation. (I'm sure you could
> even
> > fit a line or spline to multiple previous values of v to get something
> even
> > higher-order, if you wanted, though with diminishing returns.)
> >
> > Celi
> > The aforementioned calculation:
> >
> > dt = 0.1
> > a = g = [0,-2]
> > initial position and velocity:
> > p1 = [0, 0]
> > v1 = [1, 0]
> > next position and velocity
> > p2 = [0.1, -0.01]
> > v2 = [1, -0.2]
> > perfect value: p3 = [0.2, -0.04]
> > lines are (p1 + s*v1) and (p2 + t*v2)
> > intersect at s = 0.05, t = -0.05, position = [0.05, 0]
> > angle change = clockwise 3pi/4 (radians)
> > current angle = -pi/4
> > angle after "twist" = pi/2 (upwards!?)
> > (it just gets worse from here - you estimate a distance upwards, and the
> > step forward using the current velocity doesn't get you back to y=0.)
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/opensource-dev/attachments/20100206/7baff9af/attachment.htm
More information about the opensource-dev
mailing list