Animate a plane along an endless line
I'm quite new to QML and I'm trying to program a little game.
I'm trying to animate a plane flying along an endless line. If the rotation of the plane changes the plane updates it's path (line). I implemented this feature in js, but the problem is that the animations are never smooth.
Using any animation like NumberAnimation the plane moves very smooth, but these Animations are all from-to based, so I can move from A to B but I cannot (or I dont know how) move the plane continuous along an endless line using a NumberAnimation.
Any suggestions?
plan_rich
Re: Animate a plane along an endless line
Please explain more what you mean by an endless line. A screen has a limited width and height so if you call something as "endless" you surely have some special meaning for it.
Re: Animate a plane along an endless line
My plane has a rotation from 0-360 degree. I what that the plane flies in this rotation direction.
So if it has a rotation of 90 degree it moves along the x axis to the right...
plan_rich
Re: Animate a plane along an endless line
So the end point of the current animation is an intersection of the vector of its direction and the edge of the screen. Whenever the direction changes, update the end point. Note that using SmoothedAnimation might be better than NumberAnimation.